public ErrorViewModel(int errorCode, object parameters = null)
        {
            ErrorCode = errorCode;
            CustomErrorMessage customErrorMessage = CustomErrorMessages.GetPageError(errorCode) ?? CustomErrorMessages.DefaultPageError;

            Title        = customErrorMessage.Title;
            Subtitle     = customErrorMessage.Subtitle;
            Description  = customErrorMessage.Description;
            CallToAction = customErrorMessage.CallToAction;
            Uri uri = HttpContext.Current?.GetUri();

            ActionUrl  = customErrorMessage.ActionUrl == "#" && uri != null ? uri.PathAndQuery : customErrorMessage.ActionUrl;
            ActionText = customErrorMessage.ActionText;

            //Assign any values to variables
            if (parameters != null)
            {
                foreach (PropertyInfo prop in parameters.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public))
                {
                    var value = prop.GetValue(parameters, null) as string;
                    if (string.IsNullOrWhiteSpace(prop.Name) || string.IsNullOrWhiteSpace(value))
                    {
                        continue;
                    }

                    Title        = Title.ReplaceI("{" + prop.Name + "}", value);
                    Subtitle     = Subtitle.ReplaceI("{" + prop.Name + "}", value);
                    Description  = Description.ReplaceI("{" + prop.Name + "}", value);
                    CallToAction = CallToAction.ReplaceI("{" + prop.Name + "}", value);
                    ActionUrl    = ActionUrl.ReplaceI("{" + prop.Name + "}", value);
                    ActionText   = ActionText.ReplaceI("{" + prop.Name + "}", value);
                }
            }
        }
Ejemplo n.º 2
0
        public void AddText(CPos position, int duration, ActionText.ActionTextType type, params string[] text)
        {
            var @object = new ActionText(position, new CPos(0, -15, 30), duration, type, text);

            @object.ZOffset += 1024;

            Add(@object);
        }
Ejemplo n.º 3
0
    public void take_damage(float f)
    {
        if (f < 0)
        {
            Debug.LogWarning("take_damage only takes in positive numbers (" + f + ")");
        }
        current_hp -= f;
        update_health();

        ActionText.spawn_damage_text(transform.position, (int)Mathf.Round(f));
    }
Ejemplo n.º 4
0
        /// <summary>
        /// Called when a new action starts.
        /// </summary>
        /// <param name="record">The <see cref="Deployment.WindowsInstaller.Record"/> containing additional information.</param>
        /// <returns>The result code indicating how Windows Installer should proceed.</returns>
        protected MessageResult OnActionStart(Deployment.WindowsInstaller.Record record)
        {
            if (this.progress.IsValid)
            {
                var current = this.progress.Current;

                if (current.EnableActionData)
                {
                    current.EnableActionData = false;
                }

                if (current.GeneratingScript)
                {
                    this.progress.CurrentAction = Resources.Action_GeneratingScript;
                }
                else if (null != record && 2 < record.FieldCount)
                {
                    var action = record.GetString(1);
                    Debug.Assert(!string.IsNullOrEmpty(action), "Action should not be null at this point");

                    this.progress.CurrentAction         = record.GetString(2);
                    this.progress.CurrentActionTemplate = record.GetString(3);

                    // Use current culture resources if ActionText is missing or doesn't match the current culture.
                    var culture = this.progress.CurrentCulture ?? CultureInfo.InvariantCulture;
                    if (string.IsNullOrEmpty(this.progress.CurrentAction) || !culture.Equals(CultureInfo.CurrentCulture))
                    {
                        this.progress.CurrentAction = ActionText.GetActionText(action) ?? string.Empty;
                    }

                    if (string.IsNullOrEmpty(this.progress.CurrentActionTemplate) || !culture.Equals(CultureInfo.CurrentCulture))
                    {
                        this.progress.CurrentActionTemplate = ActionText.GetActionData(action);
                    }
                }
            }

            return(MessageResult.OK);
        }
        void ReleaseDesignerOutlets()
        {
            if (ActionText != null)
            {
                ActionText.Dispose();
                ActionText = null;
            }

            if (ActorImage != null)
            {
                ActorImage.Dispose();
                ActorImage = null;
            }

            if (btnConfirm != null)
            {
                btnConfirm.Dispose();
                btnConfirm = null;
            }

            if (btnDelete != null)
            {
                btnDelete.Dispose();
                btnDelete = null;
            }

            if (CreationDate != null)
            {
                CreationDate.Dispose();
                CreationDate = null;
            }

            if (separatorView != null)
            {
                separatorView.Dispose();
                separatorView = null;
            }
        }
Ejemplo n.º 6
0
 private void Awake()
 {
     instance = this;
 }
Ejemplo n.º 7
0
 private void Start()
 {
     actionText = GameObject.Find("ActionText").GetComponent <ActionText>();
     inventory  = Inventory.instance;
 }
Ejemplo n.º 8
0
 private void Awake()
 {
     Instance                   = this;
     actionText.text            = string.Empty;
     actionImage.preserveAspect = true;
 }
Ejemplo n.º 9
0
 private void Start()
 {
     boxCollider = GetComponent <BoxCollider>();
     actionText  = FindObjectOfType <ActionText>();
     notebook    = FindObjectOfType <Notebook>();
 }
Ejemplo n.º 10
0
 private void Awake()
 {
     Instance        = this;
     actionText.text = string.Empty;
 }