Need help understanding some code

Posted on 2009-02-08
Last Modified: 2012-05-06
Can someone help me to figure out some code that I am maintaining. I have cut and pasted a portion of the code below. And then cut and pasted the code to which it is referring. So please look at line 9 below. They create this object named "filterState" that they seem to be associating with controls on a web form. What is going on here? If I look at the class that "filterState" derives from(ClientAlertFilterState), then it looks like they are dong something will cookies that I don't understand. If anyone can make clear sense of the code, I would appreciate it.

1namespace FreefallNet.Web.Controls.Filters


3    public partial class ClientGeneralFilter : BaseFilter

4    {

5        [Injectable]

6        protected IClientService ClientService { get; set; }


9        private readonly ClientAlertFilterState filterState = new ClientAlertFilterState();

10        protected DropDownList category, status, severityType, alertType;

11        protected CalendarDatePicker dateFrom, dateTo;

12        protected CheckBox confirmed;

13        protected override FilterState FilterState

14        {

15            get { return filterState; }

16        }


18        protected override FilterExpandableGroup FilterExpandableGroup

19        {

20           get { return filterAlerts; }

21        }

22        public int? Category { get { return GetIntValue(filterState.CategoryFilter); } }


24        public int? Status { get { return GetIntValue(filterState.StatusFilter); } }


26        public int? Alert { get { return GetIntValue(filterState.AlertTypeFilter); } }


28        public int? Severity { get { return GetIntValue(filterState.SeverityFilter); } }


30        public DateTime? DateFrom { get { return filterState.DateFromFilter; } }


32        public DateTime? DateTo { get { return filterState.DateToFilter; } }


34        public bool? Confirmed

35        {

36            get { return filterState.ConfirmedFilter; }

37        }


using System;

namespace FreefallNet.Core.View.Filters


    public class ClientAlertFilterState : FilterState


        private readonly string cookieName = "ca";

        #region Properties


        protected override string CookieName


            get { return cookieName; }


        public string CategoryFilter


            get { return GetCookieValue(cookieName, "cat"); }

            set { SetCookieValue(cookieName, "cat", value); }


        public string StatusFilter


            get { return GetCookieValue(cookieName, "stat"); }

            set { SetCookieValue(cookieName, "stat", value); }


        public string AlertTypeFilter


            get { return GetCookieValue(cookieName, "al"); }

            set { SetCookieValue(cookieName, "al", value); }


        public string SeverityFilter


            get { return GetCookieValue(cookieName, "sev"); }

            set { SetCookieValue(cookieName, "sev", value); }


        public DateTime? DateFromFilter


            get { return GetCookieValue(cookieName, "df", s => DateTime.Parse(s)); }

            set { SetCookieValue(cookieName, "df", value); }


        public DateTime? DateToFilter


            get { return GetCookieValue(cookieName, "dt", s => DateTime.Parse(s)); }

            set { SetCookieValue(cookieName, "dt", value); }


        public bool? ConfirmedFilter


            get { return GetCookieValue(cookieName, "cf", s => bool.Parse(s)); }

            set { SetCookieValue(cookieName, "cf", value); }





Open in new window

Question by:brgdotnet
    LVL 15

    Accepted Solution

    It looks like you just pasted the constructors for the public properties, but no functions.  My guess is it is just creating a cookie with the name "ca", and setting the properties of that cookie.
    LVL 2

    Author Comment

    Well could you look again, because actually I pasted into the snippet sections of code from two different files. See my line seperator above on line 37.


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now