internal void ReadXml(XmlTextReader reader)
        {
            while (reader.Read())
            {
                // End of credit_card element, get out of here
                if (reader.Name == "credit_card" && reader.NodeType == XmlNodeType.EndElement)
                    break;

                if (reader.NodeType == XmlNodeType.Element)
                {
                    switch (reader.Name)
                    {
                        case "year":
                            this.ExpirationYear = reader.ReadElementContentAsInt();
                            break;

                        case "month":
                            this.ExpirationMonth = reader.ReadElementContentAsInt();
                            break;

                        case "last_four":
                            this.LastFour = reader.ReadElementContentAsString();
                            break;

                        case "type":
                            this.CreditCardType = reader.ReadElementContentAsString();
                            break;
                    }
                }
            }
        }
        internal override void ReadXml(XmlTextReader reader)
        {
            while (reader.Read())
            {
                if (reader.Name == "subscription_add_on" && reader.NodeType == XmlNodeType.EndElement)
                    break;

                if (reader.NodeType != XmlNodeType.Element) continue;

                switch (reader.Name)
                {
                    case "add_on_code":
                        AddOnCode = reader.ReadElementContentAsString();
                        break;

                    case "quantity":
                        Quantity = reader.ReadElementContentAsInt();
                        break;

                    case "unit_amount_in_cents":
                        UnitAmountInCents = reader.ReadElementContentAsInt();
                        break;
                }
            }
        }
Exemplo n.º 3
0
        public void Load(System.Xml.XmlTextReader tr, string localName)
        {
            int count;

            tr.ReadStartElement(localName);

            _viewDirectionRecentIsFirst = tr.ReadElementContentAsBoolean("DirectionRecentFirst", string.Empty);

            count = XmlConvert.ToInt32(tr.GetAttribute("Count"));
            tr.ReadStartElement("ColumnWidths");
            _columnWidths = new double[count];
            for (int i = 0; i < count; i++)
            {
                _columnWidths[i] = tr.ReadElementContentAsInt("Width", string.Empty);
            }
            if (count > 0)
            {
                tr.ReadEndElement(); // ColumnWidths
            }
            if (null != _view)
            {
                _view.ColumnWidths = _columnWidths;
                _columnWidths      = null;
            }

            tr.ReadEndElement();
        }
        public override WebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            XmlTextReader reader = new XmlTextReader(context.ResponseStream);
            QueueAttributes attributes = new QueueAttributes();

            while (reader.Read())
            {
                switch (reader.NodeType)
                {
                    case XmlNodeType.Element:
                        switch (reader.LocalName)
                        {
                            case MNSConstants.XML_ELEMENT_QUEUE_NAME:
                                attributes.QueueName = reader.ReadElementContentAsString();
                                break;
                            case MNSConstants.XML_ELEMENT_CREATE_TIME:
                                attributes.CreateTime = AliyunSDKUtils.ConvertFromUnixEpochSeconds(reader.ReadElementContentAsLong());
                                break;
                            case MNSConstants.XML_ELEMENT_LAST_MODIFY_TIME:
                                attributes.LastModifyTime = AliyunSDKUtils.ConvertFromUnixEpochSeconds(reader.ReadElementContentAsLong());
                                break;
                            case MNSConstants.XML_ELEMENT_VISIBILITY_TIMEOUT:
                                attributes.VisibilityTimeout = (uint)reader.ReadElementContentAsInt();
                                break;
                            case MNSConstants.XML_ELEMENT_MAXIMUM_MESSAGE_SIZE:
                                attributes.MaximumMessageSize = (uint)reader.ReadElementContentAsInt();
                                break;
                            case MNSConstants.XML_ELEMENT_MESSAGE_RETENTION_PERIOD:
                                attributes.MessageRetentionPeriod = (uint)reader.ReadElementContentAsInt();
                                break;
                            case MNSConstants.XML_ELEMENT_DELAY_SECONDS:
                                attributes.DelaySeconds = (uint)reader.ReadElementContentAsInt();
                                break;
                            case MNSConstants.XML_ELEMENT_POLLING_WAIT_SECONDS:
                                attributes.PollingWaitSeconds = (uint)reader.ReadElementContentAsInt();
                                break;
                            case MNSConstants.XML_ELEMENT_INACTIVE_MESSAGES:
                                attributes.InactiveMessages = (uint)reader.ReadElementContentAsInt();
                                break;
                            case MNSConstants.XML_ELEMENT_ACTIVE_MESSAGES:
                                attributes.ActiveMessages = (uint)reader.ReadElementContentAsInt();
                                break;
                            case MNSConstants.ATTRIBUTE_DELAY_MESSAGES:
                                attributes.DelayMessages = (uint)reader.ReadElementContentAsInt();
                                break;
                        }
                        break;
                }
            }
            reader.Close();
            return new GetQueueAttributesResponse()
            {
                Attributes = attributes
            };
        }
        public override WebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            XmlTextReader reader = new XmlTextReader(context.ResponseStream);
            Message message = new Message();

            while (reader.Read())
            {
                switch (reader.NodeType)
                {
                    case XmlNodeType.Element:
                        switch (reader.LocalName)
                        {
                            case MNSConstants.XML_ELEMENT_MESSAGE_ID:
                                message.Id = reader.ReadElementContentAsString();
                                break;
                            case MNSConstants.XML_ELEMENT_MESSAGE_BODY_MD5:
                                message.BodyMD5 = reader.ReadElementContentAsString();
                                break;
                            case MNSConstants.XML_ELEMENT_MESSAGE_BODY:
                                message.Body = reader.ReadElementContentAsString();
                                break;
                            case MNSConstants.XML_ELEMENT_ENQUEUE_TIME:
                                message.EnqueueTime = AliyunSDKUtils.ConvertFromUnixEpochSeconds(reader.ReadElementContentAsLong());
                                break;
                            case MNSConstants.XML_ELEMENT_FIRST_DEQUEUE_TIME:
                                message.FirstDequeueTime = AliyunSDKUtils.ConvertFromUnixEpochSeconds(reader.ReadElementContentAsLong());
                                break;
                            case MNSConstants.XML_ELEMENT_DEQUEUE_COUNT:
                                message.DequeueCount = (uint)reader.ReadElementContentAsInt();
                                break;
                            case MNSConstants.XML_ELEMENT_PRIORITY:
                                message.Priority = (uint)reader.ReadElementContentAsInt();
                                break;
                        }
                        break;
                }
            }
            reader.Close();
            return new PeekMessageResponse()
            {
                Message = message
            };
        }
