예제 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
#if DEMO
            new DemoVersionOnly("Save project").ShowDialog();
#else
            ScrollerStore ss = new ScrollerStore();
            if (!proj.bSaved)
            {
                ProjSaveDlg f = new ProjSaveDlg();
                f.ValidateName += delegate(object s, CancelEventArgs ec)
                {
                    ec.Cancel = ss.NameExists((string)s);
                };
                if (f.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                proj.name = f.FileName;
            }

            ScrollerData sd = new ScrollerData();
            sd.name         = proj.name;
            sd.leftMessage  = proj.LeftMessage;
            sd.message      = proj.Message;
            sd.rightMessage = proj.RightMessage;
            sd.font         = proj.font;
            ss.SaveProject(sd);
            proj.dirty = false;

            proj.bSaved = true;
#endif
        }
예제 #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            #if DEMO
            new DemoVersionOnly("Save project").ShowDialog();
            #else
            AnouncementStore anouncementStore = new AnouncementStore();
            if (!proj.bSaved)
            {
                ProjSaveDlg f = new ProjSaveDlg();
                f.ValidateName += delegate(object s, CancelEventArgs ec){ ec.Cancel = anouncementStore.NameExists((string)s); };
                if (f.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                proj.data.name = f.FileName;
            }

            anouncementStore.SaveAnouncement(proj.data);
            proj.dirty  = false;
            proj.bSaved = true;
            #endif
        }