Beispiel #1
0
        /// <summary>
        /// Converts an encodeable object to an extension object.
        /// </summary>
        /// <remarks>
        /// Converts an encodeable object to an extension object.
        /// </remarks>
        /// <param name="encodeables">An enumerable array of ExtensionObjects to convert to a collection</param>
        public static ExtensionObjectCollection ToExtensionObjects(IEnumerable <IEncodeable> encodeables)
        {
            // return null if the input list is null.
            if (encodeables == null)
            {
                return(null);
            }

            // convert each encodeable to an extension object.
            ExtensionObjectCollection extensibles = new ExtensionObjectCollection();

            if (encodeables != null)
            {
                foreach (IEncodeable encodeable in encodeables)
                {
                    // check if already an extension object.
                    ExtensionObject extensible = encodeable as ExtensionObject;

                    if (extensible != null)
                    {
                        extensibles.Add(extensible);
                    }

                    // wrap the encodeable with an extension object and let the serializer choose the encoding.
                    else
                    {
                        extensibles.Add(new ExtensionObject(encodeable));
                    }
                }
            }

            return(extensibles);
        }
Beispiel #2
0
        /// <summary>
        /// Creates a deep copy of the collection.
        /// </summary>
        /// <remarks>
        /// Creates a deep copy of the collection.
        /// </remarks>
        public object Clone() {
            ExtensionObjectCollection clone = new ExtensionObjectCollection(this.Count);

            foreach (ExtensionObject element in this) {
                clone.Add((ExtensionObject) Utils.Clone(element));
            }

            return clone;
        }
Beispiel #3
0
        /// <summary>
        /// Creates a deep copy of the collection.
        /// </summary>
        /// <remarks>
        /// Creates a deep copy of the collection.
        /// </remarks>
        public new object MemberwiseClone()
        {
            ExtensionObjectCollection clone = new ExtensionObjectCollection(this.Count);

            foreach (ExtensionObject element in this)
            {
                clone.Add((ExtensionObject)Utils.Clone(element));
            }

            return(clone);
        }
Beispiel #4
0
        /// <summary>
        /// Invokes the HistoryUpdate service.
        /// </summary>
        public virtual ResponseHeader HistoryUpdate(
            RequestHeader requestHeader,
            ExtensionObjectCollection historyUpdateDetails,
            out HistoryUpdateResultCollection results,
            out DiagnosticInfoCollection diagnosticInfos)
        {
            results         = null;
            diagnosticInfos = null;

            ValidateRequest(requestHeader);

            // Insert implementation.

            return(CreateResponse(requestHeader, StatusCodes.BadServiceUnsupported));
        }
Beispiel #5
0
        /// <summary>
        /// Invokes the RegisterServer2 service.
        /// </summary>
        public virtual ResponseHeader RegisterServer2(
            RequestHeader requestHeader,
            RegisteredServer server,
            ExtensionObjectCollection discoveryConfiguration,
            out StatusCodeCollection configurationResults,
            out DiagnosticInfoCollection diagnosticInfos)
        {
            configurationResults = null;
            diagnosticInfos      = null;

            ValidateRequest(requestHeader);

            // Insert implementation.

            return(CreateResponse(requestHeader, StatusCodes.BadServiceUnsupported));
        }