Ejemplo n.º 1
0
 private void initializeEdit()
 {
     try
     {
         _EditControl   = new EditControl(brdHost);
         _Edit          = _EditControl.EditBox;
         _Edit.ReadOnly = true;
         var clr = PNSkinlessDetails.DefColor;
         _EditControl.WinForm.BackColor = System.Drawing.Color.FromArgb(clr.A, clr.R, clr.G, clr.B);
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }
Ejemplo n.º 2
0
 private void initializeEdit()
 {
     try
     {
         _EditControl = new EditControl(brdHost);
         _Edit = _EditControl.EditBox;
         _Edit.ReadOnly = true;
         var brush = brdHost.Background as SolidColorBrush;
         if (brush == null) return;
         _EditControl.WinForm.BackColor = System.Drawing.Color.FromArgb(255, brush.Color.R, brush.Color.G,
             brush.Color.B);
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }
Ejemplo n.º 3
0
 private void initializeEdit()
 {
     try
     {
         _EditControl   = new EditControl(brdHost);
         _Edit          = _EditControl.EditBox;
         _Edit.ReadOnly = true;
         var brush = brdHost.Background as SolidColorBrush;
         if (brush == null)
         {
             return;
         }
         _EditControl.WinForm.BackColor = System.Drawing.Color.FromArgb(255, brush.Color.R, brush.Color.G,
                                                                        brush.Color.B);
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }
Ejemplo n.º 4
0
 internal static void SaveNoteAsTextFile(PNote note, Window owner)
 {
     try
     {
         if (PNStatic.Settings.Protection.PromptForPassword)
             if (!LogIntoNoteOrGroup(note))
                 return;
         var sfd = new SaveFileDialog
         {
             Title =
                 PNLang.Instance.GetCaptionText("save_as_text", "Save note as text file") + @" [" + note.Name +
                 @"]",
             Filter = PNLang.Instance.GetCaptionText("save_as_filter", "Text files (*.txt)|*.txt"),
             RestoreDirectory = true,
             AddExtension = true
         };
         if (sfd.ShowDialog(owner).Value)
         {
             using (var sw = new StreamWriter(sfd.FileName))
             {
                 if (note.Visible)
                 {
                     sw.Write(note.Dialog.Edit.Text);
                 }
                 else
                 {
                     var rtb = new PNRichEditBox();
                     var path = Path.Combine(PNPaths.Instance.DataDir, note.ID) + PNStrings.NOTE_EXTENSION;
                     LoadNoteFile(rtb, path);
                     sw.Write(rtb.Text);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }
Ejemplo n.º 5
0
 private void initializeEdit()
 {
     try
     {
         _EditControl = new EditControl(brdHost);
         _Edit = _EditControl.EditBox;
         _Edit.ReadOnly = true;
         var clr = PNSkinlessDetails.DefColor;
         _EditControl.WinForm.BackColor = System.Drawing.Color.FromArgb(clr.A, clr.R, clr.G, clr.B);
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }
Ejemplo n.º 6
0
 private void initializeEdit()
 {
     try
     {
         _EditControl = new EditControl(brdHost);
         _EditPreview = _EditControl.EditBox;
         _EditPreview.ReadOnly = true;
         _EditPreview.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Both;
         if (PNStatic.Settings.Config.CPUseCustPvwColor)
         {
             _EditControl.WinForm.BackColor = System.Drawing.Color.FromArgb(PNStatic.Settings.Config.CPPvwColor.A,
                 PNStatic.Settings.Config.CPPvwColor.R, PNStatic.Settings.Config.CPPvwColor.G,
                 PNStatic.Settings.Config.CPPvwColor.B);
         }
         else
         {
             var clr = PNSkinlessDetails.DefColor;
             _EditControl.WinForm.BackColor = System.Drawing.Color.FromArgb(clr.A, clr.R, clr.G, clr.B);
         }
     }
     catch (Exception ex)
     {
         PNStatic.LogException(ex);
     }
 }