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


C# SiteMapDataAttribute.AddRange方法代码示例

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


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

示例1: Page_Load

    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Events", Request, "AccountEventsToday.aspx"));

            if (RequestId > 0)
            {
                TransitAccountEvent evt = SessionManager.EventService.GetAccountEventById(
                    SessionManager.Ticket, RequestId, SessionManager.UtcOffset.Ticks);

                this.Title = string.Format("{0} Pictures", Renderer.Render(evt.Name));
                listView.DataSource = SessionManager.EventService.GetAccountEventPictures(
                    SessionManager.Ticket, RequestId, null);
                listView.DataBind();

                sitemapdata.AddRange(SiteMapDataAttribute.GetLocationAttributeNodes(Request, "AccountEventsToday.aspx", evt.PlaceCountry, evt.PlaceState, evt.PlaceCity, evt.PlaceNeighborhood, evt.AccountEventType));
                sitemapdata.Add(new SiteMapDataAttributeNode(evt.Name, Request, string.Format("AccountEventView.aspx?id={0}", evt.Id)));
                sitemapdata.Add(new SiteMapDataAttributeNode("Pictures", Request.Url));
            }

            StackSiteMap(sitemapdata);
        }
    }
开发者ID:dblock,项目名称:sncore,代码行数:25,代码来源:AccountEventPicturesView.aspx.cs

示例2: Page_Load

    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (RequestId == 0)
            {
                throw new Exception("Missing place merge request.");
            }

            TransitPlaceChangeRequest request = SessionManager.PlaceService.GetPlaceChangeRequestById(
                SessionManager.Ticket, RequestId);

            TransitPlace place = SessionManager.PlaceService.GetPlaceById(
                SessionManager.Ticket, request.PlaceId);

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Places", Request, "PlacesView.aspx"));
            sitemapdata.AddRange(SiteMapDataAttribute.GetLocationAttributeNodes(Request, "PlacesView.aspx", place.Country, place.State, place.City, place.Neighborhood, place.Type));
            sitemapdata.Add(new SiteMapDataAttributeNode(place.Name, Request, string.Format("PlaceView.aspx?id={0}", place.Id)));
            sitemapdata.Add(new SiteMapDataAttributeNode("Merge Changes", Request.Url));
            StackSiteMap(sitemapdata);

            Title = labelName.Text = string.Format("{0}: Merge Changes", Renderer.Render(place.Name));
            linkBack.NavigateUrl = string.Format("PlaceChangeRequestsManage.aspx?id={0}", place.Id);

            AddListItem(place.Name, request.Name, selectName);
            AddListItem(place.Type, request.Type, selectType);
            AddListItem(place.Description, request.Description, selectDescription);
            AddListItem(place.Country, request.Country, selectCountry);
            AddListItem(place.State, request.State, selectState);
            AddListItem(place.City, request.City, selectCity);
            AddListItem(place.Neighborhood, request.Neighborhood, selectNeighborhood);
            AddListItem(place.Phone, request.Phone, selectPhone);
            AddListItem(place.Fax, request.Fax, selectFax);
            AddListItem(place.Street, request.Street, selectStreet);
            AddListItem(place.Zip, request.Zip, selectZip);
            AddListItem(place.CrossStreet, request.CrossStreet, selectCrossStreet);
            AddListItem(place.Email, request.Email, selectEmail);
        }

        SetDefaultButton(merge);
    }
开发者ID:dblock,项目名称:sncore,代码行数:42,代码来源:PlaceChangeRequestMerge.aspx.cs

示例3: Page_Load

    public void Page_Load(object sender, EventArgs e)
    {
        picturesView.OnGetDataSource += new EventHandler(picturesView_OnGetDataSource);

        if (!IsPostBack)
        {
            mPictureId = RequestId;
            GetPictureData(sender, e);
            GetPicturesData(sender, e);

            TransitPlace p = Place;
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Places", Request, "PlacesView.aspx"));
            sitemapdata.AddRange(SiteMapDataAttribute.GetLocationAttributeNodes(Request, "PlacesView.aspx", p.Country, p.State, p.City, p.Neighborhood, p.Type));
            sitemapdata.Add(new SiteMapDataAttributeNode(p.Name, Request, string.Format("PlaceView.aspx?id={0}", p.Id)));
            sitemapdata.Add(new SiteMapDataAttributeNode("Pictures", Request.Url));
            StackSiteMap(sitemapdata);
        }

    }
