Esempio n. 1
0
 internal static PNSkinDetails GetSkin(WndNote dlg, PNote note)
 {
     try
     {
         PNSkinDetails skn;
         if (note.Skin != null)
         {
             skn = note.Skin;
         }
         else
         {
             PNGroup gr = PNStatic.Groups.GetGroupByID(note.GroupID);
             if (gr.Skin == null || gr.Skin.SkinName == PNSkinDetails.NO_SKIN)
             //if (gr.ID != (int)SpecialGroups.Docking && gr.ID != (int)SpecialGroups.Diary)
             {
                 // get General png skin
                 gr = PNStatic.Groups.GetGroupByID(0);
             }
             skn = gr.Skin;
         }
         return(skn);
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
         return(null);
     }
 }
Esempio n. 2
0
 private void loadGroups(PNGroup gr, PNTreeItem item, string captionShow, string captionHide)
 {
     try
     {
         var ti = new PNTreeItem("submnu", gr.Name, gr.ID.ToString(CultureInfo.InvariantCulture))
         {
             IsExpanded = true
         };
         ti.Items.Add(new PNTreeItem("mnu", captionShow,
                                     gr.ID.ToString(CultureInfo.InvariantCulture) + "_show"));
         ti.Items.Add(new PNTreeItem("mnu", captionHide,
                                     gr.ID.ToString(CultureInfo.InvariantCulture) + "_hide"));
         if (item == null)
         {
             _ItemsGroup.Add(ti);
         }
         else
         {
             item.Items.Add(ti);
         }
         foreach (PNGroup g in gr.Subgroups)
         {
             loadGroups(g, ti, captionShow, captionHide);
         }
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }
Esempio n. 3
0
 private void loadGroup(PNGroup pgroup, PNTreeItem item)
 {
     try
     {
         var ti = new PNTreeItem(pgroup.Image, pgroup.Name, pgroup)
         {
             IsExpanded = true
         };
         foreach (var sg in pgroup.Subgroups)
         {
             loadGroup(sg, ti);
         }
         if (item == null)
         {
             _Items.Add(ti);
         }
         else
         {
             item.Items.Add(ti);
         }
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }
Esempio n. 4
0
 public void Dispose()
 {
     PNGroup group = PNStatic.Groups.GetGroupByID(_GroupID);
     if (group != null)
     {
         group.GroupPropertyChanged -= group_GroupPropertyChanged;
     }
     if (_Skin != null)
     {
         _Skin.Dispose();
     }
 }
Esempio n. 5
0
 internal WndNewGroup(PNGroup group, PNTreeItem treeItem)
     : this()
 {
     if (group != null)
     {
         m_Group = (PNGroup)group.Clone();
         m_Mode  = AddEditMode.Edit;
     }
     else
     {
         m_Group = new PNGroup {
             IsDefaultImage = true
         };
     }
     _TreeItem = treeItem;
 }
Esempio n. 6
0
 internal GroupChangedEventArgs(PNGroup group, AddEditMode mode, PNTreeItem treeItem)
 {
     Group    = group;
     Mode     = mode;
     TreeItem = treeItem;
 }
        private void DlgAdjustAppearance_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                if (PNStatic.Settings.GeneralSettings.UseSkins)
                {
                    GridSkinless.Visibility  = Visibility.Hidden;
                    GridSkinnable.Visibility = Visibility.Visible;
                }
                _CustomOpacity = _Note.CustomOpacity;
                applyLanguage();
                if (_CustomOpacity)
                {
                    trkTrans.Value = (int)(100 - (_Note.Opacity * 100));
                    _Opacity       = _Note.Opacity;
                }
                else
                {
                    trkTrans.Value = (int)(100 - (PNStatic.Settings.Behavior.Opacity * 100));
                    _Opacity       = PNStatic.Settings.Behavior.Opacity;
                }
                _Group = PNStatic.Groups.GetGroupByID(_Note.GroupID);
                if (_Group == null)
                {
                    throw new Exception("Group cannot be null");
                }
                if (_Note.Skinless != null)
                {
                    _CustomSkinless = true;
                    Skinless        = (PNSkinlessDetails)_Note.Skinless.Clone();
                }
                else
                {
                    Skinless = (PNSkinlessDetails)_Group.Skinless.Clone();
                }

                blkCaption.DataContext = Skinless.CaptionFont;

                pckBGSknls.SelectedColor = Skinless.BackColor;

                if (GridSkinnable.Visibility == Visibility.Visible)
                {
                    if (_Note.Skin != null)
                    {
                        _CustomSkin = true;
                        Skin        = _Note.Skin.PNClone();
                    }
                    else
                    {
                        Skin = _Group.Skin.PNClone();
                    }
                    loadSkinsList();
                    if (Skin.SkinName != PNSkinDetails.NO_SKIN)
                    {
                        lstSkins.SelectedItem =
                            lstSkins.Items.OfType <PNListBoxItem>().FirstOrDefault(it => it.Text == Skin.SkinName);
                    }
                    else
                    {
                        lstSkins.SelectedIndex = -1;
                    }
                }
            }
            catch (Exception ex)
            {
                PNStatic.LogException(ex);
            }
        }