Exemplo n.º 6
0
 public static void ReadGrandSlamAbility(ref XmlTextReader reader)
 {
     while (reader.Read())
     {
         if (reader.NodeType == XmlNodeType.Element)
         {
             if (reader.Name == XMLPropNames.strRadius)
                 mGrandSlamRadius = reader.ReadElementContentAsFloat();
             else if (reader.Name == XMLPropNames.strDamage)
                 mGrandSlamDamage = reader.ReadElementContentAsInt();
             else if (reader.Name == XMLPropNames.strStunDuration)
                 mGrandSlamStunDuration = reader.ReadElementContentAsInt();
             else if (reader.Name == XMLPropNames.strKnockBackSpeed)
                 mGrandSlamKnockBackSpeed = reader.ReadElementContentAsFloat();
         }
         else if (reader.NodeType == XmlNodeType.EndElement &&
                  reader.Name == XMLPropNames.strAbility)
             break;
     }
 }
Exemplo n.º 7
0
        //
        // ABSTRACT	: �v���t�@�C����ǂݍ���
        //
        public bool LoadProfile(string path)
        {
            if (!File.Exists(path))
                return false;

            XmlReader xr = new XmlTextReader(path);

            while (xr.Read())
            {
                if (xr.NodeType == XmlNodeType.Element)
                {
                    if (xr.LocalName.Equals("Execute"))
                    {
                        ExecuteFilePathTextBox.Text = xr.ReadElementContentAsString();
                    }
                    else if (xr.LocalName.Equals("Argument"))
                    {
                        ArgumentTextBox.Text = xr.ReadElementContentAsString();
                    }
                    else if (xr.LocalName.Equals("Extension"))
                    {
                        ExtensionTextBox.Text = xr.ReadElementContentAsString();
                    }
                    else if (xr.LocalName.Equals("Minimize"))
                    {
                        MinimizeCheckBox.Checked = (xr.ReadElementContentAsInt()==0)?false:true;
                    }
                    else if ( xr.LocalName.Equals( "OutputType" ) )
                    {
                        OutputTypeComboBox.SelectedIndex = xr.ReadElementContentAsInt();
                    }
                }

            }

            ProfileNameTextBox.Text = Path.GetFileNameWithoutExtension(path);

            xr.Close();

            return true;
        }
