public override void ProcessCommandLineArgument(string argument) { string extension = FileManager.GetExtension(argument); switch (extension) { case "scnx": EditorData.LoadScene(argument); break; case "plylstx": EditorData.LoadPolygonList(argument); break; case "shcx": EditorData.LoadShapeCollection(argument); break; } }
private void GameForm_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { // Assign the file names to a string array, in // case the user has selected multiple files. string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); try { System.Drawing.Point p = this.PointToClient(new System.Drawing.Point(e.X, e.Y)); foreach (string fileName in files) { string extension = FileManager.GetExtension(fileName); switch (extension) { case "plylstx": EditorData.LoadPolygonList(fileName); this.BringToFront(); this.Focus(); break; case "scnx": //GameData.guiData.fileButtonWindow.AskToReplaceOrInsertNewScene(fileName); break; } } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); return; } } }
void LoadPolygonListOk(Window callingWindow) { string fileName = ((FileWindow)callingWindow).Results[0]; EditorData.LoadPolygonList(fileName); }