protected override void Execute(CodeActivityContext context)
        {
            try
            {
                string str = context.GetValue(this.StringValue);
                string add = context.GetValue(this.Add);


                string resultString = Regex.Match(str, @"\d+").Value;
                long   num          = Convert.ToInt64(resultString);
                Console.WriteLine(resultString);
                num += Convert.ToInt64(add);

                int    length   = resultString.Length;
                string asString = num.ToString("D" + length);
                Console.WriteLine("Updated num string: " + asString);

                string sub   = str.Substring(0, 3);
                string final = string.Concat(sub, asString);
                Console.WriteLine("Final string: " + final);

                UpdatedValue.Set(context, final);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Exception.Set(context, ex);
                throw ex;
            }
        }
Exemplo n.º 2
0
    private void IncreaseValue()
    {
        Value++;
        HasMerged = true;

        UpdatedValue?.Invoke(Value);
    }
Exemplo n.º 3
0
    public void SetValue(int x, int y, int value)
    {
        X     = x;
        Y     = y;
        Value = value;

        UpdatedValue?.Invoke(Value);
    }
Exemplo n.º 4
0
 public new TValue this[TKey key]
 {
     get => base[key];
     set
     {
         base[key] = value;
         Updated.Invoke(key, value);
         UpdatedValue.Invoke(value);
     }
 }
Exemplo n.º 5
0
        public new bool TryAdd(
            TKey key,
            TValue value)
        {
            if (base.TryAdd(key, value))
            {
                Updated.Invoke(key, value);
                UpdatedValue.Invoke(value);
                return(true);
            }

            return(false);
        }
Exemplo n.º 6
0
        protected override void Execute(CodeActivityContext context)
        {
            try
            {
                string str = context.GetValue(this.StringNum);
                string add = context.GetValue(this.Add);

                long n = Convert.ToInt64(str);
                long i = Convert.ToInt64(add);

                long   sum   = n + i;
                string final = Convert.ToString(sum);
                Console.WriteLine("Final string: " + final);

                UpdatedValue.Set(context, final);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Exception.Set(context, ex);
                throw ex;
            }
        }