Exemplo n.º 8
0
 public bool LoadFromFile(string filename)
 {
     m_FileName = filename;
     bool bRet = false;
     XmlTextReader reader = null;
     try
     {
         reader = new XmlTextReader(m_FileName);
         while (reader.Read())
         {
             switch (reader.NodeType)
             {
                 case XmlNodeType.Element: // The node is an element.
                     switch (reader.Name)
                     {
                         case "name": reader.MoveToContent(); m_name = reader.ReadElementContentAsString(); break;
                         case "pass1": reader.MoveToContent(); m_pass1 = reader.ReadElementContentAsString(); break;
                         case "pass2": reader.MoveToContent(); m_pass2 = reader.ReadElementContentAsString(); break;
                         case "icon": reader.MoveToContent(); m_icon = reader.ReadElementContentAsInt(); break;
                         case "account":
                             {
                                 AccountItem newAccount = new AccountItem();
                                 if (newAccount.AccountXMLLoad(reader))
                                 {
                                     m_Accounts.Add(newAccount);
                                 }
                                 break;
                             }
                     }
                     break;
                 case XmlNodeType.EndElement:
                     break;
             }
         }
     }
     catch (System.IO.FileNotFoundException exception)
     {
         return false;
     }
     catch (Exception exception)
     {
         MessageBox.Show("Error reading " + m_FileName);
     }
     finally
     {
         reader.Close();
     }
     return bRet;
 }
 private static void ProcessInvType(InventoryItemBase item, XmlTextReader reader)
 {
     item.InvType = reader.ReadElementContentAsInt("InvType", String.Empty);
 }
Exemplo n.º 10
0
 private static void ProcessNextPermissions(InventoryItemBase item, XmlTextReader reader)
 {
     item.NextPermissions = (uint)reader.ReadElementContentAsInt("NextPermissions", String.Empty);
 }
Exemplo n.º 11
0
 private static void ProcessCreationDate(InventoryItemBase item, XmlTextReader reader)
 {
     item.CreationDate = reader.ReadElementContentAsInt("CreationDate", String.Empty);
 }
Exemplo n.º 12
0
        internal override void ReadXml(XmlTextReader reader)
        {
            while (reader.Read())
            {
                // End of invoice element, get out of here
                if (reader.Name == "invoice" && reader.NodeType == XmlNodeType.EndElement)
                    break;

                if (reader.NodeType != XmlNodeType.Element) continue;

                switch (reader.Name)
                {
                    case "account":
                        var accountHref = reader.GetAttribute("href");
                        AccountCode = Uri.UnescapeDataString(accountHref.Substring(accountHref.LastIndexOf("/") + 1));
                        break;

                    case "subscription":
                        var subHref = reader.GetAttribute("href");
                        SubscriptionUuid = Uri.UnescapeDataString(subHref.Substring(subHref.LastIndexOf("/") + 1));
                        break;

                    case "uuid":
                        Uuid = reader.ReadElementContentAsString();
                        break;

                    case "state":
                        State = reader.ReadElementContentAsString().ParseAsEnum<InvoiceState>();
                        break;

                    case "invoice_number":
                        int invNumber;
                        if (Int32.TryParse(reader.ReadElementContentAsString(), out invNumber))
                            InvoiceNumber = invNumber;
                        break;

                    case "po_number":
                        PoNumber = reader.ReadElementContentAsString();
                        break;

                    case "vat_number":
                        VatNumber = reader.ReadElementContentAsString();
                        break;

                    case "subtotal_in_cents":
                        SubtotalInCents = reader.ReadElementContentAsInt();
                        break;

                    case "tax_in_cents":
                        TaxInCents = reader.ReadElementContentAsInt();
                        break;

                    case "total_in_cents":
                        TotalInCents = reader.ReadElementContentAsInt();
                        break;

                    case "currency":
                        Currency = reader.ReadElementContentAsString();
                        break;

                    case "created_at":
                        DateTime createdAt;
                        if (DateTime.TryParse(reader.ReadElementContentAsString(), out createdAt))
                            CreatedAt = createdAt;
                        break;

                    case "closed_at":
                        DateTime closedAt;
                        if (DateTime.TryParse(reader.ReadElementContentAsString(), out closedAt))
                            ClosedAt = closedAt;
                        break;

                    case "tax_type":
                        TaxType = reader.ReadElementContentAsString();
                        break;

                    case "tax_rate":
                        TaxRate = reader.ReadElementContentAsDecimal();
                        break;

                    case "net_terms":
                        NetTerms = reader.ReadElementContentAsInt();
                        break;

                    case "collection_method":
                        CollectionMethod = reader.ReadElementContentAsString();
                        break;

                    case "line_items":
                        // overrite existing value with the Recurly API response
                        Adjustments = new AdjustmentList();
                        Adjustments.ReadXml(reader);
                        break;

                    case "transactions":
                        // overrite existing value with the Recurly API response
                        Transactions = new TransactionList();
                        Transactions.ReadXml(reader);
                        break;
                }
            }
        }
