Пример #1
0
 private void cboColor_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         if (!m_Loaded || cboFontColor.SelectedIndex < 0)
         {
             return;
         }
         var rc = cboFontColor.SelectedItem as Rectangle;
         if (rc == null)
         {
             return;
         }
         var sb = rc.Fill as SolidColorBrush;
         if (sb == null)
         {
             return;
         }
         m_Group.FontColor = System.Drawing.Color.FromArgb(sb.Color.A, sb.Color.R, sb.Color.G, sb.Color.B);
         PNStatic.DrawSkinlessPreview(m_Group, brdFrame, blkCaption, brdBody, blkBody);
         if (lstSkins.SelectedIndex >= 0)
         {
             PNStatic.DrawSkinPreview(m_Group, m_Group.Skin, imgSkin);
         }
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }
 private void lstSkins_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         if (lstSkins.SelectedIndex < 0)
         {
             imgSkin.Source = null;
             return;
         }
         var item = lstSkins.SelectedItem as PNListBoxItem;
         if (item == null)
         {
             return;
         }
         if (Skin.SkinName != item.Text)
         {
             _CustomSkin   = true;
             Skin.SkinName = item.Text;
             var path = Path.Combine(PNPaths.Instance.SkinsDir, Skin.SkinName + PNStrings.SKIN_EXTENSION);
             if (File.Exists(path))
             {
                 PNSkinsOperations.LoadSkin(path, Skin);
             }
         }
         if (Skin.SkinName != PNSkinDetails.NO_SKIN)
         {
             PNStatic.DrawSkinPreview(_Group, Skin, imgSkin);
         }
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }
Пример #3
0
 private void cboFonts_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         if (!m_Loaded || cboFonts.SelectedIndex < 0)
         {
             return;
         }
         var lf   = (LOGFONT)e.AddedItems[0];
         var logF = new LOGFONT();
         logF.Init();
         logF.SetFontFace(lf.lfFaceName);
         logF.SetFontSize((int)cboFontSize.SelectedItem);
         m_Group.Font = logF;
         PNStatic.DrawSkinlessPreview(m_Group, brdFrame, blkCaption, brdBody, blkBody);
         if (lstSkins.SelectedIndex >= 0)
         {
             PNStatic.DrawSkinPreview(m_Group, m_Group.Skin, imgSkin);
         }
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }