Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,80 @@
//
// AssemblyInfo.cs
//
// Author:
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2003 Ximian, Inc. http://www.ximian.com
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Reflection;
using System.Resources;
using System.Security;
using System.Security.Permissions;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows.Markup;
// General Information about the WindowsBase assembly
// v3.0 Assembly
[assembly: AssemblyCompany (Consts.MonoCompany)]
[assembly: AssemblyProduct (Consts.MonoProduct)]
[assembly: AssemblyCopyright (Consts.MonoCopyright)]
[assembly: AssemblyVersion (Consts.FxVersion)]
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: NeutralResourcesLanguage ("en")]
[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../winfx3.pub")]
[assembly: ComVisible (false)]
[assembly: AllowPartiallyTrustedCallers]
[assembly: SecurityCritical]
[assembly: XmlnsPrefixAttribute ("http://schemas.microsoft.com/xps/2005/06", "metro")]
[assembly: XmlnsPrefixAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "wpf")]
[assembly: XmlnsPrefixAttribute ("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "av")]
[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/xps/2005/06", "System.Windows.Media")]
[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/xps/2005/06", "System.Windows.Input")]
[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/xps/2005/06", "System.Windows")]
[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/winfx/2006/xaml", "System.Windows.Markup")]
[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "System.Windows.Media")]
[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "System.Windows.Input")]
[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "System.Windows")]
[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "System.Diagnostics")]
[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/winfx/2006/xaml/composite-font", "System.Windows.Media")]
[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "System.Windows.Media")]
[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "System.Windows.Input")]
[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "System.Windows")]
[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "System.Diagnostics")]

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,17 @@
thisdir = class/WindowsBase
include ../../build/rules.make
LIBRARY = WindowsBase.dll
LIB_MCS_FLAGS = -unsafe -r:System.dll -r:System.Xml.dll
TEST_MCS_FLAGS = -unsafe -r:WindowsBase.dll -r:System.dll -r:System.Xml.dll -r:System.Core.dll
ifeq (2.0, $(FRAMEWORK_VERSION))
LIB_MCS_FLAGS += -d:NET_3_0
endif
ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
LIB_MCS_FLAGS += -r:System.Xaml.dll
TEST_MCS_FLAGS += -r:System.Xaml.dll
endif
include ../../build/library.make

View File

