X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Web.Services%2FSystem.Web.Services.Description%2FOperationMessageCollection.cs;h=117f968e5a8188e451cef193a654cc4796f0ab80;hb=fe757a8636eeb541a0125b56c69b190d2ede4e0d;hp=3e13e51f0f0e4db9f0d5a24ed032942d78e10ca5;hpb=d20843d5e534327a12076606099b140a3ff11b96;p=mono.git diff --git a/mcs/class/System.Web.Services/System.Web.Services.Description/OperationMessageCollection.cs b/mcs/class/System.Web.Services/System.Web.Services.Description/OperationMessageCollection.cs index 3e13e51f0f0..117f968e5a8 100644 --- a/mcs/class/System.Web.Services/System.Web.Services.Description/OperationMessageCollection.cs +++ b/mcs/class/System.Web.Services/System.Web.Services.Description/OperationMessageCollection.cs @@ -12,17 +12,11 @@ using System.Web.Services; namespace System.Web.Services.Description { public sealed class OperationMessageCollection : ServiceDescriptionBaseCollection { - #region Fields - - Operation operation; - - #endregion // Fields - #region Constructors internal OperationMessageCollection (Operation operation) + : base (operation) { - this.operation = operation; } #endregion // Constructors @@ -30,13 +24,30 @@ namespace System.Web.Services.Description { #region Properties public OperationFlow Flow { - [MonoTODO] - get { throw new NotImplementedException (); } + get { + switch (Count) { + case 1: + if (this[0] is OperationInput) + return OperationFlow.OneWay; + else + return OperationFlow.Notification; + case 2: + if (this[0] is OperationInput) + return OperationFlow.RequestResponse; + else + return OperationFlow.SolicitResponse; + } + return OperationFlow.None; + } } public OperationInput Input { - [MonoTODO] - get { throw new NotImplementedException (); } + get { + foreach (object message in List) + if (message is OperationInput) + return (OperationInput) message; + return null; + } } public OperationMessage this [int index] { @@ -45,8 +56,12 @@ namespace System.Web.Services.Description { } public OperationOutput Output { - [MonoTODO] - set { throw new NotImplementedException (); } + get { + foreach (object message in List) + if (message is OperationOutput) + return (OperationOutput) message; + return null; + } } #endregion // Properties @@ -76,29 +91,31 @@ namespace System.Web.Services.Description { public void Insert (int index, OperationMessage operationMessage) { - SetParent (operationMessage, operation); List.Insert (index, operationMessage); } - [MonoTODO] protected override void OnInsert (int index, object value) { - throw new NotImplementedException (); + if (Count > 2 || (Count > 1 && value.GetType () == this [0].GetType ())) + throw new InvalidOperationException ("The operation object can only contain one input and one output message."); } - [MonoTODO] protected override void OnSet (int index, object oldValue, object newValue) { - throw new NotImplementedException (); + if (oldValue.GetType () != newValue.GetType ()) + throw new InvalidOperationException ("The message types of the old and new value are not the same."); + base.OnSet (index, oldValue, newValue); } - [MonoTODO] protected override void OnValidate (object value) { - throw new NotImplementedException (); + if (value == null) + throw new NullReferenceException ("The message object is a null reference."); + if (!(value is OperationInput || value is OperationOutput)) + throw new ArgumentException ("The message object is not an input or an output message."); } - public void Remove (Operation operationMessage) + public void Remove (OperationMessage operationMessage) { List.Remove (operationMessage); }