コード例 #1
0
ファイル: WalletFile.cs プロジェクト: jimeney/ThorClient
        public override bool Equals(object o)
        {
            if (this == o)
            {
                return(true);
            }
            if (!(o is Aes128CtrKdfParams))
            {
                return(false);
            }

            var that = (Aes128CtrKdfParams)o;

            if (Dklen != that.Dklen)
            {
                return(false);
            }
            if (C != that.C)
            {
                return(false);
            }
            if (!Prf?.Equals(that.Prf) ?? that.Prf != null)
            {
                return(false);
            }
            return(Salt?.Equals(that.Salt) ?? that.Salt == null);
        }
コード例 #2
0
        /// <summary>
        /// Add Created Perf Record
        /// </summary>
        private void Pa(Prf CurrLog, Cx CurrCodeType, string Comments = null)
        {
            if (C == null || C.P != true || CurrLog == null)
            {
                return;
            }

            var Log = CurrLog;

            if (C.Pr == true && CurrCodeType != null && CurrCodeType.S != null && CurrCodeType.S.Pr == true)
            {
                Log.Ie = Pp(CurrCodeType);
            }

            Log.C = Comments;
            var End = _.d;

            Log.De = End;
            Log.T  = (End - Log.Ds).Ticks;
            Log.Ms = (End - Log.Ds).TotalMilliseconds;

            L.P.Add(Log);
            Rn++;

            if (Rl > 1 && Rn > Rl)
            {
                Sv();
            }
        }
コード例 #3
0
ファイル: WalletFile.cs プロジェクト: jimeney/ThorClient
        public override int GetHashCode()
        {
            int result = Dklen;

            result = 31 * result + C;
            result = 31 * result + (Prf != null ? Prf.GetHashCode() : 0);
            result = 31 * result + (Salt != null ? Salt.GetHashCode() : 0);
            return(result);
        }
コード例 #4
0
        /// <summary>
        /// Run Common Sync Try FuncToRunSync With Errors And Performance Logging based on CurrCodeType.
        /// Logging is saved to CustomLogToAddRecords or default static logs (_.D.L)
        /// </summary>
        public static T r <T>(this Lg CurrLog, f <T> FuncToRunSync, Cx CustomCodeType = null, Mx CustomMethodContext = null, T ReturnOnError = default)
        {
            if (FuncToRunSync == null)
            {
                return(ReturnOnError);
            }

            var t       = CustomCodeType;
            Prf PerfLog = null;
            var ef      = false;

            if (t.S != null && t.S.P == true)
            {
                PerfLog = CurrLog.P(t, CustomMethodContext);
            }

            T Result = ReturnOnError;

            if (CustomCodeType.T)
            {
                try
                {
                    Result = FuncToRunSync();
                }
                catch (Exception exc)
                {
                    if (t.S != null && t.S.L == true)
                    {
                        CurrLog.E(null, exc, t, CustomMethodContext);
                    }
                    ef = true;
                }
            }
            else
            {
                Result = FuncToRunSync();
            }

            if (t.S != null && t.S.P == true)
            {
                CurrLog.Pa(PerfLog, null, t);
            }

            if (ef)
            {
                return(ReturnOnError);
            }

            return(Result);
        }
コード例 #5
0
ファイル: Medium.cs プロジェクト: icaka123/ClassicStudent2
    //Умножение и деление
    private void UiD()
    {
        instr.text = " ";
        int z = Random.Range(1, 3);
        int n = Random.Range(2, 11);

        switch (z)
        {
        case 1:
            do
            {
                int y = Random.Range(2000, 10000);
            }while (y % n != 0);
            int Ch = y / n;
            int Chf;
            do
            {
                Chf = Random.Range(Ch - 100, Ch + 100);
            }while (Chf == Ch && Chf <= 0);
            quest.text = y + "/" + n;
            tr.text    = Ch.ToString();
            fal.text   = Chf.ToString();
            break;

        case 2:
            int b  = Random.Range(2000, 10000);
            int Pr = b * n;
            int Prf;
            do
            {
                Prf = Random.Range(Pr - 900, Pr + 900);
            }while (Prf <= 0 && Pr == Prf);
            quest.text = b + "*" + n;
            tr.text    = Pr.ToString();
            fal.text   = Prf.ToString();
            break;
        }
    }
コード例 #6
0
        /// <summary>
        /// Create New Log Entry
        /// </summary>
        private Prf Pn(Cx CurrCodeType, Mx CustomMethodContext = null)
        {
            if (C == null || C.P != true)
            {
                return(null);
            }

            Ce(CurrCodeType, CustomMethodContext);
            Prf r = new Prf();

            if (C.Pr == true && CurrCodeType != null && CurrCodeType.S != null && CurrCodeType.S.Pr == true)
            {
                r.Is = Pp(CurrCodeType);
            }
            if (CurrCodeType != null)
            {
                r.X = CurrCodeType.CxId;
            }
            if (CustomMethodContext != null)
            {
                r.M = CustomMethodContext.CmId;
            }
            return(r);
        }
コード例 #7
0
 /// <summary>
 /// Add Created Performance Log Record To Storage
 /// </summary>
 public void Pa(Prf Log, string CustomComments = null, Cx CurrCodeType = null)
 {
     Pa(Log, CurrCodeType, CustomComments);
 }