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
- ListMarkerLine.cs
- EmissiveMaterial.cs
- NonSerializedAttribute.cs
- Configuration.cs
- Crypto.cs
- ConstNode.cs
- XmlEnumAttribute.cs
- QilParameter.cs
- FilterableData.cs
- TextEmbeddedObject.cs
- ValidationHelpers.cs
- TypeConverter.cs
- CodeTypeReferenceCollection.cs
- SecurityTokenProviderContainer.cs
- Normalization.cs
- ExceptionUtil.cs
- DeviceContext2.cs
- ThreadStartException.cs
- DataControlReference.cs
- unsafeIndexingFilterStream.cs
- XmlAttributes.cs
- OracleString.cs
- StateFinalizationDesigner.cs
- SolidColorBrush.cs
- tibetanshape.cs
- AddToCollection.cs
- SourceFileBuildProvider.cs
- CurrencyWrapper.cs
- ProcessMessagesAsyncResult.cs
- BufferedWebEventProvider.cs
- BitConverter.cs
- GetLastErrorDetailsRequest.cs
- GuidelineCollection.cs
- ManagementOptions.cs
- ResourceType.cs
- UdpRetransmissionSettings.cs
- BindingExpressionBase.cs
- WeakRefEnumerator.cs
- MsmqQueue.cs
- IndexedEnumerable.cs
- OpCellTreeNode.cs
- OperatingSystem.cs
- ColumnWidthChangingEvent.cs
- ListViewTableCell.cs
- StorageEntityContainerMapping.cs
- SelectedDatesCollection.cs
- ProviderConnectionPointCollection.cs
- LinkConverter.cs
- ObjectResult.cs
- DatatypeImplementation.cs
- CodeChecksumPragma.cs
- WebSysDescriptionAttribute.cs
- AxHost.cs
- DataColumn.cs
- Encoder.cs
- ParallelEnumerable.cs
- XmlSchemaAny.cs
- TypeForwardedToAttribute.cs
- CharAnimationUsingKeyFrames.cs
- categoryentry.cs
- CTreeGenerator.cs
- SetterBaseCollection.cs
- AssemblyUtil.cs
- ArgumentDirectionHelper.cs
- EditCommandColumn.cs
- SamlNameIdentifierClaimResource.cs
- Error.cs
- ScopelessEnumAttribute.cs
- StateItem.cs
- EncoderExceptionFallback.cs
- MsmqActivation.cs
- AutomationElement.cs
- EventListenerClientSide.cs
- CultureInfoConverter.cs
- Camera.cs
- SequenceDesignerAccessibleObject.cs
- LayoutEditorPart.cs
- WebCategoryAttribute.cs
- IODescriptionAttribute.cs
- DataGridViewRowPrePaintEventArgs.cs
- CacheHelper.cs
- CursorConverter.cs
- DrawListViewSubItemEventArgs.cs
- DBBindings.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- WebScriptMetadataMessage.cs
- QueryOptionExpression.cs
- NativeMethods.cs
- ModulesEntry.cs
- WindowsListViewItemCheckBox.cs
- MemoryMappedView.cs
- DifferencingCollection.cs
- NativeWindow.cs
- SoapCodeExporter.cs
- StringFreezingAttribute.cs
- ConnectionStringSettings.cs
- AssemblyAttributes.cs
- TailPinnedEventArgs.cs
- IChannel.cs
- VerticalAlignConverter.cs