Exemplo n.º 1
0
        private void Create_Click(object sender, RoutedEventArgs e)
        {
            InfinityMain im   = (InfinityMain)Owner;
            string       name = FileName.Text;

            im.CreateDirectoryInProject(name);
            this.Hide();
        }
        private void Create_Click(object sender, RoutedEventArgs e)
        {
            InfinityMain im   = (InfinityMain)Owner;
            string       type = (string)((ComboBoxItem)FileType.SelectedItem).Tag;
            string       name = FileName.Text;

            im.CreateFileInProject(name + "." + type);
            this.Hide();
        }
 private void Create_Click(object sender, RoutedEventArgs e)
 {
     if (!_yesShown)
     {
         string pn = ProjectName.Text;
         if (pn.Length >= 16)
         {
             pn = pn.Substring(0, 13) + "...";
         }
         Create.Content = "Yes, Create " + pn;
         _yesShown      = true;
         No.Visibility  = System.Windows.Visibility.Visible;
     }
     else
     {
         Progress.IsIndeterminate = true;
         ProjectInfo pi = new ProjectInfo
         {
             Name    = ProjectName.Text,
             Created = DateTime.Now,
             Type    = (string)((ComboBoxItem)ProjectType.SelectedItem).Content
         };
         XmlSerializer xs = new XmlSerializer(typeof(ProjectInfo));
         DirectoryInfo pd = new DirectoryInfo(ProjectDirectory.Text + "\\" + pi.Name);
         if (!pd.Exists)
         {
             pd.Create();
         }
         StreamWriter pinfo = new StreamWriter(pd.FullName + "\\" + pi.Name + ".iproj");
         xs.Serialize(pinfo, pi);
         pinfo.Close();
         InfinityMain im = (InfinityMain)Owner;
         im.OpenProject(pd);
         Progress.IsIndeterminate = false;
         this.Hide();
     }
 }