Example #1
0
 public override string Process(object o)
 {
     if (o is TextBox)
     {
         return("Įveskite prisijungimo duomenis");
     }
     return(NextChain.Process(o));
 }
Example #2
0
        public object Output(string input, AttributeTypeCode outAttributeTypeCode)
        {
            if (input == null)
            {
                return(null);
            }

            OutputAttributeTypeCode = outAttributeTypeCode;
            return(AmIResponsible ? InnerOutput(input) : NextChain.Output(input, outAttributeTypeCode));
        }
Example #3
0
        public object Output(string input, Type outputType)
        {
            if (input == null)
            {
                return(null);
            }

            OutputType = outputType;
            return(AmIResponsible ? InnerOutput(input) : NextChain.Output(input, outputType));
        }
Example #4
0
 public override string Process(object o)
 {
     if (o is Button)
     {
         return("Įvedę duomenis spauskite šį mygtuką kairiuoju pelės klavišu.");
     }
     else
     {
         return(NextChain.Process(o));
     }
 }
 /// <inheritdoc />
 public void Run()
 {
     if (AmIResponsible)
     {
         InnerRun();
     }
     else
     {
         NextChain?.Run();
     }
 }
 /// <inheritdoc />
 public void RunFor(TIn input)
 {
     if (AmIResponsible)
     {
         InnerRunFor(input);
     }
     else
     {
         NextChain?.RunFor(input);
     }
 }
Example #7
0
 public override T Parse(string inputdata, string inputtype)
 {
     if (inputtype.ToLower() == "xml")
     {
         Console.WriteLine("This is xml, I am parsing this");
         var serializer = new XmlSerializer(typeof(T));
         var type       = (T)serializer.Deserialize(new StringReader(inputdata));
         return(type);
     }
     return(NextChain.Parse(inputdata, inputtype));
 }
Example #8
0
 public override string Process(object o)
 {
     if (o is Label)
     {
         var a = o as Label;
         if (a.Name.Equals("header2"))
         {
             return("Jei nesate užsiregistravę sistemoje, nuėję čia galėsite užsiregistruoti. Jums tereikia suvesti norimus prisijungimo duomenis ir paspausti mygtuką \"Pirmyn\".");
         }
     }
     return(NextChain.Process(o));
 }
Example #9
0
 public override string Process(object o)
 {
     if (o is Label)
     {
         var a = o as Label;
         if (a.Name.Equals("header1"))
         {
             return("Jei esate užsiregistravę sistemoje, dabar galite prisijunkite. Jums tereikia suvesti prisijungimo duomenis ir paspausti mygtuką \"Pirmyn\".");
         }
     }
     return(NextChain.Process(o));
 }
Example #10
0
 public override void CalculateInterest(Account account)
 {
     if (account.Type == "Зарплатный")
     {
         // логику расчета оставил прежней
         // расчет процентной ставк зарплатного аккаунта по правилам банка
         account.Interest = account.Balance * 0.5;
     }
     else if (NextChain != null)
     {
         NextChain.CalculateInterest(account);
     }
 }
Example #11
0
 public override T Parse(string inputdata, string inputtype)
 {
     if (inputtype.ToLower() == "json")
     {
         Console.WriteLine("This is JSON, I am parsing this");
         T data = JsonConvert.DeserializeObject <T>(inputdata);
         return(data);
     }
     else
     {
         return(NextChain.Parse(inputdata, inputtype));
     }
 }
Example #12
0
 private void CascadeForce(DartChainV2 source, float forcetoAdd)
 {
     if (!_isStaticChain)
     {
         var direction = source.transform.position - transform.position;
         MainRigidbody.AddForce(direction.normalized * forcetoAdd);
         if (source == PreviousChain)
         {
             NextChain.CascadeForce(this, forcetoAdd * _mitigationFactor);
         }
         else if (source == NextChain)
         {
             PreviousChain.CascadeForce(this, forcetoAdd * _mitigationFactor);
         }
     }
 }
        public override void CalculateInterest(Account account)
        {
            if (account.Type == "Обычный")
            {
                // логику расчета оставил прежней
                // расчет процентной ставки обычного аккаунта по правилам банка
                account.Interest = account.Balance * 0.4;

                if (account.Balance < 1000)
                {
                    account.Interest -= account.Balance * 0.2;
                }

                if (account.Balance < 50000)
                {
                    account.Interest -= account.Balance * 0.4;
                }
            }
            else if (NextChain != null)
            {
                NextChain.CalculateInterest(account);
            }
        }
 /// <inheritdoc />
 public TOut ValueFor(TIn input)
 {
     Input = input;
     return(AmIResponsible ? InnerValueFor(input) : NextChain != null?NextChain.ValueFor(input) : default);
Example #15
0
 /// <inheritdoc />
 public TOut ValueFor(TIn input) => AmIResponsible?InnerValueFor(input) : NextChain != null?NextChain.ValueFor(input) : default;
Example #16
0
 /// <inheritdoc />
 public TOut ValueFor(TIn input)
 {
     Input = input;
     return(AmIResponsible ? InnerValueFor(input) : NextChain.ValueFor(input));
 }