Esempio n. 1
0
 public EventBase() :
     base(
         0,
         new UserBase(),
         new ResourceDescription())
 {
     mEventTimeInfo = new EventTimeInfo(0, DateTime.Now);
 }
Esempio n. 2
0
 public EventBase(UInt64 uniqueID, UserBase adminUser) :
     base(
         uniqueID,
         adminUser,
         new ResourceDescription(uniqueID))
 {
     mEventTimeInfo = new EventTimeInfo(uniqueID, DateTime.Now);
 }
Esempio n. 3
0
        public static int Parse(EventTimeInfo eventTimeInfo, string[] strSplit, int strCnt)
        {
            eventTimeInfo.UniqueID = Convert.ToUInt64(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++;

            eventTimeInfo.CreationTime = new DateTime(Convert.ToInt64(strSplit[strCnt] == null ? "0" : strSplit[strCnt])); strCnt++;

            eventTimeInfo.BecomeActive = new DateTime(Convert.ToInt64(strSplit[strCnt] == null ? "0" : strSplit[strCnt])); strCnt++;

            eventTimeInfo.BecomeInactive = new DateTime(Convert.ToInt64(strSplit[strCnt] == null ? "0" : strSplit[strCnt])); strCnt++;

            return(strCnt);
        }
Esempio n. 4
0
        public static EventTimeInfo Parse(string str)
        {
            int strCnt = 0;

            EventTimeInfo eventTimeInfo = new EventTimeInfo();

            string[] strSplit = null;
            strSplit = str.Split(new char[] { ';' });

            strCnt = Parse(eventTimeInfo, strSplit, strCnt);

            return(eventTimeInfo);
        }
Esempio n. 5
0
        public override string ToString()
        {
            if (IsNull)
            {
                throw new System.ArgumentException("ToString failed, this is null or not loaded", "this");
            }
            else
            {
                string retStr = base.ToString();

                if (EventParent == null)
                {
                    retStr += mDelim + "0";
                }
                else
                {
                    retStr += mDelim + EventParent.UniqueID.ToString();
                }

                retStr += mDelim + EventChildren.Count.ToString();
                for (int i = 0; i < EventChildren.Count; i++)
                {
                    retStr += mDelim + EventChildren[i].UniqueID.ToString();
                }

                retStr += mDelim + ItemChildren.Count.ToString();
                for (int i = 0; i < ItemChildren.Count; i++)
                {
                    retStr += mDelim + ItemChildren[i].UniqueID.ToString();
                }

                retStr += mDelim + EventTimeInfo.ToString();

                retStr += mDelim + EventLocation.ToString();

                retStr += mDelim + IsPublic.ToString();

                retStr += mDelim + PrivacyType.ToString();

                return(retStr);
            }
        }
Esempio n. 6
0
        // Exceptions:
        //	System.ArgumentException:
        //		Other object is null
        //		The argument to compare is not a UserBase
        //		Refering object (this) is null
        public override int CompareTo(object other)
        {
            if (other == null)
            {
                throw new System.ArgumentException("Other object is null", "other");
            }

            EventTimeInfo eventTimeInfo = other as EventTimeInfo;

            if (eventTimeInfo == null)
            {
                throw new System.ArgumentException("The argument to compare is not a eventTimeInfo", "other");
            }

            if (IsNull)// || (!IsLoaded()))
            {
                throw new System.ArgumentException("Refering object (this) is null", "this");
            }

            return(this.ToString().CompareTo(eventTimeInfo.ToString()));
        }
Esempio n. 7
0
        public static int Parse(EventBase eventBase, string[] strSplit, int strCnt)
        {
            int count = 0;

            UInt64 eventParentUniqueID = Convert.ToUInt64(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++;

            if (eventParentUniqueID != 0)
            {
                eventBase.EventParent = new EventBase(eventParentUniqueID);
            }

            count = Convert.ToInt32(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++;
            for (int i = 0; i < count; i++)
            {
                if (strSplit[strCnt] == null)
                {
                    break;
                }
                eventBase.EventChildren.Add(new EventBase(Convert.ToUInt64(strSplit[strCnt]))); strCnt++;
            }

            count = Convert.ToInt32(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++;
            for (int i = 0; i < count; i++)
            {
                if (strSplit[strCnt] == null)
                {
                    break;
                }
                eventBase.ItemChildren.Add(new ItemBase(Convert.ToUInt64(strSplit[strCnt]))); strCnt++;
            }

            strCnt = EventTimeInfo.Parse(eventBase.EventTimeInfo, strSplit, strCnt);

            strCnt = ObjectLocation.Parse(eventBase.EventLocation, strSplit, strCnt);

            eventBase.IsPublic = Convert.ToBoolean(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++;

            return(strCnt);
        }