Exemplo n.º 1
0
        public static void Create(Solution s, string task, string site, string number, DirectoryInfo dir)
        {
            var p = new CppProject
            {
                ParentSolution = s,
                TaskName       = task,
                Site           = site,
                Number         = int.Parse(number),
                Lang           = "cpp"
            };

            p.Path = dir + MyEnum.Slash + p.Name;
            p.CreateFiles();
            s.Add(p);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Нажатие на кнопку создания проекта
        /// </summary>
        private void createButton_Click(object sender, RoutedEventArgs e)
        {
            if (s == null)
            {
                s = new Solution {
                    DirSolution = new FileInfo(dirfile.FullName)
                };
            }
            var lang = ((TextBlock)langList.SelectedValue).Text;

            if (lang == "cpp")
            {
                var p = new CppProject
                {
                    ParentSolution = s,
                    TaskName       = nameText.Text,
                    Site           = siteText.Text,
                    Number         = int.Parse(numberText.Text),
                    Lang           = lang
                };
                p.Path = dir + MyEnum.Slash + p.Name;
                p.CreateFiles();
                s.Add(p);
            }
            else if (lang == "cs")
            {
                var p = new CSharpProject
                {
                    ParentSolution = s,
                    TaskName       = nameText.Text,
                    Site           = siteText.Text,
                    Number         = int.Parse(numberText.Text),
                    Lang           = lang
                };
                p.Path = dir + MyEnum.Slash + p.Name;
                p.CreateFiles();
                s.Add(p);
            }
            mainTable.ItemsSource = null;
            mainTable.ItemsSource = s;
            SaveFlag = false;
        }