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
- ListBoxAutomationPeer.cs
- XPathMultyIterator.cs
- OleDbCommand.cs
- StopStoryboard.cs
- RadioButtonStandardAdapter.cs
- TemplateLookupAction.cs
- SchemaName.cs
- TableSectionStyle.cs
- SqlNode.cs
- EncoderExceptionFallback.cs
- Range.cs
- CodeAttributeDeclarationCollection.cs
- WebPartDisplayModeCancelEventArgs.cs
- KeyboardNavigation.cs
- DefaultDialogButtons.cs
- CurrencyWrapper.cs
- DependencyPropertyValueSerializer.cs
- ResourceReader.cs
- _ConnectOverlappedAsyncResult.cs
- XmlSchemaSequence.cs
- HttpContext.cs
- BuildResult.cs
- SqlConnectionString.cs
- GridViewDeleteEventArgs.cs
- CompositeFontInfo.cs
- XmlSchemaSet.cs
- _DigestClient.cs
- NotifyCollectionChangedEventArgs.cs
- SmtpFailedRecipientsException.cs
- ErasingStroke.cs
- UntypedNullExpression.cs
- DrawingGroup.cs
- InvalidComObjectException.cs
- SerializationSectionGroup.cs
- UIElementPropertyUndoUnit.cs
- HtmlLink.cs
- ScriptManager.cs
- TailCallAnalyzer.cs
- ConstraintStruct.cs
- MarkupProperty.cs
- RegexTypeEditor.cs
- GcSettings.cs
- DispatcherEventArgs.cs
- DataGridTableCollection.cs
- BitFlagsGenerator.cs
- GenericTypeParameterBuilder.cs
- FigureParagraph.cs
- DataServiceRequest.cs
- EventLogStatus.cs
- HostingEnvironment.cs
- RuleSettings.cs
- RoleGroupCollection.cs
- MessageQueuePermissionEntry.cs
- PenLineCapValidation.cs
- MarkupCompilePass1.cs
- BamlLocalizationDictionary.cs
- HelpKeywordAttribute.cs
- FontNamesConverter.cs
- PatternMatcher.cs
- ExtendedProtectionPolicyTypeConverter.cs
- CapabilitiesRule.cs
- WeakReference.cs
- TreeNodeBinding.cs
- ChildTable.cs
- ProcessModelInfo.cs
- Model3D.cs
- FixedSOMPageElement.cs
- ChtmlTextWriter.cs
- MenuItem.cs
- WebPartConnection.cs
- SchemaNames.cs
- CompilationUtil.cs
- HtmlForm.cs
- BaseTreeIterator.cs
- KoreanCalendar.cs
- MLangCodePageEncoding.cs
- InkPresenter.cs
- _NestedMultipleAsyncResult.cs
- SocketAddress.cs
- PersonalizationProviderHelper.cs
- TraceHandler.cs
- FlowPosition.cs
- PageEventArgs.cs
- ChangeInterceptorAttribute.cs
- XPathMessageFilterElement.cs
- ISFTagAndGuidCache.cs
- FragmentQueryProcessor.cs
- shaper.cs
- codemethodreferenceexpression.cs
- ObjectToken.cs
- ExtensionSimplifierMarkupObject.cs
- EncoderBestFitFallback.cs
- RadioButton.cs
- TrustLevelCollection.cs
- XamlTypeMapper.cs
- IListConverters.cs
- WindowsPrincipal.cs
- ConfigurationManagerInternal.cs
- DataGridHeaderBorder.cs
- XPathNodeInfoAtom.cs