/** UI Updating Functionality **/

        //Reloads UI elements whenever the page becomes visible again in case something changed
        private void OnPageVisible(Object sender, DependencyPropertyChangedEventArgs e)
        {
            if (this.IsVisible) //update the UI source
            {
                //set title
                ProjectTitle.SetCurrentValue(TextBlock.TextProperty, project.title);
                //set subtitle
                ProjectSubtitle.SetCurrentValue(TextBlock.TextProperty, project.subtitle);
                if (HelpFunctions.StringIsBlank(ProjectSubtitle.Text))
                {
                    ProjectSubtitle.Visibility = Visibility.Collapsed;
                }
                else
                {
                    ProjectSubtitle.Visibility = Visibility.Visible;
                }
                //update topic list
                UpdateTopicList();
                //update tag list
                UpdateTagList();
                //set default filter mode and clear tag selection
                SetDefaultFiltering();
                //update future elements...
            }
        }
Exemple #2
0
        private void UpdateProjectTitle(object param)
        {
            if (string.Equals(_project.Header, ProjectTitle.Trim()))
            {
                return;
            }

            if (!ValidateUserInput.IsNullOrWhiteSpace(ProjectTitle))
            {
                ProjectTitle = _project.Header;
                return;
            }
            _projectPath = $".{Path.DirectorySeparatorChar}Projects{Path.DirectorySeparatorChar}{ProjectTitle}{Path.DirectorySeparatorChar}";
            try
            {
                Directory.Move(_project.Path, _projectPath.Substring(2));
            }
            catch
            {
                ProjectTitle = _project.Header;
                MessageBox.Show("That project already exist");
                return;
            }
            _project.Header = ProjectTitle;
            _project.Path   = _projectPath;
            DataBase.UpdateProject((Project)_project);
        }
Exemple #3
0
        public void CreateDiplomaRequest(StudentDTO studentDto, int daId, int teacherId, int localeId, string title)
        {
            Mapper.Initialize(cfg =>
            {
                cfg.CreateMap <FirstNameDTO, FirstName>();
                cfg.CreateMap <LastNameDTO, LastName>();
                cfg.CreateMap <PatronymicDTO, Patronymic>();
                cfg.CreateMap <GroupDTO, Group>();
                cfg.CreateMap <StudentDTO, Student>();
            });

            var studentRes = CreateStudent(studentDto, localeId);

            var project = new Project
            {
                Student           = studentRes,
                TeacherId         = teacherId,
                CreationDate      = DateTime.Now,
                DevelopmentAreaId = daId,
                Accepted          = false
            };

            Database.Projects.Add(project);

            var projTitle = new ProjectTitle {
                Project = project, Title = title, CreationDate = DateTime.Now, LocaleId = localeId
            };

            Database.ProjectTitles.Add(projTitle);

            Database.Save();
            EmailService.SendEmailAsync("*****@*****.**", "Test", "Test!");
        }
Exemple #4
0
        public void CorrectSpacingProjectTitles()
        {
            ProjectTitle project1 = new ProjectTitle("Project1");
            ProjectTitle project2 = new ProjectTitle(" Project2");

            Assert.AreEqual(true, project1.CorrectSpacing);
            Assert.AreEqual(false, project2.CorrectSpacing);
        }
Exemple #5
0
    //launch in projecttitle
    void Launch()
    {
        GameObject   projecTitelObject = Instantiate(projecTitleprefab, body.position + Vector2.up * 0.5f, Quaternion.identity);
        ProjectTitle project           = projecTitelObject.GetComponent <ProjectTitle>();

        project.Launch(lookDiretion, 300);
        anim.SetTrigger("Launch");
    }
Exemple #6
0
        public void UniqueProjectTitles()
        {
            ProjectTitle project1 = new ProjectTitle("Project");
            ProjectTitle project2 = new ProjectTitle("Project");
            ProjectTitle project3 = new ProjectTitle("ProjectDifferent");

            Assert.AreEqual(true, project1.Equals(project2));
            Assert.AreEqual(false, project1.Equals(project3));
        }
Exemple #7
0
        public void ProjectTitlesComparing()
        {
            ProjectTitle projectDependencies1 = new ProjectTitle("Dependencies");
            ProjectTitle projectDependencies2 = new ProjectTitle("Dependencies");
            ProjectTitle projectInstalls      = new ProjectTitle("Installs");
            ProjectTitle project1             = new ProjectTitle("Project1");
            ProjectTitle project2             = new ProjectTitle("Project2");
            ProjectTitle project3             = new ProjectTitle("Project3");

            // Same projects (2 different instances of the dependencies one though)
            List <ProjectTitle> sameProjects1 = new List <ProjectTitle>()
            {
                project1, projectDependencies1, project2, projectInstalls, project3
            };
            List <ProjectTitle> sameProjects2 = new List <ProjectTitle>()
            {
                project1, projectDependencies2, project2, projectInstalls, project3
            };

            CollectionAssert.AreEqual(sameProjects1, sameProjects2);

            // Same projects - after sorting (2 different instances of the dependencies one though)
            List <ProjectTitle> allProjects = new List <ProjectTitle>()
            {
                project1, projectDependencies1, project2, projectInstalls, project3
            };
            List <ProjectTitle> allProjectsInCorrectOrder = new List <ProjectTitle>()
            {
                projectDependencies2, projectInstalls, project1, project2, project3
            };
            ProjectTitleComparer comp = new ProjectTitleComparer();

            allProjects.Sort(comp);

            CollectionAssert.AreEqual(allProjects, allProjectsInCorrectOrder);
        }
 public override void btnOK_BtnClick(object sender, EventArgs e)
 {
     if (ProjectTitle.Trim() == "")
     {
         FrmDialog.ShowDialog(this, "请输入工程名称!");
         return;
     }
     if (Password.Trim() == "")
     {
         FrmDialog.ShowDialog(this, "请输入工程加密密码!");
         return;
     }
     if (Password.Trim() != this.tbConfirm.Text.Trim())
     {
         FrmDialog.ShowDialog(this, "密码和确认密码不一致!");
         return;
     }
     if (FileFullName == "")
     {
         FrmDialog.ShowDialog(this, "请选择存储位置!");
         return;
     }
     this.DialogResult = DialogResult.OK;
 }