Esempio n. 1
0
        /// <summary>
        /// Respond to the update event, when an item is being edited and
        /// subsequently updated, by updating the info object of the
        /// item being edited.
        /// </summary>
        /// <param name="sender">The sender of the event.</param>
        /// <param name="e">The event arguments</param>
        private void ObjectivesEditor_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            DropDownList ddl      = (DropDownList)(e.Item.Cells[1].FindControl("BloomDrop"));
            TextBox      tb       = (TextBox)(e.Item.Cells[1].FindControl("ObjectiveTextbox"));
            int          selected = e.Item.ItemIndex;
            string       newText  = SwenetDev.Globals.parseTextInput(tb.Text);

            Objectives.ObjectiveInfo oi = ((Objectives.ObjectiveInfo)ObjectivesEditor.DataList[selected]);
            oi.Text       = newText;
            oi.BloomLevel = ddl.SelectedValue;
            ObjectivesEditor.DataList[selected] = oi;
            ObjectivesEditor.DataBind();

            if (hasDuplicates())
            {
                ObjectivesEditor.Text = "That objective has already been added.";
                ObjectivesEditor.DataList.RemoveAt(selected);
            }
            else if (oi.Text.Length > MaxLength)
            {
                ObjectivesEditor.Text = "That entry exceeds the maximum length of: " + MaxLength;
                ObjectivesEditor.DataList.RemoveAt(selected);
            }
            else
            {
                ObjectivesEditor.Text = "";
            }
        }
        public void RpcAddShrineStackClient()
        {
            var killedImpCount = impsSpawned - impsAlive;

            objectiveString = string.Format(Language.GetString(objectiveBaseToken), impColorHex, killedImpCount, impsSpawned, this.timeLeft);
            objectiveInfo   = Objectives.AddObjective(objectiveString, true);
            MoreShrines.objectives.Add(objectiveInfo);
            symbolTransform.gameObject.SetActive(false);
        }