The Labs \ Source Viewer \ SSCLI \ System.ComponentModel \ ICancelAddNew

  1. //------------------------------------------------------------------------------
  2. // <copyright file="ICancelAddNew.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. namespace System.ComponentModel
  16. {
  17.    
  18.     using System;
  19.    
  20.     /// <devdoc>
  21.     /// Interface implemented by a list that allows the addition of a new item
  22.     /// to be either cancelled or committed.
  23.     ///
  24.     /// Note: In some scenarios, specifically Windows Forms complex data binding,
  25.     /// the list may recieve CancelNew or EndNew calls for items other than the
  26.     /// new item. These calls should be ignored, ie. the new item should only be
  27.     /// cancelled or committed when that item's index is specified.
  28.     /// </devdoc>
  29.     public interface ICancelAddNew
  30.     {
  31.         /// <devdoc>
  32.         /// If a new item has been added to the list, and <paramref name="itemIndex"/> is the position of that item,
  33.         /// then this method should remove it from the list and cancel the add operation.
  34.         /// </devdoc>
  35.         void CancelNew(int itemIndex);
  36.        
  37.         /// <devdoc>
  38.         /// If a new item has been added to the list, and <paramref name="itemIndex"/> is the position of that item,
  39.         /// then this method should leave it in the list and complete the add operation.
  40.         /// </devdoc>
  41.         void EndNew(int itemIndex);
  42.     }
  43. }

Developer Fusion