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


C# Route.CreateRouteXML方法代码示例

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


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

示例1: CreateRoutesList

        /// <summary>
        /// Accesses DB and creates Routes List.
        /// Routes created by users.
        /// </summary>
        /// <param name="userID">The user of the routes to get</param>
        /// <param name="siteID">Site of the routes</param>
        /// <param name="skip">number of routes to skip</param>
        /// <param name="show">number to show</param>
        /// <param name="showPrivate">Indicates whether private routes should be included.</param>
        /// <returns>Whether created ok</returns>
        public bool CreateRoutesList(int userID, int siteID, int skip, int show, bool showPrivate)
        {
            // check object is not already initialised
            if (userID <= 0 || show <= 0)
            {
                return false;
            }

            XmlElement list = AddElementTag(RootElement, "ROUTES-LIST");
            AddAttribute(list, "SKIP", skip);
            AddAttribute(list, "SHOW", show);

            using (IDnaDataReader dataReader = InputContext.CreateDnaDataReader("getmoreroutes"))
            {
                dataReader.AddParameter("userid", userID);
                dataReader.AddParameter("siteid", InputContext.CurrentSite.SiteID);

                // Get +1 so we know if there are more left
                dataReader.AddParameter("skip", skip);
                dataReader.AddParameter("show", show + 1);

                dataReader.Execute();

                if (dataReader.HasRows)
                {
                    //1st Result set gets user details.
                    if (dataReader.Read())
                    {
                        User user = new User(InputContext);
                        user.AddUserXMLBlock(dataReader, userID, list);
                        dataReader.NextResult();
                    }

                    //Paged List of Routes.
                    int count = 0;
                    if (dataReader.HasRows)
                    {
                        while (dataReader.Read() && count < show)
                        {
                            Route route = new Route(InputContext);
                            //Delegate creation of XML to Route class.
                            route.CreateRouteXML(dataReader, false);
                            AddInside(list, route);
                            ++count;
                        }
                    }

                    // Add More Attribute Indicating there are more rows.
                    if (dataReader.Read() && count > 0)
                    {
                        AddAttribute(list, "MORE", 1);
                    }
                }
            }
            return true;
        }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:66,代码来源:RoutesList.cs

示例2: GenerateMangeRouteXml

        /// <summary>
        /// Generates the XML for the Route
        /// </summary>
        /// <param name="dataReader">The recordset of location data</param>
        /// <param name="action">The action to apply to the route.</param>
        private void GenerateMangeRouteXml(IDnaDataReader dataReader, string action)
        {
            XmlElement routePageXML = AddElementTag(RootElement, "ROUTEPAGE");

            if (dataReader.HasRows)
            {
                if (dataReader.Read())
                {
                    Route route = new Route(InputContext);
                    route.CreateRouteXML(dataReader, true);
                    AddInside(routePageXML, route);
                }
            }
        }
开发者ID:rocketeerbkw,项目名称:DNA,代码行数:19,代码来源:ManageRoute.cs


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