Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- DataServiceHostWrapper.cs
- RuleAttributes.cs
- DbProviderFactory.cs
- WebPartCancelEventArgs.cs
- ArrangedElementCollection.cs
- ImageAttributes.cs
- Popup.cs
- DataGridViewMethods.cs
- GetMemberBinder.cs
- DBConnectionString.cs
- PathSegment.cs
- WindowsEditBox.cs
- Vector.cs
- ConditionalBranch.cs
- ObjectViewListener.cs
- UnsafeNativeMethods.cs
- XsdValidatingReader.cs
- HttpProtocolImporter.cs
- SyndicationCategory.cs
- Selection.cs
- HostExecutionContextManager.cs
- SecurityResources.cs
- CompilerTypeWithParams.cs
- ConfigurationPropertyCollection.cs
- PropertyEmitterBase.cs
- BuildManagerHost.cs
- PersonalizationProvider.cs
- Splitter.cs
- SecureUICommand.cs
- SecurityHelper.cs
- SelectionItemPattern.cs
- IERequestCache.cs
- XamlGridLengthSerializer.cs
- AsyncOperationContext.cs
- WinHttpWebProxyFinder.cs
- CurrencyManager.cs
- TemplateBindingExtension.cs
- WindowsTitleBar.cs
- UseLicense.cs
- QilInvokeEarlyBound.cs
- EncoderNLS.cs
- FontFamily.cs
- EventHandlers.cs
- StateMachineWorkflow.cs
- DocumentViewerConstants.cs
- ColumnMapVisitor.cs
- DictionaryTraceRecord.cs
- WpfPayload.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- CompressionTransform.cs
- ConfigurationUtility.cs
- NetStream.cs
- InstanceContextManager.cs
- TagPrefixCollection.cs
- ConnectionProviderAttribute.cs
- TextBox.cs
- SkinBuilder.cs
- figurelength.cs
- RegexTree.cs
- Single.cs
- xamlnodes.cs
- ArgIterator.cs
- QilTernary.cs
- JoinTreeSlot.cs
- OutputCache.cs
- Dictionary.cs
- DependencyPropertyValueSerializer.cs
- BufferBuilder.cs
- URI.cs
- ToolStripContentPanelRenderEventArgs.cs
- ProjectionCamera.cs
- XmlObjectSerializerWriteContextComplex.cs
- CheckBox.cs
- controlskin.cs
- Icon.cs
- WebResourceAttribute.cs
- GorillaCodec.cs
- DataGridHeaderBorder.cs
- entityreference_tresulttype.cs
- WebMessageBodyStyleHelper.cs
- ProfileService.cs
- MetaColumn.cs
- SetIndexBinder.cs
- UIAgentMonitorHandle.cs
- DurationConverter.cs
- PropertyContainer.cs
- UITypeEditor.cs
- CssClassPropertyAttribute.cs
- mediapermission.cs
- ConstraintCollection.cs
- activationcontext.cs
- DataGridViewCellStyleChangedEventArgs.cs
- SettingsBase.cs
- ImageAnimator.cs
- CryptoConfig.cs
- RSAPKCS1KeyExchangeFormatter.cs
- Literal.cs
- Stroke.cs
- HandoffBehavior.cs
- ToolStripItemClickedEventArgs.cs