예제 #1
0
 private void UpdProgress(object sender, UpdEventArgs e)
 {
     this.pbAll.Maximum = e.MaxProgress;
     this.pbAll.Value   = e.Progress;
     if (!string.IsNullOrEmpty(e.Msg) && this.tbLog.Text.IndexOf(e.Msg) < 0)
     {
         this.tbLog.AppendText(e.Msg + "\r\n");
     }
     this.lblDeleted.Text = strings.Deleted.f(ExMethods.getSizeReadable(e.CleanSize), e.DeletedCount);
 }
예제 #2
0
 public static float Clamp(float value, float min, float max)
 {
     if (max < min)
     {
         ExMethods.Swap(ref max, ref min);
     }
     if (value <= min)
     {
         value = min;
     }
     if (value > max)
     {
         value = max;
     }
     return(value);
 }
예제 #3
0
        private void WorkAnalys()
        {
            Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(this.Locale);
            Cleaner cln = new Cleaner(this.tbTorrentsPath.Text, this.tbResumePath.Text);

            cln.UpdEvent += this.UpdProgress;
            int  deletedCount;
            long cleanSize;

            cln.Analys(out deletedCount, out cleanSize);
            string infoString = strings.AnalysDone.f(deletedCount, ExMethods.getSizeReadable(cleanSize));

            MessageBox.Show(infoString, strings.Information, MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.btnStart.Enabled  = true;
            this.btnAnalys.Enabled = true;
            this.tbLog.AppendText(infoString);
        }
예제 #4
0
 public void Transpose()
 {
     ExMethods.Swap(ref m12, ref m21); ExMethods.Swap(ref m13, ref m31); ExMethods.Swap(ref m14, ref m41);
     ExMethods.Swap(ref m23, ref m32); ExMethods.Swap(ref m24, ref m42); ExMethods.Swap(ref m34, ref m43);
 }