Beispiel #1
0
        public static ResourceNote Parse(string str)
        {
            int strCnt = 0;

            ResourceNote note = new ResourceNote();

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

            strCnt = Parse(note, strSplit, strCnt);

            return(note);
        }
Beispiel #2
0
        public static int Parse(ResourceNote note, string[] strSplit, int strCnt)
        {
            note.UniqueID = Convert.ToUInt64(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++;

            note.NoteWriter.UniqueID = Convert.ToUInt64(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++;

            note.ResourceBase.UniqueID = Convert.ToUInt64(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++;

            note.Note = strSplit[strCnt]; strCnt++;

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

            return(strCnt);
        }
        public void RemoveNote(ResourceNote resourceNote)
        {
            if (!Notes.Contains(resourceNote))
            {
                throw new System.ArgumentException("Notes do not contain the requested resourceNote", "resourceNote");
            }

            Notes.Remove(resourceNote);

            OnPropertyChanged("ResourceDescription.Notes.Changed");

            if (!Notes.Contains(resourceNote))
            {
                throw new System.ArgumentException("resourceNote could not be removed from Notes", "resourceNote");
            }
        }
Beispiel #4
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");
            }

            ResourceNote resourceNote = other as ResourceNote;

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

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

            return(this.ToString().CompareTo(resourceNote.ToString()));
        }
 public void AddNote(ResourceNote resourceNote)
 {
     Notes.Add(resourceNote);
     OnPropertyChanged("ResourceDescription.Notes.Changed");
 }