Exemplo n.º 13
0
 private static void ProcessShpSculptType(PrimitiveBaseShape shp, XmlTextReader reader)
 {
     shp.SculptType = (byte)reader.ReadElementContentAsInt("SculptType", String.Empty);
 }
Exemplo n.º 14
0
 private static void ProcessShpPCode(PrimitiveBaseShape shp, XmlTextReader reader)
 {
     shp.PCode = (byte)reader.ReadElementContentAsInt("PCode", String.Empty);
 }
Exemplo n.º 15
0
 private static void ProcessShpPathShearY(PrimitiveBaseShape shp, XmlTextReader reader)
 {
     shp.PathShearY = (byte)reader.ReadElementContentAsInt("PathShearY", String.Empty);
 }
Exemplo n.º 16
0
        private int ReadXmlCommandFile(string filename)
        {
            string planFilePath = Path.GetDirectoryName(filename);

            this.MergeListFileArray = new List <MergeListFiles>();
            this.MergeListInfo      = new MergeListInfoDefn();

            MergeListFiles mergeElement = null;

            System.Xml.XmlTextReader reader = new System.Xml.XmlTextReader(filename);

            int fileNotFoundCount = 0;

            while (reader.Read())
            {
                if (reader.IsStartElement())
                {
                    switch (reader.Name.ToLower())
                    {
                    case "file":
                        if (mergeElement != null)
                        {
                            this.MergeListFileArray.Add(mergeElement);
                        }

                        mergeElement = new MergeListFiles();
                        object exclude = reader.GetAttribute("exclude");
                        if (exclude != null)
                        {
                            if (exclude.ToString() == "1")
                            {
                                mergeElement.Include = false;
                            }
                        }

                        break;

                    case "path":
                        mergeElement.Path = reader.ReadElementContentAsString();

                        // resolve paths, if files were moved
                        if (File.Exists(mergeElement.Path) == false)
                        {
                            ++fileNotFoundCount;
                        }

                        break;

                    case "pages":
                        mergeElement.Pages = reader.ReadElementContentAsString();
                        break;

                    case "bookmark":
                        mergeElement.Bookmark = reader.ReadElementContentAsString();
                        break;

                    case "level":
                        mergeElement.Level = reader.ReadElementContentAsInt();
                        break;

                    case "info":
                        this.MergeListInfo.HasInfo = true;
                        break;

                    case "author":
                        this.MergeListInfo.HasInfo    = true;
                        this.MergeListInfo.InfoAuthor = reader.ReadElementContentAsString();
                        break;

                    case "title":
                        this.MergeListInfo.HasInfo   = true;
                        this.MergeListInfo.InfoTitle = reader.ReadElementContentAsString();
                        break;

                    case "subject":
                        this.MergeListInfo.HasInfo     = true;
                        this.MergeListInfo.InfoSubject = reader.ReadElementContentAsString();
                        break;

                    case "annotation":
                        this.MergeListInfo.Annotation = reader.ReadElementContentAsString();
                        break;

                    case "outfile":
                        this.MergeListInfo.OutFilename = reader.ReadElementContentAsString();
                        break;

                    case "startpage":
                        this.MergeListInfo.StartPage   = int.Parse(reader.ReadElementContentAsString());
                        this.MergeListInfo.NumberPages = true;
                        break;

                    case "paginationformat":
                        try
                        {
                            this.MergeListInfo.PaginationFormat = (PaginationFormatting.PaginationFormats) int.Parse(reader.ReadElementContentAsString());
                        }
                        catch
                        {
                            throw new Exception("Invalid value for pagination format in command file");
                        }

                        break;
                    }
                }
            }

            if (mergeElement != null)
            {
                this.MergeListFileArray.Add(mergeElement);
            }

            reader.Close();

            return(fileNotFoundCount);
        }