开发者ID:dblock,项目名称:sncore,代码行数:20,代码来源:PlacePictureView.aspx.cs

示例4: Page_Load

    public void Page_Load(object sender, EventArgs e)
    {
        picturesView.OnGetDataSource += new EventHandler(picturesView_OnGetDataSource);
        if (!IsPostBack)
        {
            mPictureId = RequestId;
            GetPictureData(sender, e);
            GetPicturesData(sender, e);

            TransitAccountEvent t = AccountEvent;
            TransitAccountEventPicture p = AccountEventPicture;

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Events", Request, "AccountEventsView.aspx"));
            sitemapdata.AddRange(SiteMapDataAttribute.GetLocationAttributeNodes(Request, "AccountEventsToday.aspx", t.PlaceCountry, t.PlaceState, t.PlaceCity, t.PlaceNeighborhood, t.AccountEventType));
            sitemapdata.Add(new SiteMapDataAttributeNode(t.Name, Request, string.Format("AccountEventView.aspx?id={0}", t.Id)));
            sitemapdata.Add(new SiteMapDataAttributeNode("Pictures", Request.Url));
            StackSiteMap(sitemapdata);
        }

    }
开发者ID:dblock,项目名称:sncore,代码行数:21,代码来源:AccountEventPictureView.aspx.cs

示例5: Page_Load

    public void Page_Load(object sender, EventArgs e)
    {
        gridManage.OnGetDataSource += new EventHandler(gridManage_OnGetDataSource);

        if (!IsPostBack)
        {
            TransitPlace place = SessionManager.PlaceService.GetPlaceById(
                SessionManager.Ticket, RequestId);

            labelTitle.Text = Title = string.Format("{0}: Change Requests", Renderer.Render(place.Name));
            linkBack.NavigateUrl = string.Format("PlaceView.aspx?id={0}", place.Id);

            GetData(sender, e);

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Places", Request, "PlacesView.aspx"));
            sitemapdata.AddRange(SiteMapDataAttribute.GetLocationAttributeNodes(Request, "PlacesView.aspx", place.Country, place.State, place.City, place.Neighborhood, place.Type));
            sitemapdata.Add(new SiteMapDataAttributeNode(place.Name, Request, string.Format("PlaceView.aspx?id={0}", place.Id)));
            sitemapdata.Add(new SiteMapDataAttributeNode("Change Requests", Request.Url));
            StackSiteMap(sitemapdata);
        }
    }
开发者ID:dblock,项目名称:sncore,代码行数:22,代码来源:PlaceChangeRequestsManage.aspx.cs

