Esempio n. 1
0
        private static GridRowContent BuildGridRowContent(IPreparedTransfer transfer, IPreparedTransferSettings transferSettings)
        {
            var gridRowContent = new GridRowContent(transfer.Id.ToString(), transfer);

            switch (transfer.State)
            {
            case PreparedTransferState.Failed:
                gridRowContent.BackColor          = transferSettings.FailedColor;
                gridRowContent.SelectionBackColor =
                    ColorUtility.CalculateSelectionColor(transferSettings.FailedColor);
                break;

            case PreparedTransferState.Registered:
                gridRowContent.BackColor          = Color.White;
                gridRowContent.SelectionBackColor = transferSettings.SelectionColor;
                break;

            case PreparedTransferState.Pended:
                gridRowContent.BackColor          = transferSettings.PendedColor;
                gridRowContent.SelectionBackColor =
                    ColorUtility.CalculateSelectionColor(transferSettings.PendedColor);
                break;

            case PreparedTransferState.Processed:
                gridRowContent.BackColor          = transferSettings.ProcessedColor;
                gridRowContent.SelectionBackColor =
                    ColorUtility.CalculateSelectionColor(transferSettings.ProcessedColor);
                break;

            case PreparedTransferState.Interrupted:
                gridRowContent.BackColor          = transferSettings.InterruptedColor;
                gridRowContent.SelectionBackColor =
                    ColorUtility.CalculateSelectionColor(transferSettings.InterruptedColor);
                break;

            case PreparedTransferState.Completed:
                gridRowContent.BackColor          = transferSettings.CompletedColor;
                gridRowContent.SelectionBackColor =
                    ColorUtility.CalculateSelectionColor(transferSettings.CompletedColor);
                break;
            }

            return(gridRowContent);
        }
 public PreparedTransferNotification(IPreparedTransfer preparedTransfer)
 {
     PreparedTransfer = preparedTransfer ?? throw new ArgumentNullException(nameof(preparedTransfer));
 }
 public PreparedTransferContext(TransferBundleContext baseContext, IPreparedTransfer preparedTransfer)
     : base(baseContext, baseContext.TransferBundle)
 {
     PreparedTransfer = preparedTransfer ?? throw new ArgumentNullException(nameof(preparedTransfer));
 }
 public PreparedTransferContext(PreparedTransferContext origin)
     : base(origin)
 {
     PreparedTransfer = origin.PreparedTransfer;
 }