当前位置: 首页>>代码示例>>C#>>正文


C# XmlNode.SelectSingleNode方法代码示例

本文整理汇总了C#中XmlNode.SelectSingleNode方法的典型用法代码示例。如果您正苦于以下问题:C# XmlNode.SelectSingleNode方法的具体用法?C# XmlNode.SelectSingleNode怎么用?C# XmlNode.SelectSingleNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XmlNode的用法示例。


在下文中一共展示了XmlNode.SelectSingleNode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadFromXml

	public override void LoadFromXml (XmlNode dataNode)
	{
		if (dataNode.SelectSingleNode("./particleEffect") != null)
			particleEmitterResourceName = dataNode.SelectSingleNode("./particleEffect").InnerText;
			
		base.LoadFromXml(dataNode);
	}
开发者ID:stevesolomon,项目名称:MicroDungeonPrototype,代码行数:7,代码来源:TimedParticleModifier.cs

示例2: ReadFromXMLNode

            public virtual void ReadFromXMLNode(XmlNode node)
            {
                try
                {
                    // Deal with model path, must be only one
                    LoadModelPathNode(node);

                    // Deal with the start position
                    XmlNode startPositionNode = node.SelectSingleNode(ModelXMLDefinition.StartPosition);
                    if (startPositionNode != null)
                    {
                        m_ptStartPoint = CPoint3DSerializer.ReadPoint(startPositionNode);
                    }

                    // Read the scaleDirection
                    XmlNode scaleDirectionNode = node.SelectSingleNode(ModelXMLDefinition.SacleDirection);
                    CPoint3D scaleDirection = CPoint3DSerializer.ReadPoint(scaleDirectionNode);

                    Vector3D vec = new Vector3D(scaleDirection.X, scaleDirection.Y, scaleDirection.Z);
                    if (vec.LengthSquared != 0)
                    {
                        vec.Normalize();
                        m_scaleDirection = vec;
                    }
                }
                catch (SystemException ex)
                {
                    string errMsg = ex.Message + "\n" + ex.StackTrace;
                    vtk.vtkOutputWindow.GetInstance().DisplayErrorText(errMsg);
                    throw;
                }
            }
开发者ID:unidevop,项目名称:sjtu-project-pipe,代码行数:32,代码来源:zhujiangModels.cs

示例3: SiteDocumentBase

    protected SiteDocumentBase(XmlNode xmlNode)
    {
        this.Name = xmlNode.Attributes["name"].Value;
        this.Id = xmlNode.Attributes["id"].Value;

        //Note: [2015-10-28] Datasources presently don't return this information
        //        this.ContentUrl = xmlNode.Attributes["contentUrl"].Value;

        //Namespace for XPath queries
        var nsManager = XmlHelper.CreateTableauXmlNamespaceManager("iwsOnline");

        //Get the project attributes
        var projectNode = xmlNode.SelectSingleNode("iwsOnline:project", nsManager);
        this.ProjectId = projectNode.Attributes["id"].Value;
        this.ProjectName = projectNode.Attributes["name"].Value;

        //Get the owner attributes
        var ownerNode = xmlNode.SelectSingleNode("iwsOnline:owner", nsManager);
        this.OwnerId = ownerNode.Attributes["id"].Value;

        //See if there are tags
        var tagsNode = xmlNode.SelectSingleNode("iwsOnline:tags", nsManager);
        if (tagsNode != null)
        {
            this.TagsSet = new SiteTagsSet(tagsNode);
        }
    }
开发者ID:devbhosale,项目名称:TabMigrate,代码行数:27,代码来源:SiteDocumentBase.cs

示例4: LoadFromXml

	public override void LoadFromXml(XmlNode dataNode)
	{
		float time = 0f;
		
		if (dataNode.SelectSingleNode("time") != null)
		{
			float.TryParse(dataNode.SelectSingleNode("time").InnerText, System.Globalization.NumberStyles.Float, CultureInfo.InvariantCulture, out time);			
		}
		
		totalEffectTime = time;
	}
开发者ID:stevesolomon,项目名称:MicroDungeonPrototype,代码行数:11,代码来源:TimedEntityModifier.cs

示例5: Quotation

 public Quotation(XmlNode quoteNode)
 {
     if ((quoteNode.SelectSingleNode("source")) != null)
     {
         qsource = quoteNode.SelectSingleNode("source").InnerText;
     }
     if ((quoteNode.Attributes.GetNamedItem("date") != null))
     {
         date=quoteNode.Attributes.GetNamedItem("date").Value;
         quotation = quoteNode.FirstChild.InnerText;
     }
 }
开发者ID:Chunting,项目名称:Projects,代码行数:12,代码来源:Quotation.cs