示例6: Page_Load

    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (RequestId > 0)
            {
                TransitAccountEvent t = AccountEvent;

                if (t == null)
                {
                    ReportWarning("Event does not exist.");
                    pnlAccountEvent.Visible = false;
                    return;
                }

                SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
                sitemapdata.Add(new SiteMapDataAttributeNode("Events", Request, "AccountEventsView.aspx"));
                sitemapdata.AddRange(SiteMapDataAttribute.GetLocationAttributeNodes(Request, "AccountEventsToday.aspx", t.PlaceCountry, t.PlaceState, t.PlaceCity, t.PlaceNeighborhood, t.AccountEventType));
                sitemapdata.Add(new SiteMapDataAttributeNode(t.Name, Request.Url));
                StackSiteMap(sitemapdata);

                picturesView.AccountEventId = RequestId;

                this.Title = Renderer.Render(t.Name);

                labelDescription.Text = base.RenderEx(t.Description);
                panelDescription.Visible = !string.IsNullOrEmpty(labelDescription.Text);
                eventName.Text = Renderer.Render(t.Name);
                eventId.Text = "#" + t.Id.ToString();

                linkEdit.NavigateUrl = string.Format("AccountEventEdit.aspx?id={0}", t.Id);

                eventWebsite.NavigateUrl = t.Website;
                if (!string.IsNullOrEmpty(t.Website))
                {
                    eventWebsite.NavigateUrl = t.Website;
                    if (t.Website.Length < 64)
                    {
                        eventWebsite.Text = Renderer.Render(t.Website);
                    }
                }

                eventWebsite.Visible = ! string.IsNullOrEmpty(t.Website);
                eventPhone.Text = Renderer.Render(t.Phone);
                eventType.Text = Renderer.Render(t.AccountEventType);
                eventEmail.NavigateUrl = string.Format("mailto:{0}", Renderer.Render(t.Email));
                eventEmail.Visible = !string.IsNullOrEmpty(t.Email);
                eventCost.Text = Renderer.Render(t.Cost);

                discussionAccountEvents.DiscussionId = SessionManager.GetCount<TransitDiscussion, string, int>(
                    typeof(AccountEvent).Name, RequestId, SessionManager.DiscussionService.GetOrCreateDiscussionId);
                discussionAccountEvents.DataBind();

                if (SessionManager.IsAdministrator)
                {
                    linkFeature.Text = (LatestAccountEventFeature != null)
                        ? string.Format("Feature &#187; Last on {0}", Adjust(LatestAccountEventFeature.Created).ToString("d"))
                        : "Feature &#187; Never Featured";
                }

                panelOwner.Visible = SessionManager.IsLoggedIn &&
                    (SessionManager.IsAdministrator || t.AccountId == SessionManager.Account.Id);

                TransitPlace pl = AccountEventPlace;
                placeImage.Src = string.Format("PlacePictureThumbnail.aspx?id={0}", pl.PictureId);
                placeLink2.HRef = placeLink.HRef = string.Format("PlaceView.aspx?id={0}", pl.Id);
                placeNeighborhood.Text = Renderer.Render(pl.Neighborhood);
                placeName.Text = Renderer.Render(pl.Name);
                placeCity.Text = Renderer.Render(pl.City);
                placeState.Text = Renderer.Render(pl.State);
                placeCountry.Text = Renderer.Render(pl.Country);

                labelSchedule.Text = Renderer.Render(t.Schedule);
            }
        }
    }
开发者ID:dblock,项目名称:sncore,代码行数:76,代码来源:AccountEventView.aspx.cs

