Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- TextEndOfParagraph.cs
- CodeAttributeDeclaration.cs
- RegexFCD.cs
- LoginCancelEventArgs.cs
- CultureNotFoundException.cs
- SqlException.cs
- ComponentDispatcherThread.cs
- ReadOnlyHierarchicalDataSourceView.cs
- XmlAnyElementAttribute.cs
- XMLUtil.cs
- TreeNodeCollection.cs
- control.ime.cs
- Activator.cs
- XsdCachingReader.cs
- RenderCapability.cs
- ExpandCollapsePattern.cs
- BinaryObjectReader.cs
- SQLDecimalStorage.cs
- DataSvcMapFileSerializer.cs
- WebPartExportVerb.cs
- RegistryPermission.cs
- DocumentGridPage.cs
- DbReferenceCollection.cs
- BlockUIContainer.cs
- InitializerFacet.cs
- EditorBrowsableAttribute.cs
- XmlArrayItemAttribute.cs
- SchemaElementDecl.cs
- XmlnsCache.cs
- XmlSchemaSimpleTypeRestriction.cs
- COAUTHINFO.cs
- SQLChars.cs
- QilCloneVisitor.cs
- ImageKeyConverter.cs
- SiteMapNodeItemEventArgs.cs
- ForwardPositionQuery.cs
- PrinterResolution.cs
- MimeFormImporter.cs
- OrderByQueryOptionExpression.cs
- UiaCoreApi.cs
- DataTableExtensions.cs
- DistributedTransactionPermission.cs
- ProfilePropertySettings.cs
- EmbossBitmapEffect.cs
- SmtpClient.cs
- QuaternionAnimationBase.cs
- ProfileEventArgs.cs
- DesignerCategoryAttribute.cs
- ZoneMembershipCondition.cs
- CultureInfoConverter.cs
- IDispatchConstantAttribute.cs
- ChannelManagerBase.cs
- DrawingAttributeSerializer.cs
- QuadTree.cs
- SQLInt32Storage.cs
- RegularExpressionValidator.cs
- SimpleMailWebEventProvider.cs
- XmlSerializerSection.cs
- KnownBoxes.cs
- QilTargetType.cs
- TemplateComponentConnector.cs
- ComboBoxAutomationPeer.cs
- CanExecuteRoutedEventArgs.cs
- DurableInstanceContextProvider.cs
- DeploymentSectionCache.cs
- BitmapCodecInfoInternal.cs
- TrustLevelCollection.cs
- ProofTokenCryptoHandle.cs
- IdleTimeoutMonitor.cs
- ScrollBarAutomationPeer.cs
- MenuItem.cs
- Crypto.cs
- ExtensionSimplifierMarkupObject.cs
- OracleException.cs
- StorageInfo.cs
- MimeTypeAttribute.cs
- SystemParameters.cs
- UpDownEvent.cs
- UnaryNode.cs
- TextTreeDeleteContentUndoUnit.cs
- PersonalizationStateInfoCollection.cs
- XPathNodeInfoAtom.cs
- NodeLabelEditEvent.cs
- DataSourceHelper.cs
- DisplayMemberTemplateSelector.cs
- FormatterConverter.cs
- SelectedDatesCollection.cs
- UIPermission.cs
- HitTestDrawingContextWalker.cs
- PropertyDescriptorCollection.cs
- DetailsViewModeEventArgs.cs
- Clause.cs
- CallbackHandler.cs
- DiscoveryExceptionDictionary.cs
- MetaDataInfo.cs
- returneventsaver.cs
- LinkedList.cs
- TaskForm.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- Native.cs