Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Services / IO / System / IO / RenamedEventArgs.cs / 1305376 / RenamedEventArgs.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.IO { using System.Diagnostics; using System.Security.Permissions; using System; using System.Runtime.Versioning; ////// public class RenamedEventArgs : FileSystemEventArgs { private string oldName; private string oldFullPath; ///Provides data for the ///event. /// public RenamedEventArgs(WatcherChangeTypes changeType, string directory, string name, string oldName) : base(changeType, directory, name) { // Ensure that the directory name ends with a "\" if (!directory.EndsWith("\\", StringComparison.Ordinal)) { directory = directory + "\\"; } this.oldName = oldName; this.oldFullPath = directory + oldName; } ////// Initializes a new instance of the ////// class. /// /// public string OldFullPath { [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] get { new FileIOPermission(FileIOPermissionAccess.Read, Path.GetPathRoot(oldFullPath)).Demand(); return oldFullPath; } } ////// Gets /// the previous fully qualified path of the affected file or directory. /// ////// public string OldName { get { return oldName; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ ///// Gets /// the old name of the affected file or directory. /// ///// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.IO { using System.Diagnostics; using System.Security.Permissions; using System; using System.Runtime.Versioning; ////// public class RenamedEventArgs : FileSystemEventArgs { private string oldName; private string oldFullPath; ///Provides data for the ///event. /// public RenamedEventArgs(WatcherChangeTypes changeType, string directory, string name, string oldName) : base(changeType, directory, name) { // Ensure that the directory name ends with a "\" if (!directory.EndsWith("\\", StringComparison.Ordinal)) { directory = directory + "\\"; } this.oldName = oldName; this.oldFullPath = directory + oldName; } ////// Initializes a new instance of the ////// class. /// /// public string OldFullPath { [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] get { new FileIOPermission(FileIOPermissionAccess.Read, Path.GetPathRoot(oldFullPath)).Demand(); return oldFullPath; } } ////// Gets /// the previous fully qualified path of the affected file or directory. /// ////// public string OldName { get { return oldName; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007./// Gets /// the old name of the affected file or directory. /// ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PersonalizationEntry.cs
- TextEditorSelection.cs
- ToolTipAutomationPeer.cs
- ByteRangeDownloader.cs
- MetadataAssemblyHelper.cs
- SecurityCredentialsManager.cs
- OdbcConnectionHandle.cs
- SafeFileMapViewHandle.cs
- serverconfig.cs
- EmissiveMaterial.cs
- ImageIndexEditor.cs
- CodeLabeledStatement.cs
- InputBindingCollection.cs
- IgnoreSectionHandler.cs
- SizeChangedEventArgs.cs
- Int16AnimationUsingKeyFrames.cs
- TextFindEngine.cs
- DependencyPropertyConverter.cs
- FilterException.cs
- UserControlFileEditor.cs
- ToolStripButton.cs
- CallbackValidator.cs
- LifetimeServices.cs
- EmptyEnumerator.cs
- TimeEnumHelper.cs
- TabletCollection.cs
- SymLanguageType.cs
- XmlQueryOutput.cs
- PolyQuadraticBezierSegment.cs
- FixedLineResult.cs
- Membership.cs
- DataGridItemEventArgs.cs
- HtmlEncodedRawTextWriter.cs
- HttpApplication.cs
- ResourcePart.cs
- IconConverter.cs
- ObjectMaterializedEventArgs.cs
- OutputScopeManager.cs
- MsmqIntegrationProcessProtocolHandler.cs
- RotateTransform3D.cs
- SpeakInfo.cs
- DragCompletedEventArgs.cs
- SourceFileBuildProvider.cs
- CopyOnWriteList.cs
- PreProcessInputEventArgs.cs
- WindowsGraphicsCacheManager.cs
- XmlTextEncoder.cs
- SecurityException.cs
- ReadOnlyObservableCollection.cs
- DayRenderEvent.cs
- DocumentReference.cs
- Rect3D.cs
- TriState.cs
- RemotingServices.cs
- Accessible.cs
- NameNode.cs
- MetabaseServerConfig.cs
- TokenBasedSet.cs
- DbInsertCommandTree.cs
- TextEditorDragDrop.cs
- WebPartTransformerAttribute.cs
- DBParameter.cs
- SqlParameterCollection.cs
- XmlSignificantWhitespace.cs
- UnknownWrapper.cs
- RadioButtonPopupAdapter.cs
- ResourceWriter.cs
- PartialClassGenerationTask.cs
- XmlEntityReference.cs
- XmlSchemaSubstitutionGroup.cs
- Win32Native.cs
- XXXInfos.cs
- BulletedListEventArgs.cs
- XPathNode.cs
- MonthChangedEventArgs.cs
- Resources.Designer.cs
- RemoteWebConfigurationHost.cs
- MouseBinding.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- DateTimeAutomationPeer.cs
- FieldDescriptor.cs
- XPathScanner.cs
- XmlSchemaSubstitutionGroup.cs
- EditBehavior.cs
- JsonUriDataContract.cs
- MetadataArtifactLoaderResource.cs
- Hex.cs
- ZipIOFileItemStream.cs
- ReadOnlyCollection.cs
- regiisutil.cs
- LoginView.cs
- TransactionManager.cs
- ObjectListItemCollection.cs
- Configuration.cs
- LinqDataSource.cs
- AssemblyAssociatedContentFileAttribute.cs
- MemberExpression.cs
- FixedPageStructure.cs
- GlyphElement.cs
- SymDocumentType.cs