示例7: Page_Load

    public void Page_Load(object sender, EventArgs e)
    {
        gridManage.OnGetDataSource += new EventHandler(gridManage_OnGetDataSource);

        LocationSelector.CountryChanged += new EventHandler(LocationSelector_CountryChanged);
        LocationSelector.StateChanged += new EventHandler(LocationSelector_StateChanged);
        LocationSelector.CityChanged += new EventHandler(LocationSelector_CityChanged);
        LocationSelector.LocationChanged += new EventHandler(LocationSelector_LocationChanged);

        ((SnCoreMasterPage)Master).ScriptManager.Navigate += new EventHandler<HistoryEventArgs>(History_Navigate);

        neighborhoods.OnChange += new EventHandler(neighborhoods_OnChange);

        if (!IsPostBack)
        {
            linkLocal.Visible = SessionManager.IsLoggedIn && !string.IsNullOrEmpty(SessionManager.Account.City);

            if (SessionManager.IsLoggedIn)
            {
                linkLocal.Text = string.Format("&#187; All {0} Places", Renderer.Render(SessionManager.Account.City));
            }

            if (SessionManager.IsLoggedIn && (Request.QueryString.Count == 0))
            {
                LocationSelector.SelectLocation(sender, new LocationWithOptionsEventArgs(SessionManager.Account));
            }
            else
            {
                if (LocationSelector.SelectLocation(sender, new LocationWithOptionsEventArgs(Request)))
                {
                    panelSearchInternal.Visible = true;
                }
            }

            GetNeighborhoodsData(sender, e);

            GetData(sender, e);

            if ((gridManage.VirtualItemCount == 0) && (Request.QueryString.Count == 0))
            {
                panelSearchInternal.Visible = false;
                LocationSelector.ClearSelection();
                GetData(sender, e);
            }

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Places", Request, "PlacesView.aspx"));
            sitemapdata.AddRange(SiteMapDataAttribute.GetLocationAttributeNodes(Request, "PlacesView.aspx", inputCountry.SelectedValue, inputState.SelectedValue, inputCity.SelectedValue, inputNeighborhood.SelectedValue, inputType.SelectedValue));
            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(search);
    }
开发者ID:dblock,项目名称:sncore,代码行数:53,代码来源:PlacesView.aspx.cs

示例8: Page_Load

    public void Page_Load(object sender, EventArgs e)
    {
        if (RequestId <= 0 && GetId("pid") == 0)
        {
            throw new Exception("Missing Place");
        }

        LocationSelector.LocationChanged += new EventHandler(LocationSelector_LocationChanged);

        if (!IsPostBack)
        {
            DomainClass cs = SessionManager.GetDomainClass("PlaceChangeRequest");
            inputName.MaxLength = cs["Name"].MaxLengthInChars;
            inputStreet.MaxLength = cs["Street"].MaxLengthInChars;
            inputZip.MaxLength = cs["Zip"].MaxLengthInChars;
            inputCrossStreet.MaxLength = cs["CrossStreet"].MaxLengthInChars;
            inputPhone.MaxLength = cs["Phone"].MaxLengthInChars;
            inputFax.MaxLength = cs["Fax"].MaxLengthInChars;
            inputEmail.MaxLength = cs["Email"].MaxLengthInChars;

            ArrayList types = new ArrayList();
            types.Add(new TransitAccountPlaceType());
            types.AddRange(SessionManager.PlaceService.GetPlaceTypes(SessionManager.Ticket, null));
            selectType.DataSource = types;
            selectType.DataBind();

            TransitPlace place = null;

            if (RequestId > 0)
            {
                TransitPlaceChangeRequest request = SessionManager.PlaceService.GetPlaceChangeRequestById(
                    SessionManager.Ticket, RequestId);
                labelName.Text = Renderer.Render(request.Name);
                inputName.Text = request.Name;
                inputDescription.Text = request.Description;
                inputCrossStreet.Text = request.CrossStreet;
                inputEmail.Text = request.Email;
                inputFax.Text = request.Fax;
                inputPhone.Text = request.Phone;
                inputStreet.Text = request.Street;
                inputZip.Text = request.Zip;
                ListItemManager.TrySelect(selectType, request.Type);
                LocationSelector.SelectLocation(sender, new LocationEventArgs(request));

                place = SessionManager.PlaceService.GetPlaceById(
                    SessionManager.Ticket, request.PlaceId);
            }
            else
            {
                place = SessionManager.PlaceService.GetPlaceById(
                    SessionManager.Ticket, PlaceId);
                labelName.Text = Renderer.Render(place.Name);
                inputName.Text = place.Name;
                inputDescription.Text = place.Description;
                inputCrossStreet.Text = place.CrossStreet;
                inputEmail.Text = place.Email;
                inputFax.Text = place.Fax;
                inputPhone.Text = place.Phone;
                inputStreet.Text = place.Street;
                inputZip.Text = place.Zip;
                ListItemManager.TrySelect(selectType, place.Type);
                LocationSelector.SelectLocation(sender, new LocationEventArgs(place));
            }

            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Places", Request, "PlacesView.aspx"));
            sitemapdata.AddRange(SiteMapDataAttribute.GetLocationAttributeNodes(Request, "PlacesView.aspx", place.Country, place.State, place.City, place.Neighborhood, place.Type));
            sitemapdata.Add(new SiteMapDataAttributeNode(place.Name, Request, string.Format("PlaceView.aspx?id={0}", place.Id)));
            sitemapdata.Add(new SiteMapDataAttributeNode("Request Changes", Request.Url));
            StackSiteMap(sitemapdata);

            linkBack.NavigateUrl = (RequestId > 0 ? 
                string.Format("AccountPlaceChangeRequestsManage.aspx?id={0}", RequestId)
                : string.Format("PlaceView.aspx?id={0}", place.Id));
        }

        if (!SessionManager.HasVerified())
        {
            ReportWarning("You don't have any verified e-mail addresses and/or profile photos.\n" +
                "You must add/confirm a valid e-mail address and upload a profile photo before editing places.");

            save.Enabled = false;
        }

        LocationSelector_LocationChanged(sender, e);
        SetDefaultButton(save);
    }
开发者ID:dblock,项目名称:sncore,代码行数:87,代码来源:PlaceChangeRequestEdit.aspx.cs

示例9: Page_Load

    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (RequestId > 0)
            {
                TransitPlace place = Place;
                TransitAccount account = PlaceAccount;

                if (place == null)
                {
                    ReportWarning("Place does not exist.");
                    panelPlace.Visible = false;
                    return;
                }

                SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
                sitemapdata.Add(new SiteMapDataAttributeNode("Places", Request, "PlacesView.aspx"));
                sitemapdata.AddRange(SiteMapDataAttribute.GetLocationAttributeNodes(Request, "PlacesView.aspx", place.Country, place.State, place.City, place.Neighborhood, place.Type));
                sitemapdata.Add(new SiteMapDataAttributeNode(place.Name, Request.Url));
                StackSiteMap(sitemapdata);

                groups.PlaceId = RequestId;

                Title = Renderer.Render(string.Format("{0}, {1}", place.Name, place.City));

                MetaDescription.Content = string.Format("Get photos, information and reviews on {0} and other places in {1} on {2}.",
                    Renderer.Render(place.Name),
                    Renderer.Render(place.City),
                    Renderer.Render(SessionManager.GetCachedConfiguration("SnCore.Title", "SnCore")));

                placeType.NavigateUrl =
                    string.Format("PlacesView.aspx?city={0}&state={1}&country={2}&neighborhood={3}&type={4}",
                        Renderer.UrlEncode(place.City),
                        Renderer.UrlEncode(place.State),
                        Renderer.UrlEncode(place.Country),
                        Renderer.UrlEncode(place.Neighborhood),
                        Renderer.UrlEncode(place.Type));

                placeNeighborhood.NavigateUrl =
                    string.Format("PlacesView.aspx?city={0}&state={1}&country={2}&neighborhood={3}",
                        Renderer.UrlEncode(place.City),
                        Renderer.UrlEncode(place.State),
                        Renderer.UrlEncode(place.Country),
                        Renderer.UrlEncode(place.Neighborhood));

                placeCity.NavigateUrl =
                    string.Format("PlacesView.aspx?city={0}&state={1}&country={2}",
                        Renderer.UrlEncode(place.City),
                        Renderer.UrlEncode(place.State),
                        Renderer.UrlEncode(place.Country));

                placeState.NavigateUrl =
                    string.Format("PlacesView.aspx?state={0}&country={1}",
                        Renderer.UrlEncode(place.State),
                        Renderer.UrlEncode(place.Country));

                placeCountry.NavigateUrl =
                    string.Format("PlacesView.aspx?country={0}",
                        Renderer.UrlEncode(place.Country));

                linkDirections.HRef = DrivingDirectionsUrl;
                linkAdd.NavigateUrl =
                    string.Format("PlaceEdit.aspx?city={0}&state={1}&country={2}&neighborhood={3}&type={4}",
                        Renderer.UrlEncode(place.City),
                        Renderer.UrlEncode(place.State),
                        Renderer.UrlEncode(place.Country),
                        Renderer.UrlEncode(place.Neighborhood),
                        Renderer.UrlEncode(place.Type));

                placeAccounts.PlaceId = RequestId;
                placeAccountEvents.PlaceId = RequestId;
                placeFriends.PlaceId = RequestId;
                attributesView.PlaceId = RequestId;
                picturesView.PlaceId = RequestId;

                labelDescription.Text = base.RenderEx(place.Description);
                panelDescription.Visible = !string.IsNullOrEmpty(labelDescription.Text);
                placeName.Text = Renderer.Render(place.Name);
                placeId.Text = string.Format("#{0}", place.Id);

                linkManagePictures.NavigateUrl = string.Format("PlacePicturesManage.aspx?id={0}", place.Id);

                linkClaimOwnership.Visible = !place.CanWrite;
                linkClaimOwnership.NavigateUrl = string.Format("AccountPlaceRequestEdit.aspx?pid={0}", place.Id);

                linkPlaceChangeRequestEdit.Visible = ! place.CanWrite;
                linkPlaceChangeRequestEdit.NavigateUrl = string.Format("PlaceChangeRequestEdit.aspx?pid={0}", place.Id);

                if (account != null)
                {
                    linkAddedBy.Text = Renderer.Render(account.Name);
                    linkAddedBy.NavigateUrl = string.Format("AccountView.aspx?id={0}", account.Id);
                }
                else
                {
                    linkAddedBy.Text = "a deleted user";
                }

                labelAddedOn.Text = Adjust(place.Created).ToString("d");
//.........这里部分代码省略.........
开发者ID:dblock,项目名称:sncore,代码行数:101,代码来源:PlaceView.aspx.cs


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