Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Configuration / System / Configuration / ConfigXmlReader.cs / 1 / ConfigXmlReader.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Configuration {
using System.Configuration.Internal;
using System.Collections;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
using System.IO;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Xml;
using System.Net;
internal sealed class ConfigXmlReader : XmlTextReader, IConfigErrorInfo {
string _rawXml;
int _lineOffset;
string _filename;
// Used in a decrypted configuration section to locate
// the line where the ecnrypted section begins.
bool _lineNumberIsConstant;
internal ConfigXmlReader(string rawXml, string filename, int lineOffset) :
this(rawXml, filename, lineOffset, false) {
}
internal ConfigXmlReader(string rawXml, string filename, int lineOffset, bool lineNumberIsConstant) :
base(new StringReader(rawXml)) {
_rawXml = rawXml;
_filename = filename;
_lineOffset = lineOffset;
_lineNumberIsConstant = lineNumberIsConstant;
Debug.Assert(!_lineNumberIsConstant || _lineOffset > 0,
"!_lineNumberIsConstant || _lineOffset > 0");
}
internal ConfigXmlReader Clone() {
return new ConfigXmlReader(_rawXml, _filename, _lineOffset, _lineNumberIsConstant);
}
int IConfigErrorInfo.LineNumber {
get {
if (_lineNumberIsConstant) {
return _lineOffset;
}
else if (_lineOffset > 0) {
return base.LineNumber + (_lineOffset - 1);
}
else {
return base.LineNumber;
}
}
}
string IConfigErrorInfo.Filename {
get {
return _filename;
}
}
internal string RawXml {
get {
return _rawXml;
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Configuration {
using System.Configuration.Internal;
using System.Collections;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
using System.IO;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Xml;
using System.Net;
internal sealed class ConfigXmlReader : XmlTextReader, IConfigErrorInfo {
string _rawXml;
int _lineOffset;
string _filename;
// Used in a decrypted configuration section to locate
// the line where the ecnrypted section begins.
bool _lineNumberIsConstant;
internal ConfigXmlReader(string rawXml, string filename, int lineOffset) :
this(rawXml, filename, lineOffset, false) {
}
internal ConfigXmlReader(string rawXml, string filename, int lineOffset, bool lineNumberIsConstant) :
base(new StringReader(rawXml)) {
_rawXml = rawXml;
_filename = filename;
_lineOffset = lineOffset;
_lineNumberIsConstant = lineNumberIsConstant;
Debug.Assert(!_lineNumberIsConstant || _lineOffset > 0,
"!_lineNumberIsConstant || _lineOffset > 0");
}
internal ConfigXmlReader Clone() {
return new ConfigXmlReader(_rawXml, _filename, _lineOffset, _lineNumberIsConstant);
}
int IConfigErrorInfo.LineNumber {
get {
if (_lineNumberIsConstant) {
return _lineOffset;
}
else if (_lineOffset > 0) {
return base.LineNumber + (_lineOffset - 1);
}
else {
return base.LineNumber;
}
}
}
string IConfigErrorInfo.Filename {
get {
return _filename;
}
}
internal string RawXml {
get {
return _rawXml;
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DefaultBinder.cs
- AnimationClockResource.cs
- InstanceOwnerQueryResult.cs
- COAUTHINFO.cs
- ScriptServiceAttribute.cs
- DocumentOrderComparer.cs
- TraceSwitch.cs
- SetIterators.cs
- SmtpFailedRecipientException.cs
- TreeNodeStyleCollectionEditor.cs
- NameTable.cs
- _Win32.cs
- RuntimeIdentifierPropertyAttribute.cs
- XmlKeywords.cs
- CodePageEncoding.cs
- DecoderFallback.cs
- DescendantOverDescendantQuery.cs
- RegisteredArrayDeclaration.cs
- OleDbTransaction.cs
- SettingsProviderCollection.cs
- EntryWrittenEventArgs.cs
- SqlEnums.cs
- DictionaryBase.cs
- ComponentChangedEvent.cs
- DashStyles.cs
- FloatUtil.cs
- DSASignatureFormatter.cs
- CriticalHandle.cs
- Expression.DebuggerProxy.cs
- UdpDiscoveryMessageFilter.cs
- EventToken.cs
- HttpCacheVaryByContentEncodings.cs
- InitializationEventAttribute.cs
- StylusPointDescription.cs
- DataSourceCacheDurationConverter.cs
- RemotingConfigParser.cs
- Connector.xaml.cs
- QueryStringParameter.cs
- CollectionViewGroup.cs
- DiscoveryClientElement.cs
- InvalidPipelineStoreException.cs
- ToolStripDropDownItem.cs
- TracePayload.cs
- ChineseLunisolarCalendar.cs
- CreateUserWizardDesigner.cs
- HwndHostAutomationPeer.cs
- Point4D.cs
- COM2TypeInfoProcessor.cs
- RepeatButtonAutomationPeer.cs
- LogRecordSequence.cs
- CacheOutputQuery.cs
- SQLBinaryStorage.cs
- OracleBFile.cs
- ResponseBodyWriter.cs
- CodeNamespace.cs
- CursorInteropHelper.cs
- DataStreamFromComStream.cs
- SafeRightsManagementQueryHandle.cs
- BridgeDataRecord.cs
- DiscoveryProxy.cs
- ControllableStoryboardAction.cs
- GraphicsPath.cs
- IndexerNameAttribute.cs
- PseudoWebRequest.cs
- XmlSubtreeReader.cs
- ProfileManager.cs
- QueryPageSettingsEventArgs.cs
- CreateUserWizard.cs
- MetadataArtifactLoaderResource.cs
- WebPageTraceListener.cs
- Win32.cs
- PublisherIdentityPermission.cs
- GlobalizationSection.cs
- ReachDocumentPageSerializer.cs
- XmlSubtreeReader.cs
- SystemWebSectionGroup.cs
- TextClipboardData.cs
- GridViewRowCollection.cs
- AttachInfo.cs
- SiteOfOriginContainer.cs
- QueryStringParameter.cs
- ProjectionPruner.cs
- StandardBindingElement.cs
- RetriableClipboard.cs
- CacheMode.cs
- XmlAggregates.cs
- DoubleAnimation.cs
- AdornerPresentationContext.cs
- PropertyGeneratedEventArgs.cs
- ISAPIRuntime.cs
- GenericsInstances.cs
- SapiGrammar.cs
- Missing.cs
- WebPartMovingEventArgs.cs
- UseManagedPresentationBindingElement.cs
- GZipStream.cs
- RectangleConverter.cs
- AtlasWeb.Designer.cs
- BinaryQueryOperator.cs
- TabControl.cs