Beispiel #1
0
        private void SetFileSize(BinaryFile file, DevComponents.DotNetBar.LabelX label, bool sizesSame)
        {
            if (file == null || !file.IsFileOnDisk)
            {
                label.Text = "-";
                return;
            }

            double numMegaBytes = file.GetFileSize() / (1024d * 1024d);

            if (numMegaBytes >= 1)
            {
                label.Text = numMegaBytes + " MB";
            }
            else
            {
                numMegaBytes = file.GetFileSize() / 1024d;
                label.Text   = numMegaBytes + " kB";
            }
            if (sizesSame)
            {
                pictureBoxFilesize.Image = System.Drawing.Image.FromStream(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("Slyce.IntelliMerge.Resources.font_char61_green_16_h.png"));
            }
            else
            {
                pictureBoxFilesize.Image = System.Drawing.Image.FromStream(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("Slyce.IntelliMerge.Resources.font_char33_red_16_h.png"));
            }
        }
        private void SetFileSize(BinaryFile file, DevComponents.DotNetBar.LabelX label, bool sizesSame)
        {
            if (file == null || !file.IsFileOnDisk)
            {
                label.Text = "-";
                return;
            }

            double numMegaBytes = file.GetFileSize() / (1024d * 1024d);

            if (numMegaBytes >= 1)
                label.Text = numMegaBytes + " MB";
            else
            {
                numMegaBytes = file.GetFileSize() / 1024d;
                label.Text = numMegaBytes + " kB";
            }
            if (sizesSame)
                pictureBoxFilesize.Image = System.Drawing.Image.FromStream(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("Slyce.IntelliMerge.Resources.font_char61_green_16_h.png"));
            else
                pictureBoxFilesize.Image = System.Drawing.Image.FromStream(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("Slyce.IntelliMerge.Resources.font_char33_red_16_h.png"));
        }