示例6: OnlineMapsDirectionStep

    /// <summary>
    /// Constructor. \n
    /// <strong>Please do not use. </strong>\n
    /// Use OnlineMapsDirectionStep.TryParse.
    /// </summary>
    /// <param name="node">XMLNode of route</param>
    public OnlineMapsDirectionStep(XmlNode node)
    {
        start = node.GetLatLng("start_location");
        end = node.GetLatLng("end_location");
        duration = node.GetInt("duration/value");
        instructions = node.SelectSingleNode("html_instructions").InnerText;
        distance = node.GetInt("distance/value");

        XmlNode maneuverNode = node.SelectSingleNode("maneuver");
        if (maneuverNode != null) maneuver = maneuverNode.InnerText;
        
        XmlNode encodedPoints = node.SelectSingleNode("polyline/points");
        if (encodedPoints != null) points = OnlineMapsGoogleAPIQuery.DecodePolylinePoints(encodedPoints.InnerText);
    }
开发者ID:juliancruz87,项目名称:transpp,代码行数:20,代码来源:OnlineMapsDirectionStep.cs

示例7: LoadFromXml

	public override void LoadFromXml(XmlNode dataNode)
	{
		float moveValue = 1.0f;
		
		if (dataNode.SelectSingleNode("moveSpeedReductionFactor") != null)
		{
			float.TryParse(dataNode.SelectSingleNode("moveSpeedReductionFactor").InnerText, System.Globalization.NumberStyles.Float, 
						   CultureInfo.InvariantCulture, out moveValue);			
		}
		this.moveSpeedReductionFactor = moveValue;
		this.competitionValue = (float) (1f / moveSpeedReductionFactor);
		
		base.LoadFromXml(dataNode);
	}
开发者ID:stevesolomon,项目名称:MicroDungeonPrototype,代码行数:14,代码来源:TimedMovementModifier.cs

示例8: ProtocolHelper

 public ProtocolHelper(string protocol)
 {
     XmlDocument doc = new XmlDocument();
     doc.LoadXml(protocol);
     root = doc.DocumentElement;
     fileNode = root.SelectSingleNode("file");
 }
开发者ID:onelei,项目名称:net-cshape,代码行数:7,代码来源:ProtocolHelper.cs

示例9: Load_Player

    public BasePlayer Load_Player(string user)
    {
        //Debug.Log(Get_Random_User());
        user = user.ToLower().Replace(" ", string.Empty);
        //GameManager.instance.player = new BasePlayer();
        //GameManager.instance.player.Player_Spell_Book = new SpellBook();
        //GameManager.instance.player.Player_Spell_Inventory = new SpellInventory();
        //GameManager.instance.player.Player_Name = user;
        BasePlayer player = new BasePlayer();
        player.Player_Spell_Book = new SpellBook();
        player.Player_Spell_Inventory = new SpellInventory();
        player.Player_Name = user;

        player.Players_Summon = Load_Player_Summon(user);
        Load_Player_Spell_Inventory(user, ref player);

        spell_book_db.Load("Assets/Scripts/Grimoire/Database/SpellBookDatabase.xml");
        spell_book_root = spell_book_db.DocumentElement;
        string path = "descendant::Book[@id='" + user + "']";
        XmlNode book = spell_book_root.SelectSingleNode(path);
        if (book == null)
        {
            return null;
        }
        //Debug.Log("Spell Book Elements: " + book.ChildNodes.Count);
        foreach (XmlNode spell in book.ChildNodes)
        {
            Add_Spell(spell.InnerText, "spell_book", ref player);
        }
        return player;
    }
开发者ID:Higure27,项目名称:Grimoire,代码行数:31,代码来源:GrimoireDatabase.cs

示例10: SelectableItemEx

 public SelectableItemEx(XmlNode node, MenuElement menuElement)
 {
     XmlNode bg = node.SelectSingleNode("component");
     if (bg == null){
         Debug.Log("XXXXXXXX");
         Texture2D texture = Resources.Load("page/"+node.Attributes["src"].Value, typeof(Texture2D)) as Texture2D;
         setTexutre(texture, 1024f, 686f);
     }
     else{
         Texture2D texture = Resources.Load("page/pbg", typeof(Texture2D)) as Texture2D;
         setTexutre(texture, 1024f, 686f);
         XmlNodeList cs = bg.SelectNodes("c");
         foreach (XmlNode c in cs){
             Texture2D tex = menuElement.GetTextureById(c.Attributes["src"].Value);
             float x = float.Parse(c.Attributes["x"].Value);
             float y = float.Parse(c.Attributes["y"].Value);
             float w = float.Parse(c.Attributes["w"].Value);
             float h = float.Parse(c.Attributes["h"].Value);
             Sprite s = new Sprite(tex, w, h);
             s.x = x;
             s.y = y;
             addChild(s);
         }
     }
 }
开发者ID:meekr,项目名称:Haima,代码行数:25,代码来源:SelectableItemEx.cs

