Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / BuildTasks / MS / Internal / Shared / SourceFileInfo.cs / 1 / SourceFileInfo.cs
//---------------------------------------------------------------------------- // // File: SourceFileInfo.cs // // Description: // an internal class that keeps the related information for a source file. // Such as the relative path, source directory, Link path and // file stream etc. // // This can be shared by different build tasks. // // History: // 01/10/2007: weibz Created // // Copyright (C) 2007 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Security.Permissions; using System.IO; namespace MS.Internal { #region SourceFileInfo //// SourceFileInfo class // internal class SourceFileInfo { #region Constructor //// Constructor // internal SourceFileInfo(string filePath) { _filePath = filePath; _sourcePath = null; _relativeSourceFilePath = null; _stream = null; _isXamlFile = false; if (!string.IsNullOrEmpty(filePath) && filePath.ToUpperInvariant().EndsWith(XAML, StringComparison.Ordinal)) { _isXamlFile = true; } } #endregion Constructor #region Properties // // The original file Path // internal string OriginalFilePath { get { return _filePath; } } // // The new Source Directory for this filepath // // If the file is under the project root, this is the project root directory, // otherwise, this is the directory of the file. // internal string SourcePath { get { return _sourcePath; } set { _sourcePath = value; } } // // The new relative path which is relative to the SourcePath. // // If it is XamlFile, the RelativeSourceFilePath would not include the .xaml extension. // internal string RelativeSourceFilePath { get { return _relativeSourceFilePath; } set { _relativeSourceFilePath = value; } } // // Indicate if the source file is a xaml file or not. // internal bool IsXamlFile { get { return _isXamlFile; } } // // Stream of the file // internal Stream Stream { get { // // If the stream is not set for the file, get it from file system in Disk. // if ( _stream == null) { _stream = File.OpenRead(_filePath); } return _stream; } set { _stream = value; } } #endregion Properties #region internal methods // // Close the stream. // internal void CloseStream() { if (_stream != null) { _stream.Close(); _stream = null; } } #endregion #region Private Data private string _filePath; private string _sourcePath; private string _relativeSourceFilePath; private Stream _stream; private bool _isXamlFile; private const string XAML = ".XAML"; #endregion Private Data } #endregion SourceFileInfo } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // File: SourceFileInfo.cs // // Description: // an internal class that keeps the related information for a source file. // Such as the relative path, source directory, Link path and // file stream etc. // // This can be shared by different build tasks. // // History: // 01/10/2007: weibz Created // // Copyright (C) 2007 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Security.Permissions; using System.IO; namespace MS.Internal { #region SourceFileInfo //// SourceFileInfo class // internal class SourceFileInfo { #region Constructor //// Constructor // internal SourceFileInfo(string filePath) { _filePath = filePath; _sourcePath = null; _relativeSourceFilePath = null; _stream = null; _isXamlFile = false; if (!string.IsNullOrEmpty(filePath) && filePath.ToUpperInvariant().EndsWith(XAML, StringComparison.Ordinal)) { _isXamlFile = true; } } #endregion Constructor #region Properties // // The original file Path // internal string OriginalFilePath { get { return _filePath; } } // // The new Source Directory for this filepath // // If the file is under the project root, this is the project root directory, // otherwise, this is the directory of the file. // internal string SourcePath { get { return _sourcePath; } set { _sourcePath = value; } } // // The new relative path which is relative to the SourcePath. // // If it is XamlFile, the RelativeSourceFilePath would not include the .xaml extension. // internal string RelativeSourceFilePath { get { return _relativeSourceFilePath; } set { _relativeSourceFilePath = value; } } // // Indicate if the source file is a xaml file or not. // internal bool IsXamlFile { get { return _isXamlFile; } } // // Stream of the file // internal Stream Stream { get { // // If the stream is not set for the file, get it from file system in Disk. // if ( _stream == null) { _stream = File.OpenRead(_filePath); } return _stream; } set { _stream = value; } } #endregion Properties #region internal methods // // Close the stream. // internal void CloseStream() { if (_stream != null) { _stream.Close(); _stream = null; } } #endregion #region Private Data private string _filePath; private string _sourcePath; private string _relativeSourceFilePath; private Stream _stream; private bool _isXamlFile; private const string XAML = ".XAML"; #endregion Private Data } #endregion SourceFileInfo } // 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
- ServiceDescriptionReflector.cs
- CollectionCodeDomSerializer.cs
- UniqueConstraint.cs
- ClientUtils.cs
- WinEventWrap.cs
- ComponentCollection.cs
- UnionCodeGroup.cs
- HtmlToClrEventProxy.cs
- EditorZone.cs
- ToolboxItem.cs
- Icon.cs
- LinqDataSourceStatusEventArgs.cs
- GroupBoxDesigner.cs
- webbrowsersite.cs
- XmlDocument.cs
- FrameworkTemplate.cs
- FileVersionInfo.cs
- Matrix.cs
- DuplexChannelFactory.cs
- ISO2022Encoding.cs
- ApplicationCommands.cs
- HtmlAnchor.cs
- InitializingNewItemEventArgs.cs
- XmlTextReader.cs
- BehaviorDragDropEventArgs.cs
- IndexOutOfRangeException.cs
- ScriptRegistrationManager.cs
- MaskDesignerDialog.cs
- Attributes.cs
- AttachmentCollection.cs
- MsmqIntegrationBindingElement.cs
- BitmapEffectInputData.cs
- RoutedUICommand.cs
- ToolStripRenderEventArgs.cs
- OleDbDataAdapter.cs
- TailCallAnalyzer.cs
- ObjectDataSource.cs
- XPathNodeIterator.cs
- ClientSideProviderDescription.cs
- SEHException.cs
- HttpTransportElement.cs
- IRCollection.cs
- ExpandSegment.cs
- ProfileBuildProvider.cs
- StateDesigner.CommentLayoutGlyph.cs
- FunctionQuery.cs
- DateTime.cs
- VersionPair.cs
- GridViewAutoFormat.cs
- DirectionalLight.cs
- TextLine.cs
- ImportStoreException.cs
- RepeatBehaviorConverter.cs
- AdCreatedEventArgs.cs
- TemplateContent.cs
- FixedSOMPageElement.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- ConnectionsZone.cs
- GenericXmlSecurityToken.cs
- TimeStampChecker.cs
- Number.cs
- StorageRoot.cs
- MenuItemCollection.cs
- ErrorItem.cs
- NavigatingCancelEventArgs.cs
- SQLResource.cs
- _NegoStream.cs
- RecordBuilder.cs
- DecoderBestFitFallback.cs
- MailDefinition.cs
- LayoutTable.cs
- RenderTargetBitmap.cs
- ControlLocalizer.cs
- FormatConvertedBitmap.cs
- FormView.cs
- DataRowView.cs
- SortQuery.cs
- PostBackTrigger.cs
- DoubleKeyFrameCollection.cs
- XmlAttributeCollection.cs
- CategoriesDocumentFormatter.cs
- WebPartHeaderCloseVerb.cs
- PhysicalOps.cs
- PropertyChangingEventArgs.cs
- SoapBinding.cs
- HttpsChannelListener.cs
- PopupEventArgs.cs
- XmlSchemaSimpleTypeUnion.cs
- StringReader.cs
- ComponentSerializationService.cs
- BinaryObjectWriter.cs
- Span.cs
- XmlSchemaAppInfo.cs
- ThrowHelper.cs
- ConfigurationStrings.cs
- CollectionContainer.cs
- UnsafeNativeMethods.cs
- SymmetricAlgorithm.cs
- DataGridViewRowEventArgs.cs
- HiddenFieldPageStatePersister.cs