Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Mail / WriteStateInfoBase.cs / 1305376 / WriteStateInfoBase.cs
namespace System.Net.Mime { internal abstract class WriteStateInfoBase { protected byte[] _header; protected byte[] _footer; protected int _maxLineLength; protected byte[] buffer; protected int _mimeHeaderLength; //1024 was originally set in the encoding streams protected const int defaultBufferSize = 1024; internal WriteStateInfoBase() { this.buffer = new byte[defaultBufferSize]; this._header = new byte[0]; ; this._footer = new byte[0]; this._maxLineLength = EncodedStreamFactory.DefaultMaxLineLength; this._mimeHeaderLength = 0; } internal WriteStateInfoBase(int bufferSize, byte[] header, byte[] footer, int maxLineLength) { this.buffer = new byte[bufferSize]; this._header = header; this._footer = footer; this._maxLineLength = maxLineLength; this._mimeHeaderLength = 0; } internal int FooterLength { get { return _footer.Length; } } //The actual length of the header that this will be appended to //e.g. Subject : //this length is taken into account for folding on the first line internal int MimeHeaderLength { get { return this._mimeHeaderLength; } set { this._mimeHeaderLength = value; } } internal int HeaderLength { get { return _header.Length; } } internal byte[] Footer { get { return _footer; } } internal byte[] Header { get { return _header; } } internal byte[] Buffer { get { return this.buffer; } } internal int Length { get; set; } internal int CurrentLineLength { get; set; } //attempt to increase the buffer length. //returns false if buffer length is at int(max) internal void ResizeBuffer() { int newsize = buffer.Length * 2; //try to resize- if the machine doesn't have the memory to resize just let it throw byte[] tempBuffer = new byte[newsize]; buffer.CopyTo(tempBuffer, 0); this.buffer = tempBuffer; } internal void AppendHeader() { if (this.Header != null) { this.Header.CopyTo(this.buffer, this.Length); this.CurrentLineLength += this.HeaderLength; this.Length += this.HeaderLength; } } internal void AppendFooter() { if (this.Footer != null) { this.Footer.CopyTo(this.buffer, this.Length); this.CurrentLineLength += this.FooterLength; this.Length += this.FooterLength; } } internal int MaxLineLength { get { return this._maxLineLength; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WorkflowInstanceProvider.cs
- Compiler.cs
- Journal.cs
- DocumentViewerConstants.cs
- SQLDateTime.cs
- CallbackHandler.cs
- CodeDirectionExpression.cs
- PageVisual.cs
- DataServiceHost.cs
- recordstatescratchpad.cs
- TextServicesDisplayAttribute.cs
- SqlBulkCopy.cs
- RepeatButtonAutomationPeer.cs
- RoleGroupCollectionEditor.cs
- EntityPropertyMappingAttribute.cs
- AppAction.cs
- HttpGetProtocolReflector.cs
- Component.cs
- Int16AnimationUsingKeyFrames.cs
- AggregatePushdown.cs
- MessageQueueCriteria.cs
- SecurityStateEncoder.cs
- MultiPageTextView.cs
- DataGridViewEditingControlShowingEventArgs.cs
- PipelineModuleStepContainer.cs
- WhitespaceRule.cs
- EventEntry.cs
- Highlights.cs
- SqlGenericUtil.cs
- AutomationEventArgs.cs
- RouteItem.cs
- Currency.cs
- Timer.cs
- OrderByLifter.cs
- PeerPresenceInfo.cs
- GraphicsState.cs
- PartitionerStatic.cs
- Regex.cs
- MarkupExtensionParser.cs
- FileSystemInfo.cs
- RegexCompilationInfo.cs
- ComboBox.cs
- DataReaderContainer.cs
- GridViewRow.cs
- TextRunProperties.cs
- PointAnimationClockResource.cs
- AudioFileOut.cs
- LayoutTableCell.cs
- BaseCollection.cs
- Pkcs7Signer.cs
- AssemblyResolver.cs
- RemotingConfiguration.cs
- SqlClientWrapperSmiStream.cs
- _IPv6Address.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- HitTestWithPointDrawingContextWalker.cs
- IntSecurity.cs
- ContextStack.cs
- EncoderBestFitFallback.cs
- SafeCryptContextHandle.cs
- SqlCommandBuilder.cs
- PublisherIdentityPermission.cs
- MethodSignatureGenerator.cs
- HttpModuleActionCollection.cs
- NegationPusher.cs
- SimpleModelProvider.cs
- BindingNavigator.cs
- NotImplementedException.cs
- SQLInt32Storage.cs
- ConfigurationHandlersInstallComponent.cs
- SharedUtils.cs
- PersonalizationEntry.cs
- Config.cs
- StorageMappingItemCollection.cs
- RelationshipConstraintValidator.cs
- precedingsibling.cs
- TriState.cs
- XmlSchemaCompilationSettings.cs
- XMLSchema.cs
- GenerateScriptTypeAttribute.cs
- ReflectionUtil.cs
- MobileControlBuilder.cs
- SqlCacheDependencySection.cs
- SqlNodeTypeOperators.cs
- PrimitiveCodeDomSerializer.cs
- SerializationInfo.cs
- DesignerCatalogPartChrome.cs
- HtmlButton.cs
- BindableAttribute.cs
- CuspData.cs
- MimeParameterWriter.cs
- ReversePositionQuery.cs
- CodeCommentStatement.cs
- ToolStripRenderer.cs
- MenuBindingsEditorForm.cs
- IntSecurity.cs
- WriteFileContext.cs
- HtmlControlPersistable.cs
- XMLDiffLoader.cs
- ColorTranslator.cs