public static ResourceImage Parse(string str) { int strCnt = 0; ResourceImage image = new ResourceImage(); string[] strSplit = null; strSplit = str.Split(new char[] { ';' }); strCnt = Parse(image, strSplit, strCnt); return(image); }
public static int Parse(ResourceImage image, string[] strSplit, int strCnt) { image.UniqueID = Convert.ToUInt64(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++; image.ImageOwner.UniqueID = Convert.ToUInt64(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++; image.ResourceBase.UniqueID = Convert.ToUInt64(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++; image.ImageLocation = strSplit[strCnt]; strCnt++; image.EntryDate = new DateTime(Convert.ToInt64(strSplit[strCnt] == null ? "0" : strSplit[strCnt])); strCnt++; return(strCnt); }
public void RemoveImage(ResourceImage resourceImage) { if (!Images.Contains(resourceImage)) { throw new System.ArgumentException("Images do not contain the requested resourceImage", "resourceImage"); } Images.Remove(resourceImage); OnPropertyChanged("ResourceDescription.Images.Changed"); if (!Images.Contains(resourceImage)) { throw new System.ArgumentException("resourceImage could not be removed from Images", "resourceImage"); } }
// 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"); } ResourceImage resourceImage = other as ResourceImage; if (resourceImage == null) { throw new System.ArgumentException("The argument to compare is not a resourceImage", "other"); } if (IsNull)// || (!IsLoaded())) { throw new System.ArgumentException("Refering object (this) is null", "this"); } return(this.ToString().CompareTo(resourceImage.ToString())); }
public void AddImage(ResourceImage resourceImage) { Images.Add(resourceImage); OnPropertyChanged("ResourceDescription.Images.Changed"); }