Exemple #1
0
        /// <summary>
        /// This is the CSV item constructor.
        /// </summary>
        /// <param name="item">The csv item.</param>
        public Agency(CSVRowItem item)
        {
            mAgencyID = item["agency_id"];

            mName = item.ValidateNotEmptyOrNull("agency_name");
            mUrl = new Uri(item.ValidateNotEmptyOrNull("agency_url"));
            mTimeZone = item.ValidateNotEmptyOrNull("agency_timezone");

            mLang = item["agency_lang"];
            mPhone = item["agency_phone"];
        }
Exemple #2
0
        /// <summary>
        /// This is the CSV item constructor.
        /// </summary>
        /// <param name="item">The csv item.</param>
        public Agency(CSVRowItem item)
        {
            mAgencyID = item["agency_id"];

            mName     = item.ValidateNotEmptyOrNull("agency_name");
            mUrl      = new Uri(item.ValidateNotEmptyOrNull("agency_url"));
            mTimeZone = item.ValidateNotEmptyOrNull("agency_timezone");

            mLang  = item["agency_lang"];
            mPhone = item["agency_phone"];
        }
Exemple #3
0
        public FareAttribute(CSVRowItem item)
        {
            mFareID = item.ValidateNotEmptyOrNull("fare_id");
            mPrice = decimal.Parse(item["price"]);
            mCurrencyType = item.ValidateNotEmptyOrNull("currency_type");

            mPaymentMethod = item["payment_method"].ToPaymentMethodType();
            mTransfers = item["transfers"].ToTransferType();

            int tDur;
            mTransferDuration = int.TryParse(item["transfer_duration"], out tDur) ? tDur : (int?)null;
        }
Exemple #4
0
        public FareAttribute(CSVRowItem item)
        {
            mFareID       = item.ValidateNotEmptyOrNull("fare_id");
            mPrice        = decimal.Parse(item["price"]);
            mCurrencyType = item.ValidateNotEmptyOrNull("currency_type");

            mPaymentMethod = item["payment_method"].ToPaymentMethodType();
            mTransfers     = item["transfers"].ToTransferType();

            int tDur;

            mTransferDuration = int.TryParse(item["transfer_duration"], out tDur) ? tDur : (int?)null;
        }
Exemple #5
0
        /// <summary>
        /// This is the csv row item constructor.
        /// </summary>
        /// <param name="item">The csv row item object to populate the structure.</param>
        public Transfer(CSVRowItem item)
        {
            //from_stop_id,to_stop_id,transfer_type,min_transfer_time

            mFromStopID = item.ValidateNotEmptyOrNull("from_stop_id");

            mToStopID = item.ValidateNotEmptyOrNull("to_stop_id");

            mTransferType = item["transfer_type"].ToTransferOptionsType();

            int minTrans;

            mMinTransferTime = int.TryParse(item["min_transfer_time"], out minTrans)?minTrans:(int?)null;
        }
Exemple #6
0
        /// <summary>
        /// The CSV item constructor.
        /// </summary>
        /// <param name="item">The CSV row item.</param>
        public Trip(CSVRowItem item)
        {
            mRouteID   = item.ValidateNotEmptyOrNull("route_id");
            mServiceID = item.ValidateNotEmptyOrNull("service_id");
            mTripID    = item.ValidateNotEmptyOrNull("trip_id");

            mHeadSign  = item["trip_headsign"];
            mShortName = item["trip_short_name"];

            mDirectionID = item["direction_id"].ToDirectionType();

            mBlockID = item["block_id"];
            mShapeID = item["shape_id"];
        }
Exemple #7
0
        /// <summary>
        /// The CSV item constructor.
        /// </summary>
        /// <param name="item">The CSV row item.</param>
        public Trip(CSVRowItem item)
        {
            mRouteID = item.ValidateNotEmptyOrNull("route_id");
            mServiceID = item.ValidateNotEmptyOrNull("service_id");
            mTripID = item.ValidateNotEmptyOrNull("trip_id");

            mHeadSign = item["trip_headsign"];
            mShortName = item["trip_short_name"];

            mDirectionID = item["direction_id"].ToDirectionType();

            mBlockID = item["block_id"];
            mShapeID = item["shape_id"];
        }
Exemple #8
0
        public Calendar(CSVRowItem item)
        {
            mServiceID = item.ValidateNotEmptyOrNull("service_id");

            mMonday = item.ValidateNotEmptyOrNull("monday") == "1";
            mTuesday = item.ValidateNotEmptyOrNull("tuesday") == "1";
            mWednesday = item.ValidateNotEmptyOrNull("wednesday") == "1";
            mThursday = item.ValidateNotEmptyOrNull("thursday") == "1";
            mFriday = item.ValidateNotEmptyOrNull("friday") == "1";
            mSaturday = item.ValidateNotEmptyOrNull("saturday") == "1";
            mSunday = item.ValidateNotEmptyOrNull("sunday") == "1";

            mDateStart = item["start_date"].ToDate();
            mDateEnd = item["end_date"].ToDate();
        }
Exemple #9
0
        /// <summary>
        /// This is the CSV row item constructor.
        /// </summary>
        /// <param name="item">The CSV row item.</param>
        public Route(CSVRowItem item)
        {
            mRouteID = item.ValidateNotEmptyOrNull("route_id");

            mAgencyID = item["agency_id"];

            mLongName  = item["route_long_name"];
            mShortName = item["route_short_name"];

            if ((mShortName == null || mShortName == "") && (mLongName == null || mLongName == ""))
            {
                throw new ArgumentException("Must specify either route_long_name or route_short_name");
            }

            if (mShortName == null || mShortName == "")
            {
                mShortName = mLongName;
            }
            else if (mLongName == null || mLongName == "")
            {
                mLongName = mShortName;
            }

            mDesc = item["route_desc"];

            mRouteType = item["route_type"].ToRouteType();

            string url = item["route_url"];

            mRouteUrl = url == null || url == ""?null:new Uri(url);

            mRouteColor     = item["route_color"];
            mRouteTextColor = item["route_text_color"];
        }
