getNodeAttributeValue() public method

public getNodeAttributeValue ( string _xmlString, string _nodeId, string _attributeId ) : string
_xmlString string
_nodeId string
_attributeId string
return string
Esempio n. 1
0
        protected void propertyChanged()
        {
            string propXml = renderingControl.PropertyLastChange();
                string result;
                XMLParser xmlParser = new XMLParser();
                UInt16 currentVolumeNew;
                Boolean isMutedNew;

                result = xmlParser.getNodeAttributeValue(propXml, "Volume", "val");
                if (result != null)
                {
                    currentVolumeNew = (UInt16)Convert.ToInt16(result);
                    if (currentVolumeNew != null && currentVolume != currentVolumeNew)
                    {
                        currentVolume = currentVolumeNew;
                        this.VolumeChangedSink(currentVolumeNew);
                    }
                }

                result = xmlParser.getNodeAttributeValue(propXml, "Mute", "val");
                if (result != null)
                {
                    if (result == "0")
                        isMutedNew = false;
                    else
                        isMutedNew = true;
                    if (isMutedNew != null /*&& isMuted != isMutedNew*/)
                    {
                        isMuted = isMutedNew;
                        this.MuteStateChangedSink(isMutedNew);
                    }
                }
        }
Esempio n. 2
0
        protected void propertyChanged()
        {
            string avTransportUriNew;
                string avTransportUriMetaDataNew;
                string tmp;
                UInt32 CurrentTrackNew;
                string propXml = avTransport.PropertyLastChange();
                XMLParser xmlParser = new XMLParser();

                avTransportUriMetaDataNew = xmlParser.getNodeAttributeValue(propXml, "AVTransportURIMetaData", "val");
                if (avTransportUriMetaDataNew != null && AVTransportUriMetaData != avTransportUriMetaDataNew)
                {
                    AVTransportUriMetaData = avTransportUriMetaDataNew;
                    this.AVTransportURIMetaDataChangedSink();
                }

                avTransportUriNew = xmlParser.getNodeAttributeValue(propXml, "AVTransportURI", "val");
                if (avTransportUriNew != null && AVTransportUri != avTransportUriNew)
                {
                    AVTransportUri = avTransportUriNew;
                    this.AVTransportURIChangedSink();
                }

                tmp = xmlParser.getNodeAttributeValue(propXml, "CurrentTrack", "val");
                if (tmp != null && tmp != "")
                {
                    CurrentTrackNew = Convert.ToUInt32(tmp);
                    if (CurrentTrack != CurrentTrackNew)
                    {
                        CurrentTrack = CurrentTrackNew;
                        this.TrackChangedSink(CurrentTrack);
                    }
                }

                tmp = xmlParser.getNodeAttributeValue(propXml, "CurrentPlayMode", "val");
                if (tmp != null && tmp != currentPlayMode)
                {
                    currentPlayMode = tmp;
                    playMode = playModeStringToPlayMode(currentPlayMode);
                    this.CurrentPlayModeChangedSink();
                }

                tmp = xmlParser.getNodeAttributeValue(propXml, "TransportState", "val");
                if (tmp != null && tmp != "")
                {
                    this.PlayStateChangedSink(tmp);

                    if (progressTimer != null)
                    {
                        if (tmp == "PLAYING")
                            progressTimer.Start();
                        else
                            progressTimer.Stop();
                    }

                }
        }