Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / BuildTasks / MS / Internal / Shared / SourceFileInfo.cs / 1305600 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NumericUpDown.cs
- SafeRightsManagementSessionHandle.cs
- ToolStripItemClickedEventArgs.cs
- XmlDocumentFragment.cs
- ConstantExpression.cs
- TPLETWProvider.cs
- SecurityDocument.cs
- TypeName.cs
- ListItemConverter.cs
- _Semaphore.cs
- SqlMetaData.cs
- ReservationCollection.cs
- BindToObject.cs
- ToolStripSplitStackLayout.cs
- ISFTagAndGuidCache.cs
- TextElementEnumerator.cs
- BooleanConverter.cs
- RSAOAEPKeyExchangeFormatter.cs
- AncestorChangedEventArgs.cs
- ReachBasicContext.cs
- Unit.cs
- AuthenticationException.cs
- HyperLinkField.cs
- NavigationProperty.cs
- PrintingPermissionAttribute.cs
- FileClassifier.cs
- PkcsUtils.cs
- QueryComponents.cs
- Vector3DAnimation.cs
- TransformPatternIdentifiers.cs
- DataGridPageChangedEventArgs.cs
- MimeBasePart.cs
- SmiXetterAccessMap.cs
- ExtenderControl.cs
- PropertyGridView.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- printdlgexmarshaler.cs
- TypeUtils.cs
- safex509handles.cs
- PageThemeCodeDomTreeGenerator.cs
- RelativeSource.cs
- IgnoreFileBuildProvider.cs
- StrongTypingException.cs
- RtfControls.cs
- UITypeEditor.cs
- ListViewInsertionMark.cs
- Accessors.cs
- AuthenticatedStream.cs
- DeobfuscatingStream.cs
- PrimitiveType.cs
- DynamicQueryableWrapper.cs
- ImageField.cs
- ProcessProtocolHandler.cs
- DataGridViewUtilities.cs
- ResourcePermissionBaseEntry.cs
- TableNameAttribute.cs
- WindowsEditBox.cs
- ListViewItemSelectionChangedEvent.cs
- HiddenField.cs
- AppModelKnownContentFactory.cs
- ResXResourceReader.cs
- BrowserCapabilitiesFactoryBase.cs
- StorageAssociationSetMapping.cs
- TreeNodeBindingCollection.cs
- HtmlWindowCollection.cs
- ParagraphVisual.cs
- HttpBindingExtension.cs
- ArrayHelper.cs
- ListControl.cs
- RowCache.cs
- Dump.cs
- EventEntry.cs
- ItemCheckEvent.cs
- ManagementQuery.cs
- TemplateColumn.cs
- TreeNodeMouseHoverEvent.cs
- ObjRef.cs
- Certificate.cs
- XmlSchemaSimpleContentRestriction.cs
- InvalidPrinterException.cs
- ExpressionPrefixAttribute.cs
- PageEventArgs.cs
- BatchParser.cs
- X509Chain.cs
- RectAnimationClockResource.cs
- DispatcherTimer.cs
- DataBindingExpressionBuilder.cs
- SystemUdpStatistics.cs
- XmlResolver.cs
- TextMetrics.cs
- _OSSOCK.cs
- HierarchicalDataBoundControlAdapter.cs
- AnnotationResourceCollection.cs
- ListViewTableRow.cs
- COAUTHIDENTITY.cs
- DynamicRendererThreadManager.cs
- ClientData.cs
- SqlNodeTypeOperators.cs
- ClientConfigPaths.cs
- DbConnectionPoolIdentity.cs