@@ -0,0 +1,200 @@
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2007 Novell, Inc. (http://www.novell.com)
// Copyright 2011 Xamarin Inc.
//
// Authors:
// Chris Toshok (toshok@novell.com)
// Brian O'Keefe (zer0keefie@gmail.com)
// Marek Safar (marek.safar@gmail.com)
//
#if NET_4_0
using System.Collections.ObjectModel;
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo (typeof (ObservableCollection<>))]
#else
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
namespace System.Collections.ObjectModel
{
[Serializable]
public class ObservableCollection<T> : Collection<T>, INotifyCollectionChanged, INotifyPropertyChanged {
[Serializable]
sealed class SimpleMonitor : IDisposable {
private int _busyCount;
public SimpleMonitor()
{
}
public void Enter()
{
_busyCount++;
}
public void Dispose()
{
_busyCount--;
}
public bool Busy
{
get { return _busyCount > 0; }
}
}
private SimpleMonitor _monitor = new SimpleMonitor ();
public ObservableCollection()
{
}
public ObservableCollection(IEnumerable<T> collection)
{
if (collection == null)
throw new ArgumentNullException ("collection");
foreach (var item in collection)
Add (item);
}
public ObservableCollection(List<T> list)
: base (list != null ? new List<T> (list) : null)
{
}
[field:NonSerialized]
public virtual event NotifyCollectionChangedEventHandler CollectionChanged;
[field:NonSerialized]
protected virtual event PropertyChangedEventHandler PropertyChanged;
event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged {
add { this.PropertyChanged += value; }
remove { this.PropertyChanged -= value; }
}
protected IDisposable BlockReentrancy ()
{
_monitor.Enter ();
return _monitor;
}
protected void CheckReentrancy ()
{
NotifyCollectionChangedEventHandler eh = CollectionChanged;
// Only have a problem if we have more than one event listener.
if (_monitor.Busy && eh != null && eh.GetInvocationList ().Length > 1)
throw new InvalidOperationException ("Cannot modify the collection while reentrancy is blocked.");
}
protected override void ClearItems ()
{
CheckReentrancy ();
base.ClearItems ();
OnCollectionChanged (new NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction.Reset));
OnPropertyChanged (new PropertyChangedEventArgs ("Count"));
OnPropertyChanged (new PropertyChangedEventArgs ("Item[]"));
}
protected override void InsertItem (int index, T item)
{
CheckReentrancy ();
base.InsertItem (index, item);
OnCollectionChanged (new NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction.Add, item, index));
OnPropertyChanged (new PropertyChangedEventArgs ("Count"));
OnPropertyChanged (new PropertyChangedEventArgs ("Item[]"));
}
public void Move (int oldIndex, int newIndex)
{
MoveItem (oldIndex, newIndex);
}
protected virtual void MoveItem (int oldIndex, int newIndex)
{
CheckReentrancy ();
T item = Items [oldIndex];
base.RemoveItem (oldIndex);
base.InsertItem (newIndex, item);
OnCollectionChanged (new NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction.Move, item, newIndex, oldIndex));
OnPropertyChanged (new PropertyChangedEventArgs ("Item[]"));
}
protected virtual void OnCollectionChanged (NotifyCollectionChangedEventArgs e)
{
NotifyCollectionChangedEventHandler eh = CollectionChanged;
if (eh != null) {
// Make sure that the invocation is done before the collection changes,
// Otherwise there's a chance of data corruption.
using (BlockReentrancy ()) {
eh (this, e);
}
}
}
protected virtual void OnPropertyChanged (PropertyChangedEventArgs e)
{
PropertyChangedEventHandler eh = PropertyChanged;
if (eh != null)
eh (this, e);
}
protected override void RemoveItem (int index)
{
CheckReentrancy ();
T item = Items [index];
base.RemoveItem (index);
OnCollectionChanged (new NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction.Remove, item, index));
OnPropertyChanged (new PropertyChangedEventArgs ("Count"));
OnPropertyChanged (new PropertyChangedEventArgs ("Item[]"));
}
protected override void SetItem (int index, T item)
{
CheckReentrancy ();
T oldItem = Items [index];
base.SetItem (index, item);
OnCollectionChanged (new NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction.Replace, item, oldItem, index));
OnPropertyChanged (new PropertyChangedEventArgs ("Item[]"));
}
}
}
#endif

View File

@@ -0,0 +1,90 @@
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2007 Novell, Inc. (http://www.novell.com)
//
// Authors:
// Chris Toshok (toshok@novell.com)
// Brian O'Keefe (zer0keefie@gmail.com)
//
#if NET_4_0
using System.Collections.ObjectModel;
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo (typeof (ReadOnlyObservableCollection<>))]
#else
using System.Collections.Specialized;
using System.ComponentModel;
namespace System.Collections.ObjectModel {
public class ReadOnlyObservableCollection<T> : ReadOnlyCollection<T>, INotifyCollectionChanged, INotifyPropertyChanged {
public ReadOnlyObservableCollection(ObservableCollection<T> list)
: base (list)
{
((INotifyPropertyChanged)list).PropertyChanged += SourceCollection_PropertyChanged;
((INotifyCollectionChanged)list).CollectionChanged += SourceCollection_CollectionChanged;
}
protected virtual event NotifyCollectionChangedEventHandler CollectionChanged;
protected virtual event PropertyChangedEventHandler PropertyChanged;
event NotifyCollectionChangedEventHandler INotifyCollectionChanged.CollectionChanged {
add { this.CollectionChanged += value; }
remove { this.CollectionChanged -= value; }
}
event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged {
add { this.PropertyChanged += value; }
remove { this.PropertyChanged -= value; }
}
protected virtual void OnCollectionChanged (NotifyCollectionChangedEventArgs args)
{
NotifyCollectionChangedEventHandler eh = CollectionChanged;
if (eh != null)
eh (this, args);
}
protected virtual void OnPropertyChanged (PropertyChangedEventArgs args)
{
PropertyChangedEventHandler eh = PropertyChanged;
if (eh != null)
eh (this, args);
}
private void SourceCollection_CollectionChanged (object sender, NotifyCollectionChangedEventArgs e)
{
OnCollectionChanged (e);
}
private void SourceCollection_PropertyChanged (object sender, PropertyChangedEventArgs e)
{
OnPropertyChanged (e);
}
}
}
#endif

View File

