private void FileView_PreviewFile(MyFile file)
 {
     if (file == null)
     {
         if (PreviewEvent != null)
         {
             PreviewEvent.Invoke(null, null);
         }
     }
     else
     {
         string   extension        = System.IO.Path.GetExtension(file.Path);
         string[] previewableFiles = new string[] { ".txt", ".jpg", ".png", ".gif", ".bmp" };
         if (previewableFiles.Contains(extension))
         {
             if (PreviewEvent != null)
             {
                 PreviewEvent.Invoke(file.Path, extension);
             }
             else
             {
                 if (PreviewEvent != null)
                 {
                     PreviewEvent.Invoke(null, null);
                 }
             }
         }
     }
 }
示例#2
0
        public void UpdateColorBox(Color colorCurrent)
        {
            m_bEventsEnabled   = false;
            numericRed.Value   = colorCurrent.R;
            numericGreen.Value = colorCurrent.G;
            numericBlue.Value  = colorCurrent.B;
            m_lastColor        = colorCurrent;
            UpdateColorHexText();
            panelColor.BackColor = colorCurrent;

            m_bEventsEnabled = true;
            PreviewEvent?.Invoke(this, colorCurrent);
        }
示例#3
0
        public void UpdateColorBox(Color colorCurrent, object sender = null)
        {
            m_bEventsEnabled   = false;
            numericRed.Value   = colorCurrent.R;
            numericGreen.Value = colorCurrent.G;
            numericBlue.Value  = colorCurrent.B;
            numericAlpha.Value = colorCurrent.A;
            m_lastColor        = colorCurrent;
            if (sender != txtHexColor)
            {
                UpdateColorHexText();
            }

            panelColor.BackColor = colorCurrent;
            m_bEventsEnabled     = true;
            PreviewEvent?.Invoke(this, colorCurrent);
        }