コード例 #1
0
        public Project OnNewProject(CreateProjDialogData createProj)
        {
            Project proj = LayerHandler.CreateProject(createProj);

            TileHandler.Update();
            OnNeedRedraw();
            return(proj);
        }
コード例 #2
0
 public Project CreateProject(CreateProjDialogData createProj)
 {
     int[] tilelatlon = TileCoordinate.ConvertWorldToTile(
         double.Parse(createProj.Lat, CultureInfo.InvariantCulture),
         double.Parse(createProj.Lon, CultureInfo.InvariantCulture),
         18
         );
     cureentProject = new Project()
     {
         Name  = createProj.Name,
         TileX = tilelatlon[0],
         TileY = tilelatlon[1]
     };
     Loader.CreateProject(cureentProject);
     Scene.AppendProject(cureentProject);
     return(cureentProject);
 }
コード例 #3
0
 private void OnNewProject_Click(object sender, EventArgs e)
 {
     Status.Text = "Создание нового проекта";
     try
     {
         CreateProjDialogData createProj = ShowCreateProjDialog();
         Project proj     = decisionSupport.OnNewProject(createProj);
         string  filename = ShowSaveFileDialog(proj.Name);
         decisionSupport.OnSaveProject(filename);
         ChangeTitle(proj.Name);
         ShowBouble($"Проект {proj.Name} успешно создан!");
     }
     catch (Exception exc)
     {
         ShowBouble(exc.Message);
     }
     Status.Text = "Ok";
 }
コード例 #4
0
ファイル: MainWindow.cs プロジェクト: awwar/DecSupport
        public CreateProjDialogData ShowCreateProjDialog()
        {
            CreateProjDialogData data = new CreateProjDialogData();

            CreateProjDialog createProj = new CreateProjDialog();

            if (createProj.ShowDialog() == DialogResult.OK)
            {
                if (createProj.LatInput.TextLength > 0 &&
                    createProj.LonInput.TextLength > 0 &&
                    createProj.ProjName.TextLength > 0)
                {
                    data.Lat  = createProj.LatInput.Text;
                    data.Lon  = createProj.LonInput.Text;
                    data.Name = createProj.ProjName.Text;
                    createProj.Dispose();
                    return(data);
                }
            }
            throw new Exception("Project not created");
        }