Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------------------- // // 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
- FileChangeNotifier.cs
- DBSchemaTable.cs
- LogPolicy.cs
- AppSettings.cs
- EventLog.cs
- PropertyEntry.cs
- FixedSOMTextRun.cs
- TemplatedWizardStep.cs
- FrameworkContentElementAutomationPeer.cs
- InstanceLockedException.cs
- CharacterMetricsDictionary.cs
- WpfPayload.cs
- LassoSelectionBehavior.cs
- VerificationException.cs
- SubqueryRules.cs
- ConstrainedGroup.cs
- DataGridViewTextBoxEditingControl.cs
- HTTPNotFoundHandler.cs
- IdentitySection.cs
- HttpServerUtilityWrapper.cs
- Marshal.cs
- MsmqIntegrationProcessProtocolHandler.cs
- RpcResponse.cs
- StorageAssociationTypeMapping.cs
- WmlValidatorAdapter.cs
- EnvironmentPermission.cs
- TextDecorationCollection.cs
- MSG.cs
- UpDownEvent.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- Vector.cs
- DashStyle.cs
- LocalIdKeyIdentifierClause.cs
- RegexRunner.cs
- MainMenu.cs
- BamlResourceSerializer.cs
- ContentDisposition.cs
- TypographyProperties.cs
- HttpCookiesSection.cs
- ControlBuilderAttribute.cs
- C14NUtil.cs
- WmfPlaceableFileHeader.cs
- UrlPath.cs
- EventLogPermission.cs
- ChoiceConverter.cs
- ChannelServices.cs
- InfoCardSymmetricAlgorithm.cs
- HostingEnvironment.cs
- PropertyPathConverter.cs
- ToolStripSplitStackLayout.cs
- _Win32.cs
- EmissiveMaterial.cs
- DataPagerFieldCollection.cs
- AssociationTypeEmitter.cs
- EdmComplexTypeAttribute.cs
- ObjectMemberMapping.cs
- CodeTypeConstructor.cs
- PathGradientBrush.cs
- BehaviorEditorPart.cs
- SystemWebCachingSectionGroup.cs
- EditBehavior.cs
- CqlBlock.cs
- Preprocessor.cs
- WindowsHyperlink.cs
- ExcCanonicalXml.cs
- WriteableBitmap.cs
- BindingGroup.cs
- LicenseContext.cs
- JoinQueryOperator.cs
- DispatcherHookEventArgs.cs
- TextFragmentEngine.cs
- FileChangesMonitor.cs
- PreviewKeyDownEventArgs.cs
- PolygonHotSpot.cs
- XmlExtensionFunction.cs
- ThemeableAttribute.cs
- MaskedTextBoxDesigner.cs
- ColumnBinding.cs
- HealthMonitoringSectionHelper.cs
- Helpers.cs
- OleCmdHelper.cs
- FormViewInsertedEventArgs.cs
- CommandField.cs
- AppModelKnownContentFactory.cs
- LocalBuilder.cs
- ManipulationLogic.cs
- DbConnectionPoolGroup.cs
- ColumnClickEvent.cs
- NativeMethods.cs
- ScopeCollection.cs
- PerspectiveCamera.cs
- GeneralTransform3DTo2DTo3D.cs
- XmlSchemaCollection.cs
- AttributeSetAction.cs
- WebServiceClientProxyGenerator.cs
- TabPage.cs
- OneOfScalarConst.cs
- CryptoStream.cs
- ScrollProperties.cs
- QuotedPairReader.cs