The Labs \ Source Viewer \ SSCLI \ System.ComponentModel.Design \ ComponentRenameEventArgs

  1. //------------------------------------------------------------------------------
  2. // <copyright file="ComponentRenameEvent.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. /*
  16. */
  17. namespace System.ComponentModel.Design
  18. {
  19.     using Microsoft.Win32;
  20.     using System;
  21.     using System.ComponentModel;
  22.     using System.Diagnostics;
  23.     using System.Security.Permissions;
  24.    
  25.     /// <devdoc>
  26.     /// <para>Provides data for the <see cref='System.ComponentModel.Design.IComponentChangeService.ComponentRename'/> event.</para>
  27.     /// </devdoc>
  28.     [HostProtection(SharedState = true)]
  29.     [System.Runtime.InteropServices.ComVisible(true)]
  30.     [System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.InheritanceDemand, Name = "FullTrust")]
  31.     [System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.LinkDemand, Name = "FullTrust")]
  32.     public class ComponentRenameEventArgs : EventArgs
  33.     {
  34.         private object component;
  35.         private string oldName;
  36.         private string newName;
  37.        
  38.         /// <devdoc>
  39.         /// <para>
  40.         /// Gets or sets the component that is being renamed.
  41.         /// </para>
  42.         /// </devdoc>
  43.         public object Component {
  44.             get { return component; }
  45.         }
  46.        
  47.         /// <devdoc>
  48.         /// <para>
  49.         /// Gets or
  50.         /// sets the name of the component before the rename.
  51.         /// </para>
  52.         /// </devdoc>
  53.         public virtual string OldName {
  54.             get { return oldName; }
  55.         }
  56.        
  57.         /// <devdoc>
  58.         /// <para>
  59.         /// Gets or
  60.         /// sets the current name of the component.
  61.         /// </para>
  62.         /// </devdoc>
  63.         public virtual string NewName {
  64.             get { return newName; }
  65.         }
  66.        
  67.         /// <devdoc>
  68.         /// <para>
  69.         /// Initializes a new instance of the <see cref='System.ComponentModel.Design.ComponentRenameEventArgs'/>
  70.         /// class.
  71.         /// </para>
  72.         /// </devdoc>
  73.         public ComponentRenameEventArgs(object component, string oldName, string newName)
  74.         {
  75.             this.oldName = oldName;
  76.             this.newName = newName;
  77.             this.component = component;
  78.         }
  79.     }
  80. }

Developer Fusion