@@ -0,0 +1,14 @@
2009-11-21 Raja R Harinath <harinath@hurrynot.org>
* INotifyCollectionChanged.cs [NET_4_0]: Forward type to System.dll.
* NotifyCollectionChangedAction.cs: Likewise.
* NotifyCollectionChangedEventArgs.cs: Likewise.
* NotifyCollectionChangedEventHandler.cs: Likewise.
2008-11-04 Chris Toshok <toshok@ximian.com>
* CollectionChangedEventManager.cs: implement this using the msdn
docs. Unfortunately we lack the ability to write unit tests at
the moment, as there's no (that I can find) public use of this
type in the api. Certainly not in WindowsBase.

View File

@@ -0,0 +1,80 @@
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2007 Novell, Inc. (http://www.novell.com)
//
// Authors:
// Chris Toshok (toshok@ximian.com)
//
using System;
using System.Windows;
namespace System.Collections.Specialized {
public class CollectionChangedEventManager : WeakEventManager
{
internal CollectionChangedEventManager ()
{
}
public static void AddListener (INotifyCollectionChanged source, IWeakEventListener listener)
{
CurrentManager.ProtectedAddListener (source, listener);
}
public static void RemoveListener (INotifyCollectionChanged source, IWeakEventListener listener)
{
CurrentManager.ProtectedAddListener (source, listener);
}
protected override void StartListening (object source)
{
INotifyCollectionChanged inotify = (INotifyCollectionChanged) source;
inotify.CollectionChanged += OnCollectionChanged;
}
protected override void StopListening (object source)
{
INotifyCollectionChanged inotify = (INotifyCollectionChanged) source;
inotify.CollectionChanged -= OnCollectionChanged;
}
private void OnCollectionChanged (object sender, NotifyCollectionChangedEventArgs e)
{
DeliverEvent (sender, e);
}
private static object CurrentManagerLock = new object ();
private static CollectionChangedEventManager CurrentManager {
get {
lock (CurrentManagerLock) {
CollectionChangedEventManager manager = (CollectionChangedEventManager)GetCurrentManager (typeof (CollectionChangedEventManager));
if (manager == null) {
manager = new CollectionChangedEventManager ();
SetCurrentManager (typeof (CollectionChangedEventManager), manager);
}
return manager;
}
}
}
}
}

View File

@@ -0,0 +1,44 @@
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2007 Novell, Inc. (http://www.novell.com)
//
// Authors:
// Chris Toshok (toshok@ximian.com)
//
#if NET_4_0
using System.Collections.Specialized;
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo (typeof (INotifyCollectionChanged))]
#else
using System;
namespace System.Collections.Specialized {
public interface INotifyCollectionChanged {
event NotifyCollectionChangedEventHandler CollectionChanged;
}
}
#endif

View File

@@ -0,0 +1,47 @@
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2007 Novell, Inc. (http://www.novell.com)
//
// Authors:
// Chris Toshok (toshok@ximian.com)
//
#if NET_4_0
using System.Collections.Specialized;
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo (typeof (NotifyCollectionChangedAction))]
#else
using System;
namespace System.Collections.Specialized {
public enum NotifyCollectionChangedAction {
Add,
Remove,
Replace,
Move,
Reset
}
}
#endif

View File

@@ -0,0 +1,220 @@
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2007 Novell, Inc. (http://www.novell.com)
//
// Authors:
// Chris Toshok (toshok@ximian.com)
// Brian O'Keefe (zer0keefie@gmail.com)
//
#if NET_4_0
using System.Collections.Specialized;
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo (typeof (NotifyCollectionChangedEventArgs))]
#else
namespace System.Collections.Specialized {
public class NotifyCollectionChangedEventArgs : EventArgs {
private NotifyCollectionChangedAction action;
private IList oldItems, newItems;
private int oldIndex = -1, newIndex = -1;
#region Constructors
public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action)
{
this.action = action;
if (action != NotifyCollectionChangedAction.Reset)
throw new ArgumentException ("This constructor can only be used with the Reset action.", "action");
}
public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, IList changedItems)
: this (action, changedItems, -1)
{
}
public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, object changedItem)
: this (action, changedItem, -1)
{
}
public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, IList newItems, IList oldItems)
: this (action, newItems, oldItems, -1)
{
}
public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, IList changedItems, int startingIndex)
{
this.action = action;
if (action == NotifyCollectionChangedAction.Add || action == NotifyCollectionChangedAction.Remove) {
if (changedItems == null)
throw new ArgumentNullException ("changedItems");
if (startingIndex < -1)
throw new ArgumentException ("The value of startingIndex must be -1 or greater.", "startingIndex");
if (action == NotifyCollectionChangedAction.Add)
InitializeAdd (changedItems, startingIndex);
else
InitializeRemove (changedItems, startingIndex);
} else if (action == NotifyCollectionChangedAction.Reset) {
if (changedItems != null)
throw new ArgumentException ("This constructor can only be used with the Reset action if changedItems is null", "changedItems");
if (startingIndex != -1)
throw new ArgumentException ("This constructor can only be used with the Reset action if startingIndex is -1", "startingIndex");
} else {
throw new ArgumentException ("This constructor can only be used with the Reset, Add, or Remove actions.", "action");
}
}
public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, object changedItem, int index)
{
IList changedItems = new object [] { changedItem };
this.action = action;
if (action == NotifyCollectionChangedAction.Add)
InitializeAdd (changedItems, index);
else if (action == NotifyCollectionChangedAction.Remove)
InitializeRemove (changedItems, index);
else if (action == NotifyCollectionChangedAction.Reset) {
if (changedItem != null)
throw new ArgumentException ("This constructor can only be used with the Reset action if changedItem is null", "changedItem");
if (index != -1)
throw new ArgumentException ("This constructor can only be used with the Reset action if index is -1", "index");
} else {
throw new ArgumentException ("This constructor can only be used with the Reset, Add, or Remove actions.", "action");
}
}
public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, object newItem, object oldItem)
: this (action, newItem, oldItem, -1)
{
}
public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, IList newItems, IList oldItems, int index)
{
this.action = action;
if (action != NotifyCollectionChangedAction.Replace)
throw new ArgumentException ("This constructor can only be used with the Replace action.", "action");
if (newItems == null)
throw new ArgumentNullException ("newItems");
if (oldItems == null)
throw new ArgumentNullException ("oldItems");
this.oldItems = oldItems;
this.newItems = newItems;
oldIndex = index;
newIndex = index;
}
public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, IList changedItems, int index, int oldIndex)
{
this.action = action;
if (action != NotifyCollectionChangedAction.Move)
throw new ArgumentException ("This constructor can only be used with the Move action.", "action");
if (index < -1)
throw new ArgumentException ("The value of index must be -1 or greater.", "index");
InitializeMove (changedItems, index, oldIndex);
}
public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, object changedItem, int index, int oldIndex)
: this (action, new object [] { changedItem }, index, oldIndex)
{
}
public NotifyCollectionChangedEventArgs (NotifyCollectionChangedAction action, object newItem, object oldItem, int index)
{
this.action = action;
if (action != NotifyCollectionChangedAction.Replace)
throw new ArgumentException ("This constructor can only be used with the Replace action.", "action");
InitializeReplace (new object [] { newItem }, new object [] { oldItem }, index);
}
#endregion
#region Accessor Properties
public NotifyCollectionChangedAction Action {
get { return action; }
}
public IList NewItems {
get { return newItems; }
}
public int NewStartingIndex {
get { return newIndex; }
}
public IList OldItems {
get { return oldItems; }
}
public int OldStartingIndex {
get { return oldIndex; }
}
#endregion
#region Initialize Methods
private void InitializeAdd(IList items, int index)
{
this.newItems = ArrayList.ReadOnly (items);
this.newIndex = index;
}
private void InitializeRemove(IList items, int index)
{
this.oldItems = ArrayList.ReadOnly (items);
this.oldIndex = index;
}
private void InitializeMove(IList changedItems, int newItemIndex, int oldItemIndex)
{
InitializeAdd (changedItems, newItemIndex);
InitializeRemove (changedItems, oldItemIndex);
}
private void InitializeReplace(IList addedItems, IList removedItems, int index)
{
InitializeAdd (addedItems, index);
InitializeRemove (removedItems, index);
}
#endregion
}
}
#endif

