using PaintDotNet.Base.CommTool;
using PaintDotNet.Base.Functionodel;
using PaintDotNet.SystemLayer;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Resources;
using System.Threading;
using System.Windows.Forms;
namespace PaintDotNet
{
///
/// This Form class is used to fix a few bugs in Windows Forms, and to add a few performance
/// enhancements, such as disabling opacity != 1.0 when running in a remote TS/RD session.
/// We derive from this class instead of Windows.Forms.Form directly.
///
public class PdnBaseForm : Form, ISnapManagerHost
{
public static string xmlPath = "";
static PdnBaseForm()
{
Application.EnterThreadModal += new EventHandler(Application_EnterThreadModal);
Application.LeaveThreadModal += new EventHandler(Application_LeaveThreadModal);
Application_EnterThreadModal(null, EventArgs.Empty);
}
// This set keeps track of forms which cannot be the current modal form.
private static Stack> parentModalForms = new Stack>();
private static bool IsInParentModalForms(Form form)
{
foreach (List