示例11: Deserialize

    public static SkillData Deserialize(XmlNode dataui, XmlNode data)
    {
        SkillData _SkillData = ScriptableObject.CreateInstance<SkillData>();
        _SkillData.Name = dataui.Attributes["name"].Value;
        _SkillData.Id = int.Parse(dataui.Attributes["id"].Value);

        //=========变量初始化
        XmlNodeList childs = data.SelectNodes("variables/var");
        foreach (XmlNode child in childs)
        {
            SharedVariable sharedVariable = ScriptableObject.CreateInstance(string.Format("Shared{0}",child.Attributes["type"].Value )) as SharedVariable;
            sharedVariable.name = child.Attributes["name"].Value;
            sharedVariable.IsShared = true;
            _SkillData.Variables.Add(sharedVariable.name,sharedVariable);
        }

        //==========模块初始化
        List<Task> list = new List<Task>();
        childs = dataui.SelectNodes("item");
        foreach (XmlNode child in childs)
        {
            string k = child.Attributes["ID"].Value;

            XmlNode k1 = data.SelectSingleNode(@"*[@id=" + k + "]");

            Task tk = DeserializeTask(child, k1, _SkillData);
            list.Add(tk);

        }
        _SkillData.Datas = list;
        return _SkillData;
    }
开发者ID:webconfig,项目名称:Design,代码行数:32,代码来源:DeserializeXml.cs

示例12: RemoveElement

    public bool RemoveElement(string elementKey)
    {
        try
        {
            XmlDocument cfgDoc = new XmlDocument();

            LoadConfigDoc(cfgDoc);

            // retrieve the appSettings node

            m_Node = cfgDoc.SelectSingleNode("//appSettings");

            if (m_Node == null)
            {
                throw new InvalidOperationException("appSettings section not found");
            }

            // XPath select setting "add" element that contains this key to remove

            m_Node.RemoveChild(m_Node.SelectSingleNode(string.Format("//add[@key='{0}']", elementKey)));

            SaveConfigDoc(cfgDoc, m_DocName);

            return true;
        }

        catch
        {
            return false;
        }
    }
开发者ID:webgrid,项目名称:WebGrid,代码行数:31,代码来源:Xml.cs

示例13: setPos

 private void setPos(GameObject toSet, XmlNode theirData)
 {
     XmlNode position = theirData.SelectSingleNode(POSITION);
     if (position != null) {
         toSet.transform.position = MathData.GetVector(position);
     }
     toSet.transform.parent = gameObject.transform;
 }
开发者ID:CalPolyGameDevelopment,项目名称:ettell,代码行数:8,代码来源:LaserPlumber.cs

示例14: RGBTreePreviewDialog

    public RGBTreePreviewDialog(XmlNode setupNode, IList<Channel> channels)
    {
        InitializeComponent();

        if (null == setupNode || null == setupNode.Attributes || null == setupNode.Attributes["from"] ||
            null == setupNode.SelectNodes("Channels/Channel")) {
            throw new NullReferenceException("setupNode has a null value in a non-null field");
        }

        Width = ParseNode(setupNode.SelectSingleNode("Settings/Width"), Screen.PrimaryScreen.WorkingArea.Width);
        Height = ParseNode(setupNode.SelectSingleNode("Settings/Height"), Screen.PrimaryScreen.WorkingArea.Width);
        _drawSize = ParseNode(setupNode.SelectSingleNode("Settings/PixelSize"), DrawSizeDefault);

        ClientSize = new Size(Width, Height);
        pictureBox.Size = new Size(Width, Height);

        // Checked above stupid resharper.
        // ReSharper disable once PossibleNullReferenceException
        var startChannel = int.Parse(setupNode.Attributes["from"].Value) - 1;
        _channelDictionary = new Dictionary<int, List<uint>>();

        // Checked above stupid resharper.
        // ReSharper disable once PossibleNullReferenceException
        foreach (XmlNode xmlNode in setupNode.SelectNodes("Channels/Channel")) {
            if (xmlNode.Attributes == null) {
                continue;
            }

            var channelNumber = Convert.ToInt32(xmlNode.Attributes["number"].Value);

            if (channelNumber < startChannel) {
                continue;
            }

            var outputChannel = new List<uint>();
            var encodedChannelData = Convert.FromBase64String(xmlNode.InnerText);

            var startIndex = 0;
            while (startIndex < encodedChannelData.Length) {
                outputChannel.Add(BitConverter.ToUInt32(encodedChannelData, startIndex));
                startIndex += 4;
            }
            _channelDictionary[channels[channelNumber - startChannel].OutputChannel] = outputChannel;
        }
    }
开发者ID:jmcadams,项目名称:vplus,代码行数:45,代码来源:RGBTreePreviewDialog.cs

示例15: setPos

 private void setPos(GameObject toSet, XmlNode theirData)
 {
     XmlNode position = theirData.SelectSingleNode(XmlUtilities.position);
     if (position != null) {
         float[] coords = XmlUtilities.getPosition(position);
         toSet.transform.position = new Vector3(coords[0], coords[1], coords[2]);
     }
     toSet.transform.parent = gameObject.transform;
 }
开发者ID:foxor2,项目名称:attell,代码行数:9,代码来源:LaserPlumber.cs


注:本文中的XmlNode.SelectSingleNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。