View File

@@ -0,0 +1,41 @@
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2007 Novell, Inc. (http://www.novell.com)
//
// Authors:
// Chris Toshok (toshok@ximian.com)
//
#if NET_4_0
using System.Collections.Specialized;
using System.Runtime.CompilerServices;
[assembly:TypeForwardedTo (typeof (NotifyCollectionChangedEventHandler))]
#else
using System;
namespace System.Collections.Specialized {
public delegate void NotifyCollectionChangedEventHandler (object sender, NotifyCollectionChangedEventArgs e);
}
#endif

View File

@@ -0,0 +1,59 @@
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
//
// Authors:
// Chris Toshok (toshok@ximian.com)
//
using System;
using System.Windows;
namespace System.ComponentModel {
public class CurrentChangedEventManager : WeakEventManager
{
internal CurrentChangedEventManager ()
{
}
public static void AddListener (ICollectionView source, IWeakEventListener listener)
{
throw new NotImplementedException ();
}
public static void RemoveListener (ICollectionView source, IWeakEventListener listener)
{
throw new NotImplementedException ();
}
protected override void StartListening (object source)
{
throw new NotImplementedException ();
}
protected override void StopListening (object source)
{
throw new NotImplementedException ();
}
}
}

View File

@@ -0,0 +1,63 @@
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
//
// Authors:
// Chris Toshok (toshok@ximian.com)
// Brian O'Keefe (zer0keefie@gmail.com)
//
using System;
using System.Windows;
namespace System.ComponentModel {
public class CurrentChangingEventArgs : EventArgs
{
private bool canCancelEvent;
private bool canceled;
public CurrentChangingEventArgs ()
:this(true)
{
}
public CurrentChangingEventArgs (bool isCancelable)
{
canCancelEvent = isCancelable;
canceled = false;
}
public bool Cancel {
get { return canceled; }
set {
if(!IsCancelable && value)
throw new InvalidOperationException("Cannot cancel an event that is not Cancelable.");
canceled = value;
}
}
public bool IsCancelable {
get { return canCancelEvent; }
}
}
}

View File

@@ -0,0 +1,32 @@
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
//
// Authors:
// Chris Toshok (toshok@ximian.com)
//
using System;
namespace System.ComponentModel {
public delegate void CurrentChangingEventHandler (object sender, CurrentChangingEventArgs args);
}

View File

@@ -0,0 +1,59 @@
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
//
// Authors:
// Chris Toshok (toshok@ximian.com)
//
using System;
using System.Windows;
namespace System.ComponentModel {
public class CurrentChangingEventManager : WeakEventManager
{
internal CurrentChangingEventManager ()
{
}
public static void AddListener (ICollectionView source, IWeakEventListener listener)
{
throw new NotImplementedException ();
}
public static void RemoveListener (ICollectionView source, IWeakEventListener listener)
{
throw new NotImplementedException ();
}
protected override void StartListening (object source)
{
throw new NotImplementedException ();
}
protected override void StopListening (object source)
{
throw new NotImplementedException ();
}
}
}

View File

@@ -0,0 +1,165 @@
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
//
// Authors:
// Chris Toshok (toshok@ximian.com)
//
using System;
using System.Windows;
namespace System.ComponentModel {
public sealed class DependencyPropertyDescriptor : PropertyDescriptor {
internal DependencyPropertyDescriptor () : base (null)
{
}
public override AttributeCollection Attributes
{
get { throw new NotImplementedException (); }
}
public override string Category
{
get { throw new NotImplementedException (); }
}
public override Type ComponentType
{
get { throw new NotImplementedException (); }
}
public override TypeConverter Converter
{
get { throw new NotImplementedException (); }
}
public DependencyProperty DependencyProperty
{
get { throw new NotImplementedException (); }
}
public override string Description
{
get { throw new NotImplementedException (); }
}
public override bool DesignTimeOnly
{
get { throw new NotImplementedException (); }
}
public override string DisplayName
{
get { throw new NotImplementedException (); }
}
public bool IsAttached
{
get { throw new NotImplementedException (); }
}
public override bool IsBrowsable
{
get { throw new NotImplementedException (); }
}
public override bool IsLocalizable
{
get { throw new NotImplementedException (); }
}
public override bool IsReadOnly
{
get { throw new NotImplementedException (); }
}
public PropertyMetadata Metadata
{
get { throw new NotImplementedException (); }
}
public override Type PropertyType
{
get { throw new NotImplementedException (); }
}
public override bool SupportsChangeEvents
{
get { throw new NotImplementedException (); }
}
public override void AddValueChanged (object component, EventHandler handler)
{
throw new NotImplementedException ();
}
public override bool CanResetValue (object component)
{
throw new NotImplementedException ();
}
public override bool Equals (object obj)
{
throw new NotImplementedException ();
}
public override PropertyDescriptorCollection GetChildProperties (object instance, Attribute[] filter)
{
throw new NotImplementedException ();
}
public override object GetEditor (Type editorBaseType)
{
throw new NotImplementedException ();
}
public override int GetHashCode ()
{
throw new NotImplementedException ();
}
public override object GetValue (object component)
{
throw new NotImplementedException ();
}
public override void RemoveValueChanged (object component, EventHandler handler)
{
throw new NotImplementedException ();
}
public override void ResetValue (object component)
{
throw new NotImplementedException ();
}
public override void SetValue (object component, object value)
{
throw new NotImplementedException ();
}
public override bool ShouldSerializeValue (object component)
{
throw new NotImplementedException ();
}
public override string ToString ()
{
throw new NotImplementedException ();
}
public static DependencyPropertyDescriptor FromName (string name, Type ownerType, Type targetType)
{
throw new NotImplementedException ();
}
public static DependencyPropertyDescriptor FromProperty (PropertyDescriptor property)
{
throw new NotImplementedException ();
}
public static DependencyPropertyDescriptor FromProperty (DependencyProperty dependencyProperty, Type targetType)
{
throw new NotImplementedException ();
}
public CoerceValueCallback DesignerCoerceValueCallback {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
}
}

View File

@@ -0,0 +1,73 @@
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
//
// Authors:
// Chris Toshok (toshok@ximian.com)
//
using System;
using System.Collections.ObjectModel;
using System.Globalization;
namespace System.ComponentModel {
public abstract class GroupDescription : INotifyPropertyChanged
{
readonly ObservableCollection<object> groupNames;
protected GroupDescription ()
{
groupNames = new ObservableCollection<object> ();
}
public ObservableCollection<object> GroupNames {
get { return groupNames; }
}
event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged {
add { PropertyChanged += value; }
remove { PropertyChanged -= value; }
}
protected virtual event PropertyChangedEventHandler PropertyChanged;
public virtual bool NamesMatch (object groupName, object itemName)
{
return Equals (groupName, itemName);
}
protected virtual void OnPropertyChanged (PropertyChangedEventArgs e)
{
if (PropertyChanged != null)
PropertyChanged (this, e);
}
[EditorBrowsable (EditorBrowsableState.Never)]
public bool ShouldSerializeGroupNames ()
{
return GroupNames.Count != 0;
}
public abstract object GroupNameFromItem (object item, int level, CultureInfo culture);
}
}

View File

@@ -0,0 +1,65 @@
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
//
// Authors:
// Chris Toshok (toshok@ximian.com)
//
using System;
using System.Collections;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Globalization;
namespace System.ComponentModel {
public interface ICollectionView : IEnumerable, INotifyCollectionChanged
{
bool CanFilter { get; }
bool CanGroup { get; }
bool CanSort { get; }
CultureInfo Culture { get; set; }
object CurrentItem { get; }
int CurrentPosition { get; }
Predicate<object> Filter {get; set; }
ObservableCollection<GroupDescription> GroupDescriptions { get; }
ReadOnlyObservableCollection<object> Groups { get; }
bool IsCurrentAfterLast { get; }
bool IsCurrentBeforeFirst { get; }
bool IsEmpty { get; }
SortDescriptionCollection SortDescriptions { get; }
IEnumerable SourceCollection { get; }
event EventHandler CurrentChanged;
event CurrentChangingEventHandler CurrentChanging;
bool Contains (object item);
IDisposable DeferRefresh ();
bool MoveCurrentTo (object item);
bool MoveCurrentToFirst ();
bool MoveCurrentToLast ();
bool MoveCurrentToNext ();
bool MoveCurrentToPosition (int position);
bool MoveCurrentToPrevious ();
void Refresh ();
}
}

View File

@@ -0,0 +1,33 @@
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
//
// Authors:
// Chris Toshok (toshok@ximian.com)
//
namespace System.ComponentModel {
public interface ICollectionViewFactory {
ICollectionView CreateView ();
}
}

View File

@@ -0,0 +1,54 @@
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
//
// Author:
// Chris Toshok (toshok@ximian.com)
//
namespace System.ComponentModel {
public interface IEditableCollectionView {
void EditItem (object item);
object AddNew ();
void CancelEdit ();
void CancelNew ();
void CommitEdit ();
void CommitNew ();
void Remove (object item);
void RemoveAt (int index);
object CurrentAddItem { get; }
object CurrentEditItem { get; }
bool CanAddNew { get; }
bool CanCancelEdit { get; }
bool CanRemove { get; }
bool IsAddingNew { get; }
bool IsEditingItem { get; }
NewItemPlaceholderPosition NewItemPlaceholderPosition { get; set; }
}
}

Some files were not shown because too many files have changed in this diff Show More