Exemple #10
0
        /// <summary>
        /// This is the CSV row item constructor.
        /// </summary>
        /// <param name="item">The CSV row item.</param>
        public Route(CSVRowItem item)
        {
            mRouteID = item.ValidateNotEmptyOrNull("route_id");

            mAgencyID = item["agency_id"];

            mLongName = item["route_long_name"];
            mShortName = item["route_short_name"];

            if ((mShortName == null || mShortName == "") && (mLongName == null || mLongName == ""))
                throw new ArgumentException("Must specify either route_long_name or route_short_name");

            if (mShortName == null || mShortName == "")
                mShortName = mLongName;
            else if (mLongName == null || mLongName == "")
                mLongName = mShortName;

            mDesc = item["route_desc"];

            mRouteType=item["route_type"].ToRouteType();

            string url = item["route_url"];
            mRouteUrl = url == null || url ==""?null:new Uri(url);

            mRouteColor = item["route_color"];
            mRouteTextColor = item["route_text_color"];
        }
Exemple #11
0
        /// <summary>
        /// This constructor sets the default values from the CSVRowItem.
        /// </summary>
        /// <param name="item">The item.</param>
        public FareRule(CSVRowItem item)
        {
            mFareID = item.ValidateNotEmptyOrNull("fare_id");

            mRouteID       = item["route_id"];
            mOriginID      = item["origin_id"];
            mDestinationID = item["destination_id"];
            mContainsID    = item["contains_id"];
        }
Exemple #12
0
        /// <summary>
        /// This constructor sets the default values from the CSVRowItem.
        /// </summary>
        /// <param name="item">The item.</param>
        public FareRule(CSVRowItem item)
        {
            mFareID = item.ValidateNotEmptyOrNull("fare_id");

            mRouteID = item["route_id"];
            mOriginID = item["origin_id"];
            mDestinationID = item["destination_id"];
            mContainsID = item["contains_id"];
        }
        /// <summary>
        /// This is the CSVRowItem constructor.
        /// </summary>
        /// <param name="item">The row item.</param>
        public CalendarDate(CSVRowItem item)
        {
            //service_id,date,exception_type
            mServiceID = item.ValidateNotEmptyOrNull("service_id");

            mDate = item["date"].ToDate();

            mExceptionType = item["exception_type"].ToCalendarExceptionType();
        }
Exemple #14
0
        /// <summary>
        /// This is the CSVRowItem constructor.
        /// </summary>
        /// <param name="item">The row item.</param>
        public CalendarDate(CSVRowItem item)
        {
            //service_id,date,exception_type
            mServiceID = item.ValidateNotEmptyOrNull("service_id");

            mDate = item["date"].ToDate();

            mExceptionType=item["exception_type"].ToCalendarExceptionType();
        }
Exemple #15
0
        public Calendar(CSVRowItem item)
        {
            mServiceID = item.ValidateNotEmptyOrNull("service_id");

            mMonday    = item.ValidateNotEmptyOrNull("monday") == "1";
            mTuesday   = item.ValidateNotEmptyOrNull("tuesday") == "1";
            mWednesday = item.ValidateNotEmptyOrNull("wednesday") == "1";
            mThursday  = item.ValidateNotEmptyOrNull("thursday") == "1";
            mFriday    = item.ValidateNotEmptyOrNull("friday") == "1";
            mSaturday  = item.ValidateNotEmptyOrNull("saturday") == "1";
            mSunday    = item.ValidateNotEmptyOrNull("sunday") == "1";

            mDateStart = item["start_date"].ToDate();
            mDateEnd   = item["end_date"].ToDate();
        }
Exemple #16
0
        /// <summary>
        /// This is the default constructor
        /// </summary>
        /// <param name="item"></param>
        public Stop(CSVRowItem item)
        {
            mID = item.ValidateNotEmptyOrNull("stop_id");

            mCode = item["stop_code"];

            mName = item.ValidateNotEmptyOrNull("stop_name");

            mDesc = item["stop_desc"];

            mLon = decimal.Parse(item["stop_lon"]);
            mLat = decimal.Parse(item["stop_lat"]);

            mZoneID = item["zone_id"];

            string uri = item["stop_url"];

            mUrl = (uri == null || uri == "") ? (Uri)null : new Uri(uri);

            mLocationType = item["location_type"].ToLocationType();

            mParentStation = item["parent_station"];
        }
Exemple #17
0
        /// <summary>
        /// This is the default constructor
        /// </summary>
        /// <param name="item"></param>
        public Stop(CSVRowItem item)
        {
            mID = item.ValidateNotEmptyOrNull("stop_id");

            mCode = item["stop_code"];

            mName = item.ValidateNotEmptyOrNull("stop_name");

            mDesc = item["stop_desc"];

            mLon = decimal.Parse(item["stop_lon"]);
            mLat = decimal.Parse(item["stop_lat"]);

            mZoneID = item["zone_id"];

            string uri = item["stop_url"];
            mUrl = (uri == null || uri == "") ? (Uri)null : new Uri(uri);

            mLocationType = item["location_type"].ToLocationType();

            mParentStation = item["parent_station"];
        }