Exemplo n.º 17
0
 private static void ProcessShpPathRadiusOffset(PrimitiveBaseShape shp, XmlTextReader reader)
 {
     shp.PathRadiusOffset = (sbyte)reader.ReadElementContentAsInt("PathRadiusOffset", String.Empty);
 }
Exemplo n.º 18
0
 private static void ProcessOwnershipCost(SceneObjectPart obj, XmlTextReader reader)
 {
     obj.OwnershipCost = reader.ReadElementContentAsInt("OwnershipCost", String.Empty);
 }
Exemplo n.º 19
0
 private static void ProcessShpPathTwistBegin(PrimitiveBaseShape shp, XmlTextReader reader)
 {
     shp.PathTwistBegin = (sbyte)reader.ReadElementContentAsInt("PathTwistBegin", String.Empty);
 }
Exemplo n.º 20
0
 private static void ProcessNextOwnerMask(SceneObjectPart obj, XmlTextReader reader)
 {
     obj.NextOwnerMask = (uint)reader.ReadElementContentAsInt("NextOwnerMask", String.Empty);
 }
Exemplo n.º 21
0
 private static void ProcessShpProfileHollow(PrimitiveBaseShape shp, XmlTextReader reader)
 {
     shp.ProfileHollow = (ushort)reader.ReadElementContentAsInt("ProfileHollow", String.Empty);
 }
Exemplo n.º 22
0
 private static void ProcessPayPrice4(SceneObjectPart obj, XmlTextReader reader)
 {
     obj.PayPrice[4] = (int)reader.ReadElementContentAsInt("PayPrice4", String.Empty);
 }
Exemplo n.º 23
0
        /// <summary>
        /// Sets fields for object from Xml file.
        /// </summary>
        /// <param name="reader">Reader module of file with data.</param>
        public void Read(XmlTextReader reader)
        {
            while (reader.Read())
            {
                if (reader.Name == "id")
                {
                    this.id = reader.ReadElementContentAsInt();
                }

                if (reader.Name == "name")
                {
                    this.name = reader.ReadElementContentAsString();
                }

                if (reader.Name == "price")
                {
                    this.price = reader.ReadElementContentAsDouble();
                    break;
                }
            }
        }
