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
- UrlRoutingModule.cs
- XsltOutput.cs
- VisualTreeHelper.cs
- WaitForChangedResult.cs
- CodeIdentifiers.cs
- ViewKeyConstraint.cs
- smtppermission.cs
- PerfProviderCollection.cs
- TrackingMemoryStream.cs
- SystemIPv4InterfaceProperties.cs
- DataContractSerializerSection.cs
- RenamedEventArgs.cs
- EdmComplexPropertyAttribute.cs
- ValueType.cs
- CompiledRegexRunnerFactory.cs
- ObjectListComponentEditor.cs
- SimpleBitVector32.cs
- SystemIPv6InterfaceProperties.cs
- DropAnimation.xaml.cs
- AuthStoreRoleProvider.cs
- CommandPlan.cs
- StringConcat.cs
- InfoCardSymmetricAlgorithm.cs
- InkCanvasInnerCanvas.cs
- ClientConfigPaths.cs
- MemoryFailPoint.cs
- EventDescriptor.cs
- DataObjectSettingDataEventArgs.cs
- ManagementObjectCollection.cs
- XPathBuilder.cs
- TransactionFlowOption.cs
- IncrementalReadDecoders.cs
- BindingElement.cs
- BoundColumn.cs
- RIPEMD160.cs
- HyperLink.cs
- BuildProvider.cs
- NativeMethodsOther.cs
- WebPartExportVerb.cs
- Regex.cs
- xsdvalidator.cs
- _SSPIWrapper.cs
- Line.cs
- SequentialUshortCollection.cs
- ProgressBar.cs
- SqlBuilder.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- SqlWebEventProvider.cs
- InputBindingCollection.cs
- XamlRtfConverter.cs
- SystemEvents.cs
- ActivityExecutionContext.cs
- LabelAutomationPeer.cs
- XamlSerializationHelper.cs
- ComponentDispatcher.cs
- BaseDataListDesigner.cs
- OpCopier.cs
- PageRanges.cs
- ClientFormsAuthenticationCredentials.cs
- ImageButton.cs
- WsdlImporterElement.cs
- SqlConnectionHelper.cs
- CodeCommentStatement.cs
- ListViewCommandEventArgs.cs
- CngUIPolicy.cs
- RewritingSimplifier.cs
- sqlcontext.cs
- VirtualizingPanel.cs
- SourceChangedEventArgs.cs
- ListBoxChrome.cs
- webclient.cs
- CompiledRegexRunner.cs
- SymmetricCryptoHandle.cs
- NetSectionGroup.cs
- Animatable.cs
- StateChangeEvent.cs
- InlineUIContainer.cs
- CharacterString.cs
- AstNode.cs
- SpotLight.cs
- StorageAssociationSetMapping.cs
- CodeBlockBuilder.cs
- Point3DCollection.cs
- TagPrefixAttribute.cs
- RtfToXamlLexer.cs
- FormCollection.cs
- UpdateProgress.cs
- GeneralTransform3DGroup.cs
- ScrollViewer.cs
- StrokeRenderer.cs
- PasswordPropertyTextAttribute.cs
- SQLGuid.cs
- SafeBuffer.cs
- ObjectQueryProvider.cs
- DbProviderSpecificTypePropertyAttribute.cs
- BamlResourceSerializer.cs
- NetMsmqSecurity.cs
- LogExtent.cs
- AxDesigner.cs
- CachedPathData.cs