Example #1
0
        private void llNewProj_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            AnouncementProject sp = new AnouncementProject();

            Program.Presenter.AddProject(sp);
            this.Deactivate();
        }
Example #2
0
        private void StartProject(bool activate)
        {
            if (currentProject == null)
            {
                return;
            }

            // Check if this project is already opened
            foreach (IProject p in Program.Presenter.projects)
            {
                if (p.GetProjectType() == ProjectType.Anouncement)
                {
                    AnouncementProject anouncementproj = (AnouncementProject)p;
                    if (anouncementproj.data.ToString() == currentProject.name)
                    {
                        Program.Presenter.ActivateController(anouncementproj);
                        this.Deactivate();
                        return;
                    }
                }
            }

            AnouncementProject ap = new AnouncementProject();

            ap.LoadData(currentProject);
            Program.Presenter.AddProject(ap);
            if (activate)
            {
                ap.Activate();
            }

            // Clear ui
            this.Deactivate();
        }
        public void DetachProject()
        {
            DetachRegionControls();
            currentRegion         = null;
            txtMessage.Text       = "";
            txtMessage.Enabled    = false;
            btnChangeFont.Enabled = false;

            if (this.proj != null)
            {
                if (ehRefresh != null)
                {
                    this.proj.Refresh -= ehRefresh;
                    ehRefresh          = null;
                }
                this.proj = null;
            }
        }
        public void AttachProject(IProject proj)
        {
            if (this.proj != proj)
            {
                DetachProject();

                this.proj          = (AnouncementProject)proj;
                ehRefresh          = new EventHandler(project_Refresh);
                this.proj.Refresh += ehRefresh;
            }
            this.RefreshUI();

            // Add a region if this project doesn't have one
            if (this.proj.data.lTextRegions.Count == 0)
            {
                btnAddReg_Click(null, null);
            }
        }