/// <summary>
            /// Creates <see cref="DiskspaceOverusageRow"/> using <see cref="PackageInfo"/> information.
            /// </summary>
            /// <param name="report">Current <see cref="OverusageReport"/></param>
            /// <param name="packageInfo">Hosting Space information.</param>
            /// <returns><see cref="DiskspaceOverusageRow"/> instance.</returns>
            /// <exception cref="ArgumentNullException">When <paramref name="report"/> or <paramref name="packageInfo"/> is null.</exception>
            public static DiskspaceOverusageRow CreateFromPackageInfo(OverusageReport report, PackageInfo packageInfo)
            {
                if (report == null)
                {
                    throw new ArgumentNullException("report");
                }
                if (packageInfo == null)
                {
                    throw new ArgumentNullException("packageInfo");
                }

                DiskspaceOverusageRow row = report.DiskspaceOverusage.NewDiskspaceOverusageRow();

                row.HostingSpaceId = packageInfo.PackageId;
                row.Allocated      = packageInfo.DiskSpaceQuota;
                row.Used           = packageInfo.DiskSpace;
                row.Usage          = (row.Used - row.Allocated);

                return(row);
            }
            /// <summary>
            /// Creates <see cref="DiskspaceOverusageRow"/> from Hosting Space row.
            /// </summary>
            /// <param name="report">Current <paramref name="OverusageReport"/></param>
            /// <param name="hostingSpaceRow"><see cref="DataRow"/> containing Hosting Space information.</param>
            /// <returns><see cref="DiskspaceOverusageRow"/> instance.</returns>
            /// <exception cref="ArgumentNullException">When <paramref name="report"/> or <paramref name="hostingSpaceRow"/> is null.</exception>
            public static DiskspaceOverusageRow CreateFromHostingSpacesRow(OverusageReport report, DataRow hostingSpaceRow)
            {
                if (report == null)
                {
                    throw new ArgumentNullException("report");
                }
                if (hostingSpaceRow == null)
                {
                    throw new ArgumentNullException("hostingSpaceRow");
                }

                DiskspaceOverusageRow row = report.DiskspaceOverusage.NewDiskspaceOverusageRow();

                row.HostingSpaceId = OverusageReportUtils.GetLongValueOrDefault(hostingSpaceRow["PackageID"].ToString(), 0);
                row.Allocated      = OverusageReportUtils.GetLongValueOrDefault(hostingSpaceRow["QuotaValue"].ToString(), 0);
                row.Used           = OverusageReportUtils.GetLongValueOrDefault(hostingSpaceRow["Diskspace"].ToString(), 0);
                row.Usage          = (row.Used - row.Allocated);

                return(row);
            }
 public DiskspaceOverusageRowChangeEvent(DiskspaceOverusageRow row, global::System.Data.DataRowAction action) {
     this.eventRow = row;
     this.eventAction = action;
 }
 public void RemoveDiskspaceOverusageRow(DiskspaceOverusageRow row) {
     this.Rows.Remove(row);
 }
 public void AddDiskspaceOverusageRow(DiskspaceOverusageRow row) {
     this.Rows.Add(row);
 }