Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / Script / Serialization / JavaScriptString.cs / 1305376 / JavaScriptString.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Script.Serialization { using System; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Text; internal class JavaScriptString { private string _s; private int _index; internal JavaScriptString(string s) { _s = s; } internal NullableGetNextNonEmptyChar() { while (_s.Length > _index) { char c = _s[_index++]; if (!Char.IsWhiteSpace(c)) { return c; } } return null; } internal Nullable MoveNext() { if (_s.Length > _index) { return _s[_index++]; } return null; } internal string MoveNext(int count) { if (_s.Length >= _index + count) { string result = _s.Substring(_index, count); _index += count; return result; } return null; } internal void MovePrev() { if (_index > 0) { _index--; } } internal void MovePrev(int count) { while (_index > 0 && count > 0) { _index--; count--; } } public override string ToString() { if (_s.Length > _index) { return _s.Substring(_index); } return String.Empty; } internal string GetDebugString(string message) { return message + " (" + _index + "): " + _s; } } } // 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
- SiteMembershipCondition.cs
- GridToolTip.cs
- DoubleCollectionValueSerializer.cs
- TemplateBindingExpressionConverter.cs
- ExtendedPropertyDescriptor.cs
- ScrollChrome.cs
- PropertyCondition.cs
- SplitterEvent.cs
- Matrix.cs
- SoapHttpTransportImporter.cs
- TemplateField.cs
- IpcClientChannel.cs
- ListManagerBindingsCollection.cs
- Point4D.cs
- ServiceDescriptionImporter.cs
- OnOperation.cs
- ConnectionsZoneAutoFormat.cs
- Vector.cs
- BlurBitmapEffect.cs
- CompositeTypefaceMetrics.cs
- CommandLineParser.cs
- ConsumerConnectionPoint.cs
- ScriptResourceHandler.cs
- HtmlTableCell.cs
- _ContextAwareResult.cs
- SafeNativeMethods.cs
- SQLChars.cs
- XmlSchemaDatatype.cs
- WebPartConnectionsCancelEventArgs.cs
- Pointer.cs
- ImageCodecInfoPrivate.cs
- BypassElement.cs
- ProfilePropertyMetadata.cs
- QueryAccessibilityHelpEvent.cs
- HttpConfigurationContext.cs
- ClickablePoint.cs
- SymLanguageVendor.cs
- FastEncoder.cs
- StickyNoteContentControl.cs
- CompatibleIComparer.cs
- SystemWebSectionGroup.cs
- DataGridViewComboBoxColumn.cs
- Speller.cs
- HtmlImage.cs
- MemoryFailPoint.cs
- DataGridDetailsPresenter.cs
- DbSourceParameterCollection.cs
- HttpDebugHandler.cs
- WorkItem.cs
- contentDescriptor.cs
- CmsInterop.cs
- CfgRule.cs
- WindowsImpersonationContext.cs
- WorkflowQueue.cs
- LinqDataSourceDeleteEventArgs.cs
- AttachInfo.cs
- SmtpSection.cs
- SettingsSavedEventArgs.cs
- EmptyQuery.cs
- UrlMapping.cs
- GroupBox.cs
- EntityDataSourceStatementEditor.cs
- VisualStyleElement.cs
- DebugController.cs
- BoundColumn.cs
- QueryServiceConfigHandle.cs
- ProfileProvider.cs
- WindowsRichEditRange.cs
- HTTPNotFoundHandler.cs
- Compiler.cs
- MasterPageParser.cs
- FixedFlowMap.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- DuplicateWaitObjectException.cs
- RegisteredExpandoAttribute.cs
- Converter.cs
- RoutedEventConverter.cs
- UIElementAutomationPeer.cs
- ImageAnimator.cs
- SessionStateItemCollection.cs
- GenericsInstances.cs
- DataServiceQueryOfT.cs
- ImportContext.cs
- HttpBufferlessInputStream.cs
- StylusEventArgs.cs
- BehaviorEditorPart.cs
- ReadOnlyDictionary.cs
- PartitionResolver.cs
- UdpContractFilterBehavior.cs
- RtType.cs
- _OverlappedAsyncResult.cs
- ListView.cs
- PartialCachingControl.cs
- SQLBytesStorage.cs
- PropertyGridEditorPart.cs
- XPathArrayIterator.cs
- EmptyStringExpandableObjectConverter.cs
- RuleInfoComparer.cs
- MetadataHelper.cs
- VScrollBar.cs