/// <summary>
        /// Generates a serializable continuation token from its XML representation.
        /// </summary>
        /// <param name="reader">The <see cref="T:System.Xml.XmlReader"/> stream from which the continuation token is deserialized.</param>
        void IXmlSerializable.ReadXml(System.Xml.XmlReader reader)
        {
            CommonUtils.AssertNotNull("reader", reader);

            reader.MoveToContent();

            bool isEmptyElement = reader.IsEmptyElement;

            reader.ReadStartElement();

            if (!isEmptyElement)
            {
                bool more = true;
                while (more)
                {
                    if (reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement)
                    {
                        switch (reader.Name)
                        {
                        case VersionElement:
                            string version = reader.ReadElementContentAsString();
                            Console.WriteLine(version);

                            // For future versioning
                            break;

                        case NextMarkerElement:
                            this.NextMarker = reader.ReadElementContentAsString();
                            break;

                        case NextPartitionKeyElement:
                            this.NextPartitionKey = reader.ReadElementContentAsString();
                            break;

                        case NextRowKeyElement:
                            this.NextRowKey = reader.ReadElementContentAsString();
                            break;

                        case NextTableNameElement:
                            this.NextTableName = reader.ReadElementContentAsString();
                            break;

                        case TypeElement:
                            this.Type = (ContinuationType)Enum.Parse(typeof(ContinuationType), reader.ReadElementContentAsString());
                            break;
                        }
                    }
                    else
                    {
                        more = reader.Read();
                    }
                }
            }
        }
예제 #2
0
 public FileCopyReport(ReportType reportType, FileCopyOperation operation, int streamIndex, long chunkOffset, long chunkSize)
 {
     this._reportType      = reportType;
     this._operation       = operation;
     this._streamIndex     = streamIndex;
     this._chunkOffset     = chunkOffset;
     this._chunkSize       = chunkSize;
     this._source          = operation.Source;
     this._target          = operation.Target;
     this._streamOffset    = 0;
     this._streamSize      = operation.BytesToTransfer;
     this.ContinuationType = reportType == ReportType.AbortedOperation ? ContinuationType.AbortOperation : ContinuationType.Proceed;
 }
        /// <summary>
        /// Generates a serializable continuation token from its XML representation.
        /// </summary>
        /// <param name="reader">The <see cref="T:System.Xml.XmlReader"/> stream from which the continuation token is deserialized.</param>
        void IXmlSerializable.ReadXml(System.Xml.XmlReader reader)
        {
            CommonUtils.AssertNotNull("reader", reader);

            reader.MoveToContent();

            bool isEmptyElement = reader.IsEmptyElement;
            reader.ReadStartElement();

            if (!isEmptyElement)
            {
                bool more = true;
                while (more)
                {
                    if (reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement)
                    {
                        switch (reader.Name)
                        {
                            case VersionElement:
                                string version = reader.ReadElementContentAsString();
							Console.WriteLine(version);

                                // For future versioning
                                break;
                            case NextMarkerElement:
                                this.NextMarker = reader.ReadElementContentAsString();
                                break;
                            case NextPartitionKeyElement:
                                this.NextPartitionKey = reader.ReadElementContentAsString();
                                break;
                            case NextRowKeyElement:
                                this.NextRowKey = reader.ReadElementContentAsString();
                                break;
                            case NextTableNameElement:
                                this.NextTableName = reader.ReadElementContentAsString();
                                break;
                            case TypeElement:
                                this.Type = (ContinuationType)Enum.Parse(typeof(ContinuationType), reader.ReadElementContentAsString());
                                break;
                        }
                    }
                    else
                    {
                        more = reader.Read();
                    }
                }
            }
        }
예제 #4
0
 private FubuContinuation(ContinuationType type, Action <IContinuationDirector> configure)
 {
     _type      = type;
     _configure = configure;
 }
예제 #5
0
 private FubuContinuation(ContinuationType type, Func <IContinuationDirector, Task> configure)
 {
     Type       = type;
     _configure = configure;
 }
예제 #6
0
 private Continuation(ContinuationType type)
 {
     this.ContinuationType = type;
 }