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;
        }
Exemplo n.º 3
0
        public int ImportProjects()
        {
            var c = Count;

            foreach (var i in Dir.GetDirectories())
            {
                foreach (var j in this)
                {
                    if (j.Path == i.FullName)
                    {
                        goto cntn;
                    }
                }
                if (i.Name.Contains(MyEnum.CSharpSuff))
                {
                    var p = new CSharpProject
                    {
                        ParentSolution = this,
                        Name           = i.Name,
                        Lang           = "cs",
                        Dir            = i
                    };
                    Add(p);
                }
                if (i.Name.Contains(MyEnum.CppSuff))
                {
                    var p = new CppProject
                    {
                        ParentSolution = this,
                        Name           = i.Name,
                        Lang           = "cpp",
                        Dir            = i
                    };
                    Add(p);
                }
                cntn :;
            }
            return(Count - c);
        }
 public void CreateCppProject()
 {
     CppProject.Create(s, nameText.Text, siteText.Text, numberText.Text, s.Dir);
 }