Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -26,175 +26,8 @@
// 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

@@ -24,67 +24,8 @@
// 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

@@ -23,22 +23,8 @@
// 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

@@ -23,25 +23,8 @@
// 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

@@ -24,197 +24,8 @@
// 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

@@ -23,19 +23,8 @@
// 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

@@ -24,7 +24,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#if NET_4_0
namespace System.ComponentModel
{
@@ -35,4 +34,3 @@ namespace System.ComponentModel
}
}
#endif

View File

@@ -1,33 +0,0 @@
#if !NET_4_0
// 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.Windows.Markup {
[AttributeUsage (AttributeTargets.Property)]
public class AmbientAttribute : Attribute {
}
}
#endif

View File

@@ -1,47 +0,0 @@
#if !NET_4_0
// 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.Windows.Markup {
[AttributeUsage (AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public sealed class ConstructorArgumentAttribute : Attribute
{
public ConstructorArgumentAttribute (string argumentName)
{
this.argumentName = argumentName;
}
public string ArgumentName {
get { return argumentName; }
}
string argumentName;
}
}
#endif

View File

@@ -1,50 +0,0 @@
#if !NET_4_0
// 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;
namespace System.Windows.Markup {
[AttributeUsage (AttributeTargets.Class)]
public sealed class ContentPropertyAttribute : Attribute
{
string name;
public ContentPropertyAttribute ()
{
}
public ContentPropertyAttribute (string name)
{
this.name = name;
}
public string Name {
get { return name; }
}
}
}
#endif

View File

@@ -1,66 +0,0 @@
#if !NET_4_0
// 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.Windows.Markup {
[AttributeUsage (AttributeTargets.Property, AllowMultiple = true, Inherited = true)]
public sealed class ContentWrapperAttribute : Attribute
{
public ContentWrapperAttribute (Type contentWrapper)
{
this.contentWrapper = contentWrapper;
}
public Type ContentWrapper {
get { return contentWrapper; }
}
public override object TypeId {
get { return this; }
}
public override bool Equals (object obj)
{
if (obj is ContentWrapperAttribute) {
if (((ContentWrapperAttribute)obj).ContentWrapper == contentWrapper)
return true;
}
return false;
}
public override int GetHashCode ()
{
throw new NotImplementedException ();
}
Type contentWrapper;
}
}
#endif

View File

@@ -1,68 +0,0 @@
#if !NET_4_0
// 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.Globalization;
namespace System.Windows.Markup {
public class DateTimeValueSerializer : ValueSerializer
{
public override bool CanConvertFromString (string value, IValueSerializerContext context)
{
// seems to return for any value
return true;
}
public override bool CanConvertToString (object value, IValueSerializerContext context)
{
if (!(value is DateTime))
throw new ArgumentException ("Can only convert objects of type 'DateTime'");
return true;
}
public override object ConvertFromString (string value, IValueSerializerContext context)
{
if (value == null)
throw new NotSupportedException ("DateTimeValueSerializer cannot convert from null value.");
return DateTime.Parse (value);
}
public override string ConvertToString (object value, IValueSerializerContext context)
{
if (value == null)
throw new NotSupportedException ("Cannot convert null value to string.");
if (!(value is DateTime))
throw new NotSupportedException ("only objects of type 'DateTime' can be converted.");
return ((DateTime)value).ToString("s", CultureInfo.InvariantCulture);
}
}
}
#endif

View File

@@ -1,51 +0,0 @@
#if !NET_4_0
// 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.Windows.Markup {
[AttributeUsage (AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = true)]
public sealed class DependsOnAttribute : Attribute
{
public DependsOnAttribute (string name)
{
this.name = name;
}
public string Name {
get { return name; }
}
public override object TypeId {
get { return this; }
}
string name;
}
}
#endif

View File

@@ -1,43 +0,0 @@
#if !NET_4_0
// 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)
//
using System;
namespace System.Windows.Markup {
[AttributeUsage (AttributeTargets.Class)]
public class DictionaryKeyPropertyAttribute : Attribute {
public DictionaryKeyPropertyAttribute (string name)
{
Name = name;
}
public string Name {
get; private set;
}
}
}
#endif

View File

@@ -1,37 +0,0 @@
#if !NET_4_0
// 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.Windows.Markup {
public interface IComponentConnector {
void Connect (int connectionId, object target);
void InitializeComponent ();
}
}
#endif

View File

@@ -1,38 +0,0 @@
#if !NET_4_0
// 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.Windows.Markup {
public interface INameScope {
object FindName (string name);
void RegisterName (string name, object scopedElement);
void UnregisterName (string name);
}
}
#endif

View File

@@ -1,37 +0,0 @@
#if !NET_4_0
// 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.ComponentModel;
namespace System.Windows.Markup {
public interface IValueSerializerContext : ITypeDescriptorContext, IServiceProvider {
ValueSerializer GetValueSerializerFor (PropertyDescriptor descriptor);
ValueSerializer GetValueSerializerFor (Type type);
}
}
#endif

View File

@@ -1,35 +0,0 @@
#if !NET_4_0
// 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.Windows.Markup {
public interface IXamlTypeResolver {
Type Resolve (string qualifiedTypeName);
}
}
#endif

View File

@@ -1,40 +0,0 @@
#if !NET_4_0
// 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;
namespace System.Windows.Markup {
public abstract class MarkupExtension
{
protected MarkupExtension ()
{
}
public abstract object ProvideValue (IServiceProvider serviceProvider);
}
}
#endif

View File

@@ -1,61 +0,0 @@
#if !NET_4_0
// 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.Windows.Markup {
[AttributeUsage (AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public sealed class MarkupExtensionReturnTypeAttribute : Attribute
{
public MarkupExtensionReturnTypeAttribute ()
{
}
public MarkupExtensionReturnTypeAttribute (Type returnType)
{
ReturnType = returnType;
}
public MarkupExtensionReturnTypeAttribute (Type returnType, Type expressionType)
{
ReturnType = returnType;
ExpressionType = expressionType;
}
public Type ReturnType {
get;
private set;
}
public Type ExpressionType {
get;
private set;
}
}
}
#endif

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