Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Configuration / CapabilitiesState.cs / 1305376 / CapabilitiesState.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System.Collections; using System.Collections.Specialized; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Security; using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Web.Caching; using System.Web.Compilation; using System.Web.Hosting; using System.Security.Permissions; // // Encapsulates the evaluation state used in computing capabilities // internal class CapabilitiesState { internal HttpRequest _request; internal IDictionary _values; internal ArrayList _matchlist; internal ArrayList _regexlist; internal bool _exit; internal bool _evaluateOnlyUserAgent; internal CapabilitiesState(HttpRequest request, IDictionary values) { _request = request; _values = values; _matchlist = new ArrayList(); _regexlist = new ArrayList(); } internal bool EvaluateOnlyUserAgent { get { return _evaluateOnlyUserAgent; } set { _evaluateOnlyUserAgent = value; } } internal virtual void ClearMatch() { if (_matchlist == null) { _regexlist = new ArrayList(); _matchlist = new ArrayList(); } else { _regexlist.Clear(); _matchlist.Clear(); } } internal virtual void AddMatch(DelayedRegex regex, Match match) { _regexlist.Add(regex); _matchlist.Add(match); } internal virtual void PopMatch() { _regexlist.RemoveAt(_regexlist.Count - 1); _matchlist.RemoveAt(_matchlist.Count - 1); } internal virtual String ResolveReference(String refname) { if (_matchlist == null) return String.Empty; int i = _matchlist.Count; while (i > 0) { i--; int groupnum = ((DelayedRegex)_regexlist[i]).GroupNumberFromName(refname); if (groupnum >= 0) { Group group = ((Match)_matchlist[i]).Groups[groupnum]; if (group.Success) { return group.ToString(); } } } return String.Empty; } [AspNetHostingPermission(SecurityAction.Assert, Level=AspNetHostingPermissionLevel.Low)] string ResolveServerVariableWithAssert(string varname) { string result = _request.ServerVariables[varname]; if (result == null) return string.Empty; return result; } internal virtual String ResolveServerVariable(String varname) { if (varname.Length == 0 || varname == "HTTP_USER_AGENT") return HttpCapabilitiesDefaultProvider.GetUserAgent(_request); if (EvaluateOnlyUserAgent) return string.Empty; return ResolveServerVariableWithAssert(varname); } internal virtual String ResolveVariable(String varname) { String result; result = (String)_values[varname]; if (result == null) return String.Empty; return result; } internal virtual void SetVariable(String varname, String value) { _values[varname] = value; } internal virtual bool Exit { get { return _exit; } set { _exit = value; } } } } // 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
- ValueOfAction.cs
- SecurityKeyUsage.cs
- FormatConvertedBitmap.cs
- PropertyOverridesTypeEditor.cs
- Logging.cs
- TextTreeDeleteContentUndoUnit.cs
- WebPartMenu.cs
- TimeSpanSecondsConverter.cs
- DataRowExtensions.cs
- SamlDoNotCacheCondition.cs
- x509store.cs
- httpapplicationstate.cs
- MulticastOption.cs
- ImageListStreamer.cs
- XmlQueryOutput.cs
- WindowPattern.cs
- _SafeNetHandles.cs
- DataServiceRequestOfT.cs
- StrokeDescriptor.cs
- Command.cs
- WebPartEditorOkVerb.cs
- Transform3DGroup.cs
- BitmapCache.cs
- RelationshipSet.cs
- RoutedCommand.cs
- XamlStyleSerializer.cs
- PersonalizationState.cs
- CursorEditor.cs
- XPathNodePointer.cs
- TextEvent.cs
- ScrollableControlDesigner.cs
- ItemChangedEventArgs.cs
- SecurityTokenRequirement.cs
- CustomPopupPlacement.cs
- SystemBrushes.cs
- PopupRoot.cs
- AutoResetEvent.cs
- WsatExtendedInformation.cs
- HighlightComponent.cs
- SchemaNotation.cs
- RtfToXamlReader.cs
- EventLogWatcher.cs
- MemberPath.cs
- XmlWriterSettings.cs
- PrivacyNoticeBindingElementImporter.cs
- CompositeDataBoundControl.cs
- FilteredReadOnlyMetadataCollection.cs
- GridViewColumnHeader.cs
- MethodBody.cs
- VirtualPath.cs
- MenuItemBinding.cs
- IFormattable.cs
- DynamicPropertyHolder.cs
- DesignerSerializerAttribute.cs
- DATA_BLOB.cs
- StylusSystemGestureEventArgs.cs
- UserControlParser.cs
- Scheduling.cs
- ObsoleteAttribute.cs
- Identity.cs
- MenuItemStyle.cs
- DefaultDiscoveryService.cs
- AsyncResult.cs
- SqlCacheDependencyDatabaseCollection.cs
- ListControlConvertEventArgs.cs
- CodeEventReferenceExpression.cs
- BufferModeSettings.cs
- FormViewRow.cs
- SqlDataReader.cs
- StreamReader.cs
- OuterGlowBitmapEffect.cs
- DecimalStorage.cs
- WebPartMenuStyle.cs
- DiagnosticTraceRecords.cs
- messageonlyhwndwrapper.cs
- IChannel.cs
- ProxyWebPartManagerDesigner.cs
- CopyCodeAction.cs
- JoinQueryOperator.cs
- XmlSchemaCollection.cs
- FileLoadException.cs
- AnimationClockResource.cs
- DataGridTextBoxColumn.cs
- lengthconverter.cs
- PrintingPermissionAttribute.cs
- MultiPageTextView.cs
- WindowsFormsEditorServiceHelper.cs
- RectangleHotSpot.cs
- BindToObject.cs
- TemplateContainer.cs
- VolatileResourceManager.cs
- XmlCustomFormatter.cs
- KnowledgeBase.cs
- StatusBarDesigner.cs
- BitmapDecoder.cs
- TrackingMemoryStreamFactory.cs
- TableRow.cs
- DateTimeSerializationSection.cs
- CTreeGenerator.cs
- Pkcs7Signer.cs