public static EFile CreateNewPhysicalFile(NewFileType a_Type, string a_Name, bool a_Create = true) { Func<string, EFile> A = (x) => new EFile(g_pGamepath + "data\\" + x, new StdFileReader()); Func<EFile> B = () => { switch (a_Type) { case NewFileType.Lrent: case NewFileType.Sec: case NewFileType.Wrl: return A("common\\projects\\" + a_Name); case NewFileType.Texture: return A("compiled\\images\\" + a_Name); case NewFileType.StaticModel: return A("common\\meshes\\" + a_Name); case NewFileType.AnimModel: return A("compiled\\animations\\" + a_Name); case NewFileType.Material: return A("common\\materials\\" + a_Name); case NewFileType.Info: return A("raw\\infos\\" + a_Name); case NewFileType.Tab: return A("compiled\\strings\\" + a_Name); default: throw new Exception(); } }; EFile a = B(); if (a_Create) a.Create(FileMode.Create); if (!_PhyFiles.ContainsKey(a.Name.ToUpper())) //lock (m_PhyBlock) { _PhyFiles.Add(a.Name.ToUpper(), a); } return a; }
public async Task <ActionResult <bool> > CreateNewFile(int catalogId, int folderId, string fileName, NewFileType newFileType) { var employeeId = await this.employeeService.GetIdByUserAsync(this.currentUser.UserId); if (employeeId == 0) { return(BadRequest(DriveConstants.INVALID_EMPLOYEE)); } return(await this.fileService.CreateNewFileAsync(catalogId, employeeId, folderId, fileName, newFileType)); }
public async Task <bool> CreateNewFileAsync(int catalogId, int employeeId, int folderId, string fileName, NewFileType fileType) => fileType switch {
//User Control private void Button_Click_2(object sender, RoutedEventArgs e) { NewFileNameText.Text = "UserControl1.xaml"; SelectedFileType = NewFileType.UserControl; }
//Window private void Button_Click_1(object sender, RoutedEventArgs e) { NewFileNameText.Text = "Window1.xaml"; SelectedFileType = NewFileType.Window; }
//Class private void Button_Click(object sender, RoutedEventArgs e) { NewFileNameText.Text = "Class1.cs"; SelectedFileType = NewFileType.Class; }