Example #1
0
            public reminderTab(FileReminder parent)
            {
                tabs     = new List <TabPage>();
                listboxs = new List <ListBox>();

                this.parent = parent;
            }
Example #2
0
        static void Main(string[] args)
        {
            Program p = new Program();

            string mutexName = "FileReminder";

            bool createdNew;

            System.Threading.Mutex mutex =
                new System.Threading.Mutex(true, mutexName, out createdNew);

            if (createdNew)
            {
                ChannelServices.RegisterChannel(new IpcServerChannel(Application.ProductName), true);

                RemotingServices.Marshal(p, "open");

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(f = new FileReminder());
            }
            else
            {
                mutex.Close();

                ChannelServices.RegisterChannel(new IpcClientChannel(), true);

                p = Activator.GetObject(typeof(Program), "ipc://" + Application.ProductName + "/open") as Program;

                if (p.StartupNextInstance(args))
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(new FileReminder());
                }
            }

            mutex.Close();
        }