Beispiel #1
0
        private int Sort(BundleInfo b1, BundleInfo b2)
        {
            SingleInfo v1  = b1.GetValue(valueType);
            SingleInfo v2  = b2.GetValue(valueType);
            float      vv1 = v1.Value * (v1.Unit == "kb" ? 1 : 1000);
            float      vv2 = v2.Value * (v2.Unit == "kb" ? 1 : 1000);

            return(vv2.CompareTo(vv1));
        }
Beispiel #2
0
        private void ShowList()
        {
            BundleList.Items.Clear();
            for (int i = 0; i < bundles.Count; ++i)
            {
                BundleInfo bundle = bundles[i];

                ListViewItem li = null;
                for (int j = 0; j < (int)ValueType.MAX_COUNT; ++j)
                {
                    if (j == 0)
                    {
                        li = new ListViewItem(bundle.Name);
                    }
                    else
                    {
                        SingleInfo info = bundle.GetInfoByType((ValueType)j);
                        li.SubItems.Add(string.Format("{0} {1}", info.Value, info.Unit));
                    }
                }
                BundleList.Items.Add(li);
            }
        }
 public void SetValue(ValueType type, string value, string unit)
 {
     infos[(int)type] = new SingleInfo(type, value, unit);
 }