public override void FillPanel(ArchivedFile file, Panel pn)
        {
            Frame[]      frameArr1    = ImageDecoder.LoadFrames(file);
            Panel        panel        = pn;
            FileTabSheet fileTabSheet = new FileTabSheet();

            fileTabSheet.SetFile(file);
            pn                  = fileTabSheet.DecodedPanel;
            pn.AutoScroll       = true;
            pn.AutoScrollMargin = new Size(5, 5);
            int i1 = 5;

            for (int i2 = 0; i2 < (int)frameArr1.Length; i2++)
            {
                Frame[]      frameArr2    = new Frame[] { frameArr1[i2] };
                int[]        iArr         = new int[] { 1 };
                Animation    animation    = new Animation(frameArr2, iArr);
                AnimationBox animationBox = new AnimationBox();
                animationBox.Title = "Imagen";
                Animation[] animationArr = new Animation[] { animation };
                animationBox.Animations = animationArr;
                animationBox.Name       = Path.GetFileNameWithoutExtension(file.FileName);
                animationBox.UpdateSize();
                animationBox.SetBounds(5, i1, animationBox.Width, animationBox.Height);
                pn.Controls.Add(animationBox);
                i1 += animationBox.Height + 5;
            }
            panel.Controls.Add(fileTabSheet);
        }
 public override void FillPanel(ArchivedFile file, Panel pn)
 {
     Frame[] frameArr1 = ImageDecoder.LoadFrames(file);
     Panel panel = pn;
     FileTabSheet fileTabSheet = new FileTabSheet();
     fileTabSheet.SetFile(file);
     pn = fileTabSheet.DecodedPanel;
     pn.AutoScroll = true;
     pn.AutoScrollMargin = new Size(5, 5);
     int i1 = 5;
     for (int i2 = 0; i2 < (int)frameArr1.Length; i2++)
     {
         Frame[] frameArr2 = new Frame[] { frameArr1[i2] };
         int[] iArr = new int[] { 1 };
         Animation animation = new Animation(frameArr2, iArr);
         AnimationBox animationBox = new AnimationBox();
         animationBox.Title = "Imagen";
         Animation[] animationArr = new Animation[] { animation };
         animationBox.Animations = animationArr;
         animationBox.Name = Path.GetFileNameWithoutExtension(file.FileName);
         animationBox.UpdateSize();
         animationBox.SetBounds(5, i1, animationBox.Width, animationBox.Height);
         pn.Controls.Add(animationBox);
         i1 += animationBox.Height + 5;
     }
     panel.Controls.Add(fileTabSheet);
 }
Example #3
0
        public override void FillPanel(ArchivedFile file, Panel pn)
        {
            MemoryStream memoryStream = new MemoryStream();

            file.Download(memoryStream);
            Panel        panel        = null;
            FileTabSheet fileTabSheet = null;

            for (int i = 0; i < DataDecoder.m_Processors.Length; i++)
            {
                DataProcessor dataProcessor = DataDecoder.m_Processors[i];
                if (dataProcessor.IsMatch(file.FileName))
                {
                    panel        = pn;
                    fileTabSheet = new FileTabSheet();
                    pn           = fileTabSheet.DecodedPanel;
                    memoryStream = dataProcessor.Mutate(memoryStream);
                    fileTabSheet.SetStream(file.FileName, memoryStream);
                    memoryStream.Seek((long)0, SeekOrigin.Begin);
                    DataStream dataStream = new DirectDataStream(memoryStream);
                    TextWriter textWriter = new StringWriter();
                    dataProcessor.Process(dataStream, textWriter);
                    TextBox textBox = new TextBox();
                    pn.BorderStyle     = BorderStyle.None;
                    textBox.Dock       = DockStyle.Fill;
                    textBox.Multiline  = true;
                    textBox.ReadOnly   = true;
                    textBox.BackColor  = SystemColors.Window;
                    textBox.WordWrap   = false;
                    textBox.ScrollBars = ScrollBars.Both;
                    textBox.Text       = textWriter.ToString();
                    pn.Controls.Add(textBox);
                    break;
                }
            }
            if (panel != null)
            {
                panel.Controls.Add(fileTabSheet);
            }
            else
            {
                StreamDisplay streamDisplay = new StreamDisplay();
                streamDisplay.Dock        = DockStyle.Fill;
                streamDisplay.Stream      = memoryStream;
                streamDisplay.Position    = 0;
                streamDisplay.BorderStyle = BorderStyle.Fixed3D;
                pn.Controls.Add(streamDisplay);
            }
        }
Example #4
0
 public override void FillPanel(ArchivedFile file, Panel pn)
 {
     MemoryStream memoryStream = new MemoryStream();
     file.Download(memoryStream);
     Panel panel = null;
     FileTabSheet fileTabSheet = null;
     for (int i = 0; i < DataDecoder.m_Processors.Length; i++)
     {
         DataProcessor dataProcessor = DataDecoder.m_Processors[i];
         if (dataProcessor.IsMatch(file.FileName))
         {
             panel = pn;
             fileTabSheet = new FileTabSheet();
             pn = fileTabSheet.DecodedPanel;
             memoryStream = dataProcessor.Mutate(memoryStream);
             fileTabSheet.SetStream(file.FileName, memoryStream);
             memoryStream.Seek((long)0, SeekOrigin.Begin);
             DataStream dataStream = new DirectDataStream(memoryStream);
             TextWriter textWriter = new StringWriter();
             dataProcessor.Process(dataStream, textWriter);
             TextBox textBox = new TextBox();
             pn.BorderStyle = BorderStyle.None;
             textBox.Dock = DockStyle.Fill;
             textBox.Multiline = true;
             textBox.ReadOnly = true;
             textBox.BackColor = SystemColors.Window;
             textBox.WordWrap = false;
             textBox.ScrollBars = ScrollBars.Both;
             textBox.Text = textWriter.ToString();
             pn.Controls.Add(textBox);
             break;
         }
     }
     if (panel != null)
     {
         panel.Controls.Add(fileTabSheet);
     }
     else
     {
         StreamDisplay streamDisplay = new StreamDisplay();
         streamDisplay.Dock = DockStyle.Fill;
         streamDisplay.Stream = memoryStream;
         streamDisplay.Position = 0;
         streamDisplay.BorderStyle = BorderStyle.Fixed3D;
         pn.Controls.Add(streamDisplay);
     }
 }