diff --git a/Microsoft.Research/Contracts/System.Data/System.Data.Common.DbParameterCollection.cs b/Microsoft.Research/Contracts/System.Data/System.Data.Common.DbParameterCollection.cs index 92e151cd..0baea736 100644 --- a/Microsoft.Research/Contracts/System.Data/System.Data.Common.DbParameterCollection.cs +++ b/Microsoft.Research/Contracts/System.Data/System.Data.Common.DbParameterCollection.cs @@ -12,17 +12,13 @@ // // 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.Collections; -using System.ComponentModel; -using System.Data; -using System.Reflection; using System.Diagnostics.Contracts; namespace System.Data.Common { // Summary: // The base class for a collection of parameters relevant to a System.Data.Common.DbCommand. + [ContractClass(typeof(DbParameterCollectionContract))] public abstract class DbParameterCollection //: MarshalByRefObject, IDataParameterCollection, IList, ICollection, IEnumerable { // Summary: @@ -37,7 +33,7 @@ public abstract class DbParameterCollection //: MarshalByRefObject, IDataParamet // The number of items in the collection. //rowsable(false)] //[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - //public abstract int Count { get; } + public abstract int Count { get; } // // Summary: // Specifies whether the collection is a fixed size. @@ -121,7 +117,17 @@ public DbParameter this[int index] // Exceptions: // System.IndexOutOfRangeException: // The specified index does not exist. - //public DbParameter this[string parameterName] { get; set; } + public DbParameter this[string parameterName] + { + get + { + return default(DbParameter); + } + set + { + + } + } // Summary: // Adds a System.Data.Common.DbParameter item with the specified value to the @@ -134,7 +140,7 @@ public DbParameter this[int index] // // Returns: // The index of the System.Data.Common.DbParameter object in the collection. - //public abstract int Add(object value); + public abstract int Add(object value); // // Summary: // Adds an array of items with the specified values to the System.Data.Common.DbParameterCollection. @@ -142,7 +148,7 @@ public DbParameter this[int index] // Parameters: // values: // An array of values of type System.Data.Common.DbParameter to add to the collection. - //public abstract void AddRange(Array values); + public abstract void AddRange(Array values); // // Summary: // Removes all System.Data.Common.DbParameter values from the System.Data.Common.DbParameterCollection. @@ -305,4 +311,34 @@ public DbParameter this[int index] // The new System.Data.Common.DbParameter value. //protected abstract void SetParameter(string parameterName, DbParameter value); } + + [ContractClassFor(typeof(DbParameterCollection))] + abstract class DbParameterCollectionContract : DbParameterCollection + { + private DbParameterCollectionContract() + { + + } + + public override int Add(object value) + { + Contract.Requires(value != null); + Contract.Ensures(Contract.Result() >= 0); + return default(int); + } + + public override void AddRange(Array values) + { + Contract.Requires(values != null); + } + + public override int Count + { + get + { + Contract.Ensures(Contract.Result() >= 0); + return default(int); + } + } + } } diff --git a/Microsoft.Research/Contracts/System.Data/System.Data.SqlClient.SqlCommand.cs b/Microsoft.Research/Contracts/System.Data/System.Data.SqlClient.SqlCommand.cs index 5954dc58..728bbf39 100644 --- a/Microsoft.Research/Contracts/System.Data/System.Data.SqlClient.SqlCommand.cs +++ b/Microsoft.Research/Contracts/System.Data/System.Data.SqlClient.SqlCommand.cs @@ -180,7 +180,14 @@ namespace System.Data.SqlClient //[ResCategory("DataCategory_Data")] //[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] //[ResDescription("DbCommand_Parameters")] - //public SqlParameterCollection Parameters { get; } + public SqlParameterCollection Parameters + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(SqlParameterCollection); + } + } // // Summary: // Gets or sets the System.Data.SqlClient.SqlTransaction within which the System.Data.SqlClient.SqlCommand diff --git a/Microsoft.Research/Contracts/System.Data/System.Data.SqlClient.SqlParameter.cs b/Microsoft.Research/Contracts/System.Data/System.Data.SqlClient.SqlParameter.cs index 47037b02..e417ad49 100644 --- a/Microsoft.Research/Contracts/System.Data/System.Data.SqlClient.SqlParameter.cs +++ b/Microsoft.Research/Contracts/System.Data/System.Data.SqlClient.SqlParameter.cs @@ -31,7 +31,10 @@ namespace System.Data.SqlClient { // Summary: // Initializes a new instance of the System.Data.SqlClient.SqlParameter class. - //public SqlParameter(); + public SqlParameter() + { + + } // // Summary: // Initializes a new instance of the System.Data.SqlClient.SqlParameter class @@ -43,7 +46,10 @@ namespace System.Data.SqlClient // // value: // An System.Object that is the value of the System.Data.SqlClient.SqlParameter. - //public SqlParameter(string parameterName, object value); + public SqlParameter(string parameterName, object value) + { + + } // // Summary: // Initializes a new instance of the System.Data.SqlClient.SqlParameter class @@ -59,7 +65,10 @@ namespace System.Data.SqlClient // Exceptions: // System.ArgumentException: // The value supplied in the dbType parameter is an invalid back-end data type. - //public SqlParameter(string parameterName, SqlDbType dbType); + public SqlParameter(string parameterName, SqlDbType dbType) + { + + } // // Summary: // Initializes a new instance of the System.Data.SqlClient.SqlParameter class @@ -78,7 +87,10 @@ namespace System.Data.SqlClient // Exceptions: // System.ArgumentException: // The value supplied in the dbType parameter is an invalid back-end data type. - //public SqlParameter(string parameterName, SqlDbType dbType, int size); + public SqlParameter(string parameterName, SqlDbType dbType, int size) + { + + } // // Summary: // Initializes a new instance of the System.Data.SqlClient.SqlParameter class @@ -101,7 +113,10 @@ namespace System.Data.SqlClient // Exceptions: // System.ArgumentException: // The value supplied in the dbType parameter is an invalid back-end data type. - //public SqlParameter(string parameterName, SqlDbType dbType, int size, string sourceColumn); + public SqlParameter(string parameterName, SqlDbType dbType, int size, string sourceColumn) + { + + } // // Summary: // Initializes a new instance of the System.Data.SqlClient.SqlParameter class diff --git a/Microsoft.Research/Contracts/System.Data/System.Data.SqlClient.SqlParameterCollection.cs b/Microsoft.Research/Contracts/System.Data/System.Data.SqlClient.SqlParameterCollection.cs new file mode 100644 index 00000000..4df2a2ef --- /dev/null +++ b/Microsoft.Research/Contracts/System.Data/System.Data.SqlClient.SqlParameterCollection.cs @@ -0,0 +1,112 @@ +// CodeContracts +// +// Copyright (c) Microsoft Corporation +// +// All rights reserved. +// +// MIT License +// +// 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.Data.Common; +using System.Diagnostics.Contracts; + +namespace System.Data.SqlClient +{ + public sealed class SqlParameterCollection : DbParameterCollection + { + internal SqlParameterCollection() + { + } + + public SqlParameter Add(SqlParameter value) + { + Contract.Ensures(value == null || Contract.Result() != null); + return default(SqlParameter); + } + + public override int Add(object value) + { + return default(int); + } + + public SqlParameter Add(string parameterName, SqlDbType sqlDbType) + { + Contract.Ensures(Contract.Result() != null); + return default(SqlParameter); + } + + public SqlParameter Add(string parameterName, object value) + { + Contract.Ensures(Contract.Result() != null); + return default(SqlParameter); + } + + public SqlParameter Add(string parameterName, SqlDbType sqlDbType, int size) + { + Contract.Ensures(Contract.Result() != null); + return default(SqlParameter); + } + + public SqlParameter Add(string parameterName, SqlDbType sqlDbType, int size, string sourceColumn) + { + Contract.Ensures(Contract.Result() != null); + return default(SqlParameter); + } + + public void AddRange(SqlParameter[] values) + { + Contract.Requires(values != null); + } + + public override void AddRange(Array values) + { + } + + public SqlParameter AddWithValue(string parameterName, object value) + { + Contract.Ensures(Contract.Result() != null); + return default(SqlParameter); + } + + public override int Count + { + get + { + return default(int); + } + } + + public new SqlParameter this[int index] + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(SqlParameter); + } + set + { + Contract.Requires(value != null); + Contract.Requires(index >= 0); + Contract.Requires(index < this.Count); + } + } + + public new SqlParameter this[string parameterName] + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(SqlParameter); + } + set + { + + } + } + } +} \ No newline at end of file diff --git a/Microsoft.Research/Contracts/System.Data/System.Data.SqlDbType.cs b/Microsoft.Research/Contracts/System.Data/System.Data.SqlDbType.cs new file mode 100644 index 00000000..b38d7a6a --- /dev/null +++ b/Microsoft.Research/Contracts/System.Data/System.Data.SqlDbType.cs @@ -0,0 +1,51 @@ +// CodeContracts +// +// Copyright (c) Microsoft Corporation +// +// All rights reserved. +// +// MIT License +// +// 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. + +namespace System.Data +{ + public enum SqlDbType + { + BigInt = 0, + Binary = 1, + Bit = 2, + Char = 3, + Date = 0x1f, + DateTime = 4, + DateTime2 = 0x21, + DateTimeOffset = 0x22, + Decimal = 5, + Float = 6, + Image = 7, + Int = 8, + Money = 9, + NChar = 10, + NText = 11, + NVarChar = 12, + Real = 13, + SmallDateTime = 15, + SmallInt = 0x10, + SmallMoney = 0x11, + Structured = 30, + Text = 0x12, + Time = 0x20, + Timestamp = 0x13, + TinyInt = 20, + Udt = 0x1d, + UniqueIdentifier = 14, + VarBinary = 0x15, + VarChar = 0x16, + Variant = 0x17, + Xml = 0x19 + } +} diff --git a/Microsoft.Research/Contracts/System.Data/System.Data10.csproj b/Microsoft.Research/Contracts/System.Data/System.Data10.csproj index 30131e2f..6e409937 100644 --- a/Microsoft.Research/Contracts/System.Data/System.Data10.csproj +++ b/Microsoft.Research/Contracts/System.Data/System.Data10.csproj @@ -1,4 +1,4 @@ - + Debug @@ -222,6 +222,8 @@ + + @@ -299,4 +301,4 @@ --> - + \ No newline at end of file diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.BaseCollection.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.BaseCollection.cs new file mode 100644 index 00000000..eb32403d --- /dev/null +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.BaseCollection.cs @@ -0,0 +1,75 @@ +// CodeContracts +// +// Copyright (c) Microsoft Corporation +// +// All rights reserved. +// +// MIT License +// +// 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.Collections; +using System.ComponentModel; +using System.Diagnostics.Contracts; + +namespace System.Windows.Forms +{ + public class BaseCollection : MarshalByRefObject, ICollection, IEnumerable + { + public void CopyTo(Array ar, int index) + { + + } + + public IEnumerator GetEnumerator() + { + return default(IEnumerator); + } + + public virtual int Count + { + get + { + return default(int); + } + } + + public bool IsReadOnly + { + get + { + return default(bool); + } + } + + public bool IsSynchronized + { + get + { + return default(bool); + } + } + + protected virtual ArrayList List + { + get + { + return default(ArrayList); + } + } + + public object SyncRoot + { + get + { + return default(object); + } + } + } + + +} \ No newline at end of file diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.BindingContext.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.BindingContext.cs new file mode 100644 index 00000000..353abebb --- /dev/null +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.BindingContext.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace System.Windows.Forms +{ + public class BindingContext : ICollection, IEnumerable + { + public BindingContext() + { + + } + + public bool Contains(object dataSource) + { + return default(bool); + } + + public bool Contains(object dataSource, string dataMember) + { + return default(bool); + } + + protected internal void Remove(object dataSource) + { + + } + + protected virtual void RemoveCore(object dataSource) + { + + } + + void ICollection.CopyTo(Array ar, int index) + { + + } + + IEnumerator IEnumerable.GetEnumerator() + { + return default(IEnumerator); + } + + int ICollection.Count + { + get + { + return default(int); + } + } + + bool ICollection.IsSynchronized + { + get + { + return default(bool); + } + } + + object ICollection.SyncRoot + { + get + { + return default(object); + } + } + } +} diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.BindingsCollection.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.BindingsCollection.cs new file mode 100644 index 00000000..442f07f6 --- /dev/null +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.BindingsCollection.cs @@ -0,0 +1,25 @@ +// CodeContracts +// +// Copyright (c) Microsoft Corporation +// +// All rights reserved. +// +// MIT License +// +// 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.ComponentModel; + +namespace System.Windows.Forms +{ + public class BindingsCollection : BaseCollection + { + internal BindingsCollection() + { + } + } +} \ No newline at end of file diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.ButtonBase.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.ButtonBase.cs new file mode 100644 index 00000000..05024297 --- /dev/null +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.ButtonBase.cs @@ -0,0 +1,38 @@ +// CodeContracts +// +// Copyright (c) Microsoft Corporation +// +// All rights reserved. +// +// MIT License +// +// 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.Diagnostics.Contracts; + +namespace System.Windows.Forms +{ + public abstract class ButtonBase : Control + { + //public event EventHandler AutoSizeChanged; + //public event EventHandler ImeModeChanged; + + protected ButtonBase() + { + + } + + public FlatButtonAppearance FlatAppearance + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(FlatButtonAppearance); + } + } + } +} \ No newline at end of file diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.Control.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.Control.cs index febaec6b..e7757a18 100644 --- a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.Control.cs +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.Control.cs @@ -449,17 +449,24 @@ public Control.ControlCollection Controls //// the mouse pointer is over the control. //[AmbientValue("")] //public virtual Cursor Cursor { get; set; } - //// - //// Summary: - //// Gets the data bindings for the control. - //// - //// Returns: - //// A System.Windows.Forms.ControlBindingsCollection that contains the System.Windows.Forms.Binding - //// objects for the control. - //[ParenthesizePropertyName(true)] - //[RefreshProperties(RefreshProperties.All)] - //[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - //public ControlBindingsCollection DataBindings { get; } + // + // Summary: + // Gets the data bindings for the control. + // + // Returns: + // A System.Windows.Forms.ControlBindingsCollection that contains the System.Windows.Forms.Binding + // objects for the control. + [ParenthesizePropertyName(true)] + [RefreshProperties(RefreshProperties.All)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + public virtual ControlBindingsCollection DataBindings + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(ControlBindingsCollection); + } + } //// //// Summary: //// Gets the default background color of the control. @@ -1058,7 +1065,18 @@ public virtual LayoutEngine LayoutEngine //[Bindable(true)] //[Localizable(true)] //[DispId(-517)] - //public virtual string Text { get; set; } + public virtual string Text + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(string); + } + set + { + + } + } //// //// Summary: //// Gets or sets the distance, in pixels, between the top edge of the control diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.ControlBindingsCollection.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.ControlBindingsCollection.cs new file mode 100644 index 00000000..3b509637 --- /dev/null +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.ControlBindingsCollection.cs @@ -0,0 +1,26 @@ +// CodeContracts +// +// Copyright (c) Microsoft Corporation +// +// All rights reserved. +// +// MIT License +// +// 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.Diagnostics.Contracts; + +namespace System.Windows.Forms +{ + public class ControlBindingsCollection : BindingsCollection + { + public ControlBindingsCollection(IBindableComponent control) + { + + } + } +} \ No newline at end of file diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridView.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridView.cs new file mode 100644 index 00000000..819296cd --- /dev/null +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridView.cs @@ -0,0 +1,56 @@ +// CodeContracts +// +// Copyright (c) Microsoft Corporation +// +// All rights reserved. +// +// MIT License +// +// 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.Diagnostics.Contracts; + +namespace System.Windows.Forms +{ + public class DataGridView + { + public DataGridView() + { + + } + + protected virtual DataGridViewColumnCollection CreateColumnsInstance() + { + Contract.Ensures(Contract.Result() != null); + return default(DataGridViewColumnCollection); + } + + protected virtual DataGridViewRowCollection CreateRowsInstance() + { + Contract.Ensures(Contract.Result() != null); + return default(DataGridViewRowCollection); + } + + public DataGridViewColumnCollection Columns + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(DataGridViewColumnCollection); + } + } + + public DataGridViewRowCollection Rows + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(DataGridViewRowCollection); + } + } + } +} \ No newline at end of file diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewBand.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewBand.cs new file mode 100644 index 00000000..0a25c50c --- /dev/null +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewBand.cs @@ -0,0 +1,42 @@ +// CodeContracts +// +// Copyright (c) Microsoft Corporation +// +// All rights reserved. +// +// MIT License +// +// 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.Diagnostics.Contracts; + +namespace System.Windows.Forms +{ + public class DataGridViewBand : DataGridViewElement, ICloneable, IDisposable + { + internal DataGridViewBand() + { + } + + public virtual object Clone() + { + Contract.Ensures(Contract.Result() != null); + Contract.Ensures(Contract.Result() is DataGridViewBand); + return default(object); + } + + public void Dispose() + { + + } + + protected virtual void Dispose(bool disposing) + { + + } + } +} \ No newline at end of file diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewCell.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewCell.cs new file mode 100644 index 00000000..4d9a5458 --- /dev/null +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewCell.cs @@ -0,0 +1,43 @@ +// CodeContracts +// +// Copyright (c) Microsoft Corporation +// +// All rights reserved. +// +// MIT License +// +// 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.Diagnostics.Contracts; + +namespace System.Windows.Forms +{ + public abstract class DataGridViewCell : DataGridViewElement, ICloneable, IDisposable + { + protected DataGridViewCell() + { + + } + + public virtual object Clone() + { + Contract.Ensures(Contract.Result() != null); + Contract.Ensures(Contract.Result() is DataGridViewCell); + return default(object); + } + + public void Dispose() + { + + } + + protected virtual void Dispose(bool disposing) + { + + } + } +} \ No newline at end of file diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewCellCollection.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewCellCollection.cs new file mode 100644 index 00000000..0cedee2e --- /dev/null +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewCellCollection.cs @@ -0,0 +1,228 @@ +// CodeContracts +// +// Copyright (c) Microsoft Corporation +// +// All rights reserved. +// +// MIT License +// +// 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.Collections; +using System.ComponentModel; +using System.Diagnostics.Contracts; + +namespace System.Windows.Forms +{ + public class DataGridViewCellCollection : BaseCollection, IList, ICollection, IEnumerable + { + //private ArrayList items; + //private CollectionChangeEventHandler onCollectionChanged; + //private DataGridViewRow owner; + + //public event CollectionChangeEventHandler CollectionChanged; + + public DataGridViewCellCollection(DataGridViewRow dataGridViewRow) + { + Contract.Requires(dataGridViewRow != null); + } + + public virtual int Add(DataGridViewCell dataGridViewCell) + { + Contract.Requires(dataGridViewCell != null); + Contract.Ensures(Contract.Result() >= 0); + return default(int); + } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public virtual void AddRange(params DataGridViewCell[] dataGridViewCells) + { + Contract.Requires(dataGridViewCells != null); + Contract.Requires(Contract.ForAll(dataGridViewCells, (cell) => { return cell != null; })); + } + + public virtual void Clear() + { + Contract.Ensures(this.Count == 0); + } + + public virtual bool Contains(DataGridViewCell dataGridViewCell) + { + return default(bool); + } + + public void CopyTo(DataGridViewCell[] array, int index) + { + Contract.Requires(array != null); + } + + public int IndexOf(DataGridViewCell dataGridViewCell) + { + Contract.Ensures(Contract.Result() >= -1); + return default(int); + } + + public virtual void Insert(int index, DataGridViewCell dataGridViewCell) + { + Contract.Requires(dataGridViewCell != null); + Contract.Requires(index >= 0); + Contract.Requires(index <= this.Count); + } + + protected void OnCollectionChanged(CollectionChangeEventArgs e) + { + + } + + public virtual void Remove(DataGridViewCell cell) + { + Contract.Requires(cell != null); + } + + public virtual void RemoveAt(int index) + { + Contract.Requires(index >= 0); + Contract.Requires(index < this.Count); + } + + void ICollection.CopyTo(Array array, int index) + { + + } + + IEnumerator IEnumerable.GetEnumerator() + { + return default(IEnumerator); + } + + int IList.Add(object value) + { + return default(int); + } + + void IList.Clear() + { + + } + + bool IList.Contains(object value) + { + return default(bool); + } + + int IList.IndexOf(object value) + { + return default(int); + } + + void IList.Insert(int index, object value) + { + + } + + void IList.Remove(object value) + { + + } + + void IList.RemoveAt(int index) + { + + } + + public DataGridViewCell this[int index] + { + get + { + Contract.Requires(index >= 0); + Contract.Requires(index < this.Count); + Contract.Ensures(Contract.Result() != null); + return default(DataGridViewCell); + } + set + { + Contract.Requires(index >= 0); + Contract.Requires(index < this.Count); + } + } + + public DataGridViewCell this[string columnName] + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(DataGridViewCell); + } + set + { + + } + } + + protected override ArrayList List + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(ArrayList); + } + } + + int ICollection.Count + { + get + { + return default(int); + } + } + + bool ICollection.IsSynchronized + { + get + { + return default(bool); + } + } + + object ICollection.SyncRoot + { + get + { + return default(ICollection); + } + } + + bool IList.IsFixedSize + { + get + { + return default(bool); + } + } + + bool IList.IsReadOnly + { + get + { + return default(bool); + } + } + + object IList.this[int index] + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(object); + } + set + { + } + } + + } +} \ No newline at end of file diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewColumn.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewColumn.cs new file mode 100644 index 00000000..ff42339f --- /dev/null +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewColumn.cs @@ -0,0 +1,31 @@ +// CodeContracts +// +// Copyright (c) Microsoft Corporation +// +// All rights reserved. +// +// MIT License +// +// 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.ComponentModel; + +namespace System.Windows.Forms +{ + public class DataGridViewColumn : DataGridViewBand//, IComponent, IDisposable + { + public DataGridViewColumn() : this(null) + { + } + + public DataGridViewColumn(DataGridViewCell cellTemplate) + { + } + + //public event EventHandler Disposed; + } +} \ No newline at end of file diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewColumnCollection.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewColumnCollection.cs new file mode 100644 index 00000000..228c11a8 --- /dev/null +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewColumnCollection.cs @@ -0,0 +1,296 @@ +// CodeContracts +// +// Copyright (c) Microsoft Corporation +// +// All rights reserved. +// +// MIT License +// +// 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.Collections; +using System.ComponentModel; +using System.Diagnostics.Contracts; +using System.Drawing; + +namespace System.Windows.Forms +{ + public class DataGridViewColumnCollection : BaseCollection, IList, ICollection, IEnumerable + { + /*private class ColumnOrderComparer : IComparer + { + // Methods + public int Compare(object x, object y) + { + return default(int); + } + }*/ + + //private int columnCountsVisible; + //private int columnCountsVisibleSelected; + //private static ColumnOrderComparer columnOrderComparer; + //private int columnsWidthVisible; + //private int columnsWidthVisibleFrozen; + //private DataGridView dataGridView; + //private ArrayList items; + //private ArrayList itemsSorted; + //private int lastAccessedSortedIndex; + //private CollectionChangeEventHandler onCollectionChanged; + + public DataGridViewColumnCollection(DataGridView dataGridView) + { + Contract.Requires(dataGridView != null); + } + + public virtual int Add(DataGridViewColumn dataGridViewColumn) + { + Contract.Requires(dataGridViewColumn != null); + Contract.Ensures(Contract.Result() >= 0); + return default(int); + } + + public virtual int Add(string columnName, string headerText) + { + Contract.Ensures(Contract.Result() >= 0); + return default(int); + } + + public virtual void AddRange(params DataGridViewColumn[] dataGridViewColumns) + { + Contract.Requires(dataGridViewColumns != null); + Contract.Requires(Contract.ForAll(dataGridViewColumns, (column) => { return column != null; })); + } + + public virtual void Clear() + { + Contract.Ensures(this.Count == 0); + } + + public virtual bool Contains(string columnName) + { + Contract.Requires(columnName != null); + return default(bool); + } + + public virtual bool Contains(DataGridViewColumn dataGridViewColumn) + { + return default(bool); + } + + public void CopyTo(DataGridViewColumn[] array, int index) + { + Contract.Requires(array != null); + } + + public int GetColumnCount(DataGridViewElementStates includeFilter) + { + return default(int); + } + + public int GetColumnsWidth(DataGridViewElementStates includeFilter) + { + return default(int); + } + + public DataGridViewColumn GetFirstColumn(DataGridViewElementStates includeFilter) + { + return default(DataGridViewColumn); + } + + public DataGridViewColumn GetFirstColumn(DataGridViewElementStates includeFilter, DataGridViewElementStates excludeFilter) + { + return default(DataGridViewColumn); + } + + public DataGridViewColumn GetLastColumn(DataGridViewElementStates includeFilter, DataGridViewElementStates excludeFilter) + { + return default(DataGridViewColumn); + } + + public DataGridViewColumn GetNextColumn(DataGridViewColumn dataGridViewColumnStart, DataGridViewElementStates includeFilter, DataGridViewElementStates excludeFilter) + { + Contract.Requires(dataGridViewColumnStart != null); + return default(DataGridViewColumn); + } + + + public DataGridViewColumn GetPreviousColumn(DataGridViewColumn dataGridViewColumnStart, DataGridViewElementStates includeFilter, DataGridViewElementStates excludeFilter) + { + Contract.Requires(dataGridViewColumnStart != null); + return default(DataGridViewColumn); + } + + public int IndexOf(DataGridViewColumn dataGridViewColumn) + { + Contract.Ensures(Contract.Result() >= -1); + return default(int); + } + + public virtual void Insert(int columnIndex, DataGridViewColumn dataGridViewColumn) + { + Contract.Requires(columnIndex >= 0); + Contract.Requires(columnIndex <= this.Count); + Contract.Requires(dataGridViewColumn != null); + } + + protected virtual void OnCollectionChanged(CollectionChangeEventArgs e) + { + + } + + public virtual void Remove(string columnName) + { + Contract.Requires(columnName != null); + } + + public virtual void Remove(DataGridViewColumn dataGridViewColumn) + { + Contract.Requires(dataGridViewColumn != null); + } + + public virtual void RemoveAt(int index) + { + Contract.Requires(index >= 0); + Contract.Requires(index < this.Count); + } + + void ICollection.CopyTo(Array array, int index) + { + Contract.Requires(array != null); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return default(IEnumerator); + } + + int IList.Add(object value) + { + return default(int); + } + + void IList.Clear() + { + + } + + bool IList.Contains(object value) + { + return default(bool); + } + + int IList.IndexOf(object value) + { + return default(int); + } + + void IList.Insert(int index, object value) + { + + } + + void IList.Remove(object value) + { + + } + + void IList.RemoveAt(int index) + { + + } + protected DataGridView DataGridView + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(DataGridView); + } + } + + public DataGridViewColumn this[string columnName] + { + get + { + Contract.Requires(columnName != null); + return default(DataGridViewColumn); + } + } + + public DataGridViewColumn this[int index] + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(DataGridViewColumn); + } + } + + protected override ArrayList List + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(ArrayList); + } + } + + int ICollection.Count + { + get + { + return default(int); + } + } + + bool ICollection.IsSynchronized + { + get + { + return default(bool); + } + } + + object ICollection.SyncRoot + { + get + { + return default(ICollection); + } + } + + bool IList.IsFixedSize + { + get + { + return default(bool); + } + } + + bool IList.IsReadOnly + { + get + { + return default(bool); + } + } + + object IList.this[int index] + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(DataGridViewColumn); + } + set + { + throw new NotSupportedException(); + } + } + + //public event CollectionChangeEventHandler CollectionChanged; + } +} \ No newline at end of file diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewElement.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewElement.cs new file mode 100644 index 00000000..b91374c0 --- /dev/null +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewElement.cs @@ -0,0 +1,24 @@ +// CodeContracts +// +// Copyright (c) Microsoft Corporation +// +// All rights reserved. +// +// MIT License +// +// 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. + +namespace System.Windows.Forms +{ + public class DataGridViewElement + { + public DataGridViewElement() + { + + } + } +} \ No newline at end of file diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewElementStates.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewElementStates.cs new file mode 100644 index 00000000..9fb0b4b7 --- /dev/null +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewElementStates.cs @@ -0,0 +1,31 @@ +// CodeContracts +// +// Copyright (c) Microsoft Corporation +// +// All rights reserved. +// +// MIT License +// +// 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.Runtime.InteropServices; + +namespace System.Windows.Forms +{ + [Flags, ComVisible(true)] + public enum DataGridViewElementStates + { + Displayed = 1, + Frozen = 2, + None = 0, + ReadOnly = 4, + Resizable = 8, + ResizableSet = 0x10, + Selected = 0x20, + Visible = 0x40 + } +} \ No newline at end of file diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewRow.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewRow.cs new file mode 100644 index 00000000..329d26cb --- /dev/null +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewRow.cs @@ -0,0 +1,48 @@ +// CodeContracts +// +// Copyright (c) Microsoft Corporation +// +// All rights reserved. +// +// MIT License +// +// 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.Diagnostics.Contracts; + +namespace System.Windows.Forms +{ + public class DataGridViewRow : DataGridViewBand + { + public DataGridViewRow() + { + + } + + public override object Clone() + { + Contract.Ensures(Contract.Result() != null); + Contract.Ensures(Contract.Result() is DataGridViewRow); + return default(object); + } + + protected virtual DataGridViewCellCollection CreateCellsInstance() + { + Contract.Ensures(Contract.Result() != null); + return default(DataGridViewCellCollection); + } + + public DataGridViewCellCollection Cells + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(DataGridViewCellCollection); + } + } + } +} \ No newline at end of file diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewRowCollection.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewRowCollection.cs new file mode 100644 index 00000000..67d00fdd --- /dev/null +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.DataGridViewRowCollection.cs @@ -0,0 +1,448 @@ +// CodeContracts +// +// Copyright (c) Microsoft Corporation +// +// All rights reserved. +// +// MIT License +// +// 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.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics.Contracts; +using System.Drawing; + +namespace System.Windows.Forms +{ + public class DataGridViewRowCollection : ICollection, IEnumerable, IList + { + /*private class RowArrayList : ArrayList + { + // Fields + private DataGridViewRowCollection owner; + private DataGridViewRowCollection.RowComparer rowComparer; + + // Methods + public RowArrayList(DataGridViewRowCollection owner) + { + Contract.Requires(owner != null); + Contract.Ensures(this.owner != null); + } + + public void CustomSort(DataGridViewRowCollection.RowComparer rowComparer) + { + Contract.Requires(rowComparer != null); + Contract.Ensures(this.rowComparer != null); + } + } + + private class RowComparer + { + // Fields + //private bool ascending; + //private IComparer customComparer; + private DataGridView dataGridView; + private DataGridViewRowCollection dataGridViewRows; + //private DataGridViewColumn dataGridViewSortedColumn; + private static ComparedObjectMax max = new ComparedObjectMax(); + //private int sortedColumnIndex; + + // Methods + public RowComparer(DataGridViewRowCollection dataGridViewRows, IComparer customComparer, bool ascending) + { + Contract.Requires(dataGridViewRows != null); + Contract.Ensures(this.dataGridViewRows != null); + Contract.Ensures(this.dataGridView != null); + } + + // Nested Types + private class ComparedObjectMax + { + } + } + + private class UnsharingRowEnumerator : IEnumerator + { + // Fields + private int current; + private DataGridViewRowCollection owner; + + // Methods + public UnsharingRowEnumerator(DataGridViewRowCollection owner) + { + Contract.Requires(owner != null); + Contract.Ensures(this.owner != null); + Contract.Ensures(this.current == -1); + } + + bool IEnumerator.MoveNext() + { + return default(bool); + } + + void IEnumerator.Reset() + { + Contract.Ensures(this.current == -1); + this.current = -1; + } + + // Properties + object IEnumerator.Current + { + get + { + return default(object); + } + } + } + + private DataGridView dataGridView; + private RowArrayList items; + //private CollectionChangeEventHandler onCollectionChanged; + //private int rowCountsVisible; + //private int rowCountsVisibleFrozen; + //private int rowCountsVisibleSelected; + //private int rowsHeightVisible; + //private int rowsHeightVisibleFrozen; + private List rowStates; + + //public event CollectionChangeEventHandler CollectionChanged;*/ + + public DataGridViewRowCollection(DataGridView dataGridView) + { + Contract.Requires(dataGridView != null); + } + + public virtual int Add() + { + Contract.Ensures(Contract.Result() >= 0); + return default(int); + } + + public virtual int Add(int count) + { + Contract.Requires(count > 0); + return default(int); + } + public virtual int Add(params object[] values) + { + Contract.Requires(values != null); + Contract.Ensures(Contract.Result() >= 0); + return default(int); + } + + public virtual int Add(DataGridViewRow dataGridViewRow) + { + Contract.Requires(dataGridViewRow != null); + Contract.Ensures(Contract.Result() >= 0); + return default(int); + } + + public virtual int AddCopies(int indexSource, int count) + { + return default(int); + } + + public virtual int AddCopy(int indexSource) + { + return default(int); + } + + public virtual void AddRange(params DataGridViewRow[] dataGridViewRows) + { + Contract.Requires(dataGridViewRows != null); + Contract.Requires(Contract.ForAll(dataGridViewRows, (row) => { return row != null; })); + } + + public virtual void Clear() + { + + } + + public virtual bool Contains(DataGridViewRow dataGridViewRow) + { + return default(bool); + } + + public void CopyTo(DataGridViewRow[] array, int index) + { + Contract.Requires(array != null); + } + + public int GetFirstRow(DataGridViewElementStates includeFilter) + { + Contract.Ensures(Contract.Result() >= -1); + return default(int); + } + public int GetFirstRow(DataGridViewElementStates includeFilter, DataGridViewElementStates excludeFilter) + { + Contract.Ensures(Contract.Result() >= -1); + return default(int); + } + public int GetLastRow(DataGridViewElementStates includeFilter) + { + Contract.Ensures(Contract.Result() >= -1); + return default(int); + } + + public int GetNextRow(int indexStart, DataGridViewElementStates includeFilter) + { + Contract.Requires(indexStart >= -1); + Contract.Ensures(Contract.Result() >= -1); + return default(int); + } + + public int GetNextRow(int indexStart, DataGridViewElementStates includeFilter, DataGridViewElementStates excludeFilter) + { + Contract.Requires(indexStart >= -1); + Contract.Ensures(Contract.Result() >= -1); + return default(int); + } + + public int GetPreviousRow(int indexStart, DataGridViewElementStates includeFilter) + { + Contract.Requires(indexStart <= this.Count); + Contract.Ensures(Contract.Result() >= -1); + return default(int); + } + + public int GetPreviousRow(int indexStart, DataGridViewElementStates includeFilter, DataGridViewElementStates excludeFilter) + { + Contract.Requires(indexStart <= this.Count); + Contract.Ensures(Contract.Result() >= -1); + return default(int); + } + + public int GetRowCount(DataGridViewElementStates includeFilter) + { + return default(int); + } + + public int GetRowsHeight(DataGridViewElementStates includeFilter) + { + return default(int); + } + + public virtual DataGridViewElementStates GetRowState(int rowIndex) + { + Contract.Requires(rowIndex >= 0); + Contract.Requires(rowIndex < this.Count); + return default(DataGridViewElementStates); + } + + public int IndexOf(DataGridViewRow dataGridViewRow) + { + Contract.Ensures(Contract.Result() >= -1); + return default(int); + } + + public virtual void Insert(int rowIndex, int count) + { + Contract.Requires(rowIndex >= 0); + Contract.Requires(this.Count >= rowIndex); + Contract.Requires(count > 0); + } + + public virtual void Insert(int rowIndex, params object[] values) + { + Contract.Requires(values != null); + } + + public virtual void Insert(int rowIndex, DataGridViewRow dataGridViewRow) + { + Contract.Requires(rowIndex >= 0); + Contract.Requires(this.Count >= rowIndex); + Contract.Requires(dataGridViewRow != null); + } + + public virtual void InsertCopies(int indexSource, int indexDestination, int count) + { + Contract.Requires(indexSource >= 0); + Contract.Requires(this.Count > indexSource); + Contract.Requires(indexDestination >= 0); + Contract.Requires(this.Count >= indexDestination); + Contract.Requires(count > 0); + } + + public virtual void InsertCopy(int indexSource, int indexDestination) + { + Contract.Requires(indexSource >= 0); + Contract.Requires(this.Count > indexSource); + Contract.Requires(indexDestination >= 0); + Contract.Requires(this.Count >= indexDestination); + } + + public virtual void InsertRange(int rowIndex, params DataGridViewRow[] dataGridViewRows) + { + Contract.Requires(dataGridViewRows != null); + Contract.Requires(Contract.ForAll(dataGridViewRows, (row) => { return row != null; })); + Contract.Requires(rowIndex >= 0); + Contract.Requires(this.Count >= rowIndex); + } + + protected virtual void OnCollectionChanged(CollectionChangeEventArgs e) + { + + } + + public virtual void Remove(DataGridViewRow dataGridViewRow) + { + Contract.Requires(dataGridViewRow != null); + } + + public virtual void RemoveAt(int index) + { + Contract.Requires(index >= 0); + Contract.Requires(index < this.Count); + } + + public DataGridViewRow SharedRow(int rowIndex) + { + Contract.Ensures(Contract.Result() != null); + return default(DataGridViewRow); + } + + void ICollection.CopyTo(Array array, int index) + { + + } + + IEnumerator IEnumerable.GetEnumerator() + { + return default(IEnumerator); + } + + int IList.Add(object value) + { + return default(int); + } + + void IList.Clear() + { + + } + + bool IList.Contains(object value) + { + return default(bool); + } + + int IList.IndexOf(object value) + { + return default(int); + } + + void IList.Insert(int index, object value) + { + + } + + void IList.Remove(object value) + { + + } + + void IList.RemoveAt(int index) + { + + } + + public int Count + { + get + { + Contract.Ensures(Contract.Result() >= 0); + return default(int); + } + } + + protected DataGridView DataGridView + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(DataGridView); + } + } + + public DataGridViewRow this[int index] + { + get + { + Contract.Requires(index >= 0); + Contract.Requires(index < this.Count); + Contract.Ensures(Contract.Result() != null); + return default(DataGridViewRow); + } + } + + protected ArrayList List + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(ArrayList); + } + } + + int ICollection.Count + { + get + { + return default(int); + } + } + + bool ICollection.IsSynchronized + { + get + { + return default(bool); + } + } + + object ICollection.SyncRoot + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(object); + } + } + + bool IList.IsFixedSize + { + get + { + return default(bool); + } + } + + bool IList.IsReadOnly + { + get + { + return default(bool); + } + } + + object IList.this[int index] + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(DataGridViewRow); + } + set + { + throw new NotSupportedException(); + } + } + } +} \ No newline at end of file diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.FlatButtonAppearance.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.FlatButtonAppearance.cs new file mode 100644 index 00000000..30fcb4e1 --- /dev/null +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.FlatButtonAppearance.cs @@ -0,0 +1,26 @@ +// CodeContracts +// +// Copyright (c) Microsoft Corporation +// +// All rights reserved. +// +// MIT License +// +// 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.Diagnostics.Contracts; + +namespace System.Windows.Forms +{ + public class FlatButtonAppearance + { + private FlatButtonAppearance() + { + + } + } +} \ No newline at end of file diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.IBindableComponent.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.IBindableComponent.cs new file mode 100644 index 00000000..5aea17b9 --- /dev/null +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.IBindableComponent.cs @@ -0,0 +1,24 @@ +// CodeContracts +// +// Copyright (c) Microsoft Corporation +// +// All rights reserved. +// +// MIT License +// +// 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.ComponentModel; + +namespace System.Windows.Forms +{ + public interface IBindableComponent : IComponent, IDisposable + { + BindingContext BindingContext { get; set; } + ControlBindingsCollection DataBindings { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.ImageList.cs b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.ImageList.cs index aa460c4e..65c9ed1a 100644 --- a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.ImageList.cs +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms.ImageList.cs @@ -118,7 +118,14 @@ public ColorDepth ColorDepth // // Returns: // The collection of images. - //public ImageList.ImageCollection Images { get; } + public ImageList.ImageCollection Images + { + get + { + Contract.Ensures(Contract.Result() != null); + return default(ImageCollection); + } + } // diff --git a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms10.csproj b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms10.csproj index 6885f348..76d59dc1 100644 --- a/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms10.csproj +++ b/Microsoft.Research/Contracts/System.Windows.Forms/System.Windows.Forms10.csproj @@ -1,4 +1,4 @@ - + Debug @@ -191,19 +191,36 @@ + + + + + + + + + + + + + + + + + @@ -302,4 +319,4 @@ --> - + \ No newline at end of file