Exemplo n.º 24
0
 private static void ProcessTICreationDate(TaskInventoryItem item, XmlTextReader reader)
 {
     item.CreationDate = (uint)reader.ReadElementContentAsInt("CreationDate", String.Empty);
 }
        public List<DanbooruProvider> Read(string filename = @"DanbooruProviderList.xml")
        {
            List<DanbooruProvider> list = new List<DanbooruProvider>();

            using (XmlTextReader reader = new XmlTextReader(filename))
            {
                while (reader.Read())
                {
                    switch (reader.NodeType)
                    {
                        case XmlNodeType.Element:
                            if (reader.Name.Equals("DanbooruProviderList")) break;
                            else if (reader.Name.Equals("DanbooruProvider"))
                            {
                                Console.WriteLine(reader.Value);

                                DanbooruProvider newProvider = new DanbooruProvider();
                                do
                                {
                                    reader.Read();
                                    if (reader.NodeType.Equals(XmlNodeType.Element))
                                    {
                                        switch (reader.Name)
                                        {
                                            case "Name": newProvider.Name = reader.ReadElementContentAsString(); break;
                                            case "Url": newProvider.Url = reader.ReadElementContentAsString(); break;
                                            case "QueryStringJson": newProvider.QueryStringJson = reader.ReadElementContentAsString(); break;
                                            case "QueryStringHtml": newProvider.QueryStringHtml = reader.ReadElementContentAsString(); break;
                                            case "QueryStringXml": newProvider.QueryStringXml = reader.ReadElementContentAsString(); break;
                                            case "Preferred":
                                                string preferred = reader.ReadElementContentAsString().ToLowerInvariant();
                                                switch (preferred)
                                                {
                                                    case "json":
                                                        newProvider.Preferred = PreferredMethod.Json;
                                                        break;
                                                    case "xml":
                                                        newProvider.Preferred = PreferredMethod.Xml;
                                                        break;
                                                    case "html":
                                                        newProvider.Preferred = PreferredMethod.Html;
                                                        break;
                                                    default:
                                                        throw new Exception("Invalid Provider Type in DanbooruProviderList.xml: " + preferred);
                                                }
                                                break;
                                            case "DefaultLimit": newProvider.DefaultLimit = reader.ReadElementContentAsInt(); break;
                                            case "HardLimit": newProvider.HardLimit = reader.ReadElementContentAsInt(); break;
                                            case "UserName": newProvider.UserName = reader.ReadElementContentAsString(); break;
                                            case "Password": newProvider.Password = reader.ReadElementContentAsString(); break;
                                            case "UseAuth": newProvider.UseAuth = reader.ReadElementContentAsBoolean(); break;
                                            case "PasswordSalt": newProvider.PasswordSalt = reader.ReadElementContentAsString(); break;
                                            case "PasswordHash": newProvider.PasswordHash = reader.ReadElementContentAsString(); break;
                                            case "BoardType":
                                                string type = reader.ReadElementContentAsString();
                                                newProvider.BoardType = (BoardType)Enum.Parse(typeof(BoardType), type); //Type.Equals("Danbooru") ? BoardType.Danbooru:BoardType.Gelbooru ;
                                                break;
                                            case "TagDownloadUseLoop": newProvider.TagDownloadUseLoop = reader.ReadElementContentAsBoolean(); break;
                                            default: break;
                                        }
                                    }
                                } while (!reader.Name.Equals("DanbooruProvider"));
                                list.Add(newProvider);
                            }
                            break;
                        default: break;
                    }
                }
            }
            return list;
        }
Exemplo n.º 26
0
 private static void ProcessTICurrentPermissions(TaskInventoryItem item, XmlTextReader reader)
 {
     item.CurrentPermissions = (uint)reader.ReadElementContentAsInt("CurrentPermissions", String.Empty);
 }
Exemplo n.º 27
0
 private static void ProcessSalePrice(InventoryItemBase item, XmlTextReader reader)
 {
     item.SalePrice = reader.ReadElementContentAsInt("SalePrice", String.Empty);
 }
Exemplo n.º 28
0
 private static void ProcessTIPermsMask(TaskInventoryItem item, XmlTextReader reader)
 {
     item.PermsMask = reader.ReadElementContentAsInt("PermsMask", String.Empty);
 }
Exemplo n.º 29
0
 private static void ProcessFlags(InventoryItemBase item, XmlTextReader reader)
 {
     item.Flags = (uint)reader.ReadElementContentAsInt("Flags", String.Empty);
 }
Exemplo n.º 30
0
 private static void ProcessTIType(TaskInventoryItem item, XmlTextReader reader)
 {
     item.Type = reader.ReadElementContentAsInt("Type", String.Empty);
 }
Exemplo n.º 31
0
        private void _DaemonPipe_OnReceiveLine(string line)
        {
            XmlTextReader reader = new XmlTextReader(new StringReader(line));

            while (reader.Read())
            {
                switch (reader.NodeType)
                {
                    case XmlNodeType.Element:
                    {
                        if (reader.Depth == 0)
                        {
                            isEvent = (reader.Name == "Event");

                            if (isEvent || reader.Name == "Response")
                            {
                                for (int i = 0; i < reader.AttributeCount; i++)
                                {
                                    reader.MoveToAttribute(i);

                                    switch (reader.Name)
                                    {
                                        case "action":
                                            actionString = reader.Value;
                                            break;
                                        case "type":
                                            eventTypeString = reader.Value;
                                            break;
                                    }
                                }
                            }
                        }
                        else
                        {
                            switch (reader.Name)
                            {
                                case "InputXml":
                                    cookie = -1;

                                    // Parse through here to get the cookie value
                                    reader.Read();
                                    if (reader.Name == "Request")
                                    {
                                        for (int i = 0; i < reader.AttributeCount; i++)
                                        {
                                            reader.MoveToAttribute(i);

                                            if (reader.Name == "requestId")
                                            {
                                                Int32.TryParse(reader.Value, out cookie);
                                                break;
                                            }
                                        }
                                    }

                                    if (cookie == -1)
                                    {
                                        Logger.Log("VoiceManager._DaemonPipe_OnReceiveLine(): Failed to parse InputXml for the cookie", Helpers.LogLevel.Warning, Client);
                                    }
                                    break;
                                case "CaptureDevices": _CaptureDevices.Clear();
                                    break;
                                case "RenderDevices": _RenderDevices.Clear();
                                    break;
                                case "StatusCode": statusCode = reader.ReadElementContentAsInt();
                                    break;
                                case "StatusString": statusString = reader.ReadElementContentAsString();
                                    break;
                                case "State": state = reader.ReadElementContentAsInt();
                                    break;
                                case "ConnectorHandle": connectorHandle = reader.ReadElementContentAsString();
                                    break;
                                case "AccountHandle": accountHandle = reader.ReadElementContentAsString();
                                    break;
                                case "SessionHandle": sessionHandle = reader.ReadElementContentAsString();
                                    break;
                                case "URI": uriString = reader.ReadElementContentAsString();
                                    break;
                                case "IsChannel": isChannel = reader.ReadElementContentAsBoolean();
                                    break;
                                case "Name": nameString = reader.ReadElementContentAsString();
                                    break;
                                case "ChannelName": nameString = reader.ReadElementContentAsString();
                                    break;
                                case "ParticipantURI": uriString = reader.ReadElementContentAsString();
                                    break;
                                case "DisplayName": displayNameString = reader.ReadElementContentAsString();
                                    break;
                                case "AccountName": nameString = reader.ReadElementContentAsString();
                                    break;
                                case "ParticipantType": participantType = reader.ReadElementContentAsInt();
                                    break;
                                case "IsLocallyMuted": isLocallyMuted = reader.ReadElementContentAsBoolean();
                                    break;
                                case "IsModeratorMuted": isModeratorMuted = reader.ReadElementContentAsBoolean();
                                    break;
                                case "IsSpeaking":
                                    isSpeaking = reader.ReadElementContentAsBoolean();
                                    break;
                                case "Volume": volume = reader.ReadElementContentAsInt();
                                    break;
                                case "Energy": energy = reader.ReadElementContentAsFloat();
                                    break;
                                case "MicEnergy": energy = reader.ReadElementContentAsFloat();
                                    break;
                                case "ChannelURI": uriString = reader.ReadElementContentAsString();
                                    break;
                                case "ChannelListResult": _ChannelMap[nameString] = uriString;
                                    break;
                                case "CaptureDevice":
                                    reader.Read();
                                    _CaptureDevices.Add(reader.ReadElementContentAsString());
                                    break;
                                case "CurrentCaptureDevice":
                                    reader.Read();
                                    nameString = reader.ReadElementContentAsString();
                                    break;
                                case "RenderDevice":
                                    reader.Read();
                                    _RenderDevices.Add(reader.ReadElementContentAsString());
                                    break;
                                case "CurrentRenderDevice":
                                    reader.Read();
                                    nameString = reader.ReadElementContentAsString();
                                    break;
                            }
                        }

                        break;
                    }
                    case XmlNodeType.EndElement:
                        if (reader.Depth == 0)
                            ProcessEvent();
                        break;
                }
            }

            if (isEvent)
            {
            }
        }
Exemplo n.º 32
0
 private static void ProcessShpPathEnd(PrimitiveBaseShape shp, XmlTextReader reader)
 {
     shp.PathEnd = (ushort)reader.ReadElementContentAsInt("PathEnd", String.Empty);
 }