Exemplo n.º 1
0
    private void setPositionByErrorPositionEnum(ErrorDirection errorDirection, RectTransform targetRT, float centerOffset)
    {
        Vector2 v   = targetRT.position;
        float   num = centerOffset / 100f;

        switch (errorDirection)
        {
        case ErrorDirection.DOWN:
            v.y += (0f - targetRT.rect.height) * num / 2f - rectTransform.rect.height / 2f;
            break;

        case ErrorDirection.RIGHT:
            v.x += targetRT.rect.width * num / 2f + rectTransform.rect.width / 2f;
            break;

        case ErrorDirection.LEFT:
            v.x += (0f - targetRT.rect.width) * num / 2f - rectTransform.rect.width / 2f;
            break;

        case ErrorDirection.UP:
            v.y += targetRT.rect.height * num / 2f + rectTransform.rect.height / 2f;
            break;
        }
        rectTransform.position = v;
    }
Exemplo n.º 2
0
 public ShowErrorOnTransformCommand(string errorId, ErrorDirection errorDirection, RectTransform targetRT, RectTransform parentContainer, float centerOffset = 100f)
 {
     this.errorId         = errorId;
     this.errorDirection  = errorDirection;
     this.targetRT        = targetRT;
     this.parentContainer = parentContainer;
     this.centerOffset    = centerOffset;
 }
Exemplo n.º 3
0
 public void ShowErrorMessage(string message, ErrorDirection errorDirection, RectTransform targetRT, float centerOffset = 100f)
 {
     setErrorText(message);
     setPositionByErrorPositionEnum(errorDirection, targetRT, centerOffset);
     if (errorDirection != 0)
     {
         setErrorArrow(errorDirection);
     }
 }
Exemplo n.º 4
0
        private async Task ProcessWithPercentExpired(int percentExpired, ErrorDirection errorDirection)
        {
            var countExpired = BatchSizeGoverningBehaviour.MinimumMessageHistoryKept * percentExpired / 100.0;

            var countExpiredInteger = (int)(errorDirection == ErrorDirection.EnsureAtMost ? Math.Floor(countExpired) : Math.Ceiling(countExpired));
            var countSafe           = BatchSizeGoverningBehaviour.MinimumMessageHistoryKept - countExpiredInteger;

            await Process(countSafe, IncomingMessageBuilder.BuildDefault).ConfigureAwait(false);
            await Process(countExpiredInteger, IncomingMessageBuilder.BuildExpired).ConfigureAwait(false);
        }
Exemplo n.º 5
0
    private void setErrorArrow(ErrorDirection errorDirection)
    {
        SetErrorArrow component = GetComponent <SetErrorArrow>();

        if (component != null)
        {
            component.SetArrowByDirection(errorDirection);
            return;
        }
        throw new Exception("The prefab is missing the SetErrorArrow component.");
    }
Exemplo n.º 6
0
        /// <summary>
        /// Show a balloon tip to notify an error condition to the user
        /// </summary>
        /// <param name="type">Which kind of error occourred.</param>
        internal void NotifyError(ErrorNotificationType type, ErrorDirection direction)
        {
            string sendingOrReceiving = "";

            switch (direction)
            {
            case ErrorDirection.Sending:
                sendingOrReceiving = "durante l'invio";
                break;

            case ErrorDirection.Receiving:
                sendingOrReceiving = "durante la ricezione";
                break;
            }

            switch (type)
            {
            case ErrorNotificationType.Receiving:
                notifyIcon1.ShowBalloonTip(5000, "Errore " + sendingOrReceiving, "Alcuni trasferimenti in ricezione non sono andati a buon fine.", ToolTipIcon.Error);
                break;

            case ErrorNotificationType.Sending:
                notifyIcon1.ShowBalloonTip(5000, "Errore " + sendingOrReceiving, "Alcuni trasferimenti in uscita non sono andati a buon fine.", ToolTipIcon.Error);
                break;

            case ErrorNotificationType.File:
                notifyIcon1.ShowBalloonTip(5000, "Errore " + sendingOrReceiving, "Il file (o un elemento nella sua gerarchia) è aperto da un altro processo", ToolTipIcon.Error);
                break;

            case ErrorNotificationType.DirectoryNotFound:
                notifyIcon1.ShowBalloonTip(5000, "Errore " + sendingOrReceiving, "La directory specificata non esiste.", ToolTipIcon.Error);
                break;

            case ErrorNotificationType.PathTooLong:
                notifyIcon1.ShowBalloonTip(5000, "Errore " + sendingOrReceiving, "Il path del file specificato è troppo lungo.", ToolTipIcon.Error);
                break;

            case ErrorNotificationType.Path:
                notifyIcon1.ShowBalloonTip(5000, "Errore " + sendingOrReceiving, "Il percorso specificato non è valido", ToolTipIcon.Error);
                break;
            }
        }
    public void SetArrowByDirection(ErrorDirection errorPosition)
    {
        switch (errorPosition)
        {
        case ErrorDirection.DOWN:
            upArrow.SetActive(value: true);
            break;

        case ErrorDirection.LEFT:
            rightArrow.SetActive(value: true);
            break;

        case ErrorDirection.RIGHT:
            leftArrow.SetActive(value: true);
            break;

        case ErrorDirection.UP:
            downArrow.SetActive(value: true);
            break;
        }
    }