Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Build / 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: [....] 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
- IsolatedStoragePermission.cs
- MetadataAssemblyHelper.cs
- Pair.cs
- ColorTransform.cs
- SimpleExpression.cs
- AmbientLight.cs
- WsatServiceCertificate.cs
- ImageDrawing.cs
- cookieexception.cs
- DbMetaDataColumnNames.cs
- PanelStyle.cs
- RangeBase.cs
- Padding.cs
- LinearQuaternionKeyFrame.cs
- BlockUIContainer.cs
- COMException.cs
- ToolstripProfessionalRenderer.cs
- UInt64Storage.cs
- LambdaCompiler.Expressions.cs
- AuthenticationSection.cs
- ToolStripOverflow.cs
- DetailsViewPageEventArgs.cs
- MaterialGroup.cs
- BinaryUtilClasses.cs
- PrimaryKeyTypeConverter.cs
- GroupByQueryOperator.cs
- BmpBitmapEncoder.cs
- PartitionResolver.cs
- BamlCollectionHolder.cs
- StatusBarPanel.cs
- CustomTrackingRecord.cs
- InputScopeNameConverter.cs
- CompositeCollection.cs
- PasswordTextNavigator.cs
- CodeDelegateInvokeExpression.cs
- HyperLink.cs
- DataGridViewColumn.cs
- FormsAuthenticationCredentials.cs
- XmlBoundElement.cs
- COM2PropertyBuilderUITypeEditor.cs
- CompositionCommandSet.cs
- TextTreeText.cs
- IndependentAnimationStorage.cs
- EntityContainerEntitySetDefiningQuery.cs
- ProviderUtil.cs
- TableLayoutPanelResizeGlyph.cs
- DataGridViewImageCell.cs
- FilterQueryOptionExpression.cs
- _AutoWebProxyScriptWrapper.cs
- LogWriteRestartAreaAsyncResult.cs
- FieldBuilder.cs
- EventWaitHandleSecurity.cs
- WebPartChrome.cs
- CreateParams.cs
- XmlAnyElementAttribute.cs
- CodeAttributeArgumentCollection.cs
- QilPatternFactory.cs
- VoiceChangeEventArgs.cs
- CharStorage.cs
- RequestNavigateEventArgs.cs
- Utils.cs
- ArrayConverter.cs
- XmlSchemaExporter.cs
- JoinElimination.cs
- InternalsVisibleToAttribute.cs
- InternalControlCollection.cs
- SinglePageViewer.cs
- EntityConnectionStringBuilderItem.cs
- sqlmetadatafactory.cs
- ScriptResourceHandler.cs
- PtsContext.cs
- HtmlTable.cs
- FlatButtonAppearance.cs
- DataKey.cs
- StringConverter.cs
- CultureTableRecord.cs
- SortDescriptionCollection.cs
- DbCommandTree.cs
- MissingMethodException.cs
- CodeAccessPermission.cs
- DynamicControlParameter.cs
- BamlCollectionHolder.cs
- SessionPageStateSection.cs
- CodeGen.cs
- Size3DConverter.cs
- SettingsBase.cs
- OverflowException.cs
- _Win32.cs
- EventlogProvider.cs
- HierarchicalDataTemplate.cs
- Query.cs
- EnvelopedSignatureTransform.cs
- DataFormats.cs
- DbConnectionOptions.cs
- IntegerCollectionEditor.cs
- OdbcParameterCollection.cs
- RegisteredScript.cs
- MetadataExchangeClient.cs
- NativeMethods.cs
- SpellCheck.cs