Пример #1
0
		public void TestWrite ()
		{
			var cwd = new FileInfo (Assembly.GetExecutingAssembly ().Location).DirectoryName;
			string tempFilename = Path.Combine (cwd, Path.GetRandomFileName());

			string testText = "hello world!";

			var filePath = new MonoDevelop.Core.FilePath (tempFilename);
			Text.TextFile.WriteFile (filePath, testText, "UTF8");

			string fileContents = File.ReadAllText (tempFilename);

			try {
				Assert.AreEqual (fileContents, testText);
			} finally {
				File.Delete (tempFilename);
			}
		}
        /* Metodo a ejecutarse al pulsar OK */
        private void dialogResponde(object sender, ResponseArgs args)
        {
            if(args.ResponseId == Gtk.ResponseType.Ok)
            {
                dlgDatabaseConfiguration config = (dlgDatabaseConfiguration)sender;

                if(!config.validateDataConnection(2))
                    return;

                if(!config.getConnectionStringString())
                    return;

                connectionString = config.connectionString;

                if(!TestConnection())
                    return;

                /* Obtenemos la referencia al proyecto actual para modificar el webconfig o crearlo si este no existe */
                startupProject = IdeApp.ProjectOperations.CurrentSelectedProject;

                /* Obtenemos la ruta del directorio del projecto en un MonoDevelop.Core.FilePath */
                projectPath = startupProject.FileName.ParentDirectory;

                /* Obtenemos una referencia al Addins para poder acceder a los recursos almacenados en la misma carpeta */
                foreach (ExtensionNode node in AddinManager.GetExtensionNodes("/MonoDevelop/Ide/MainMenu/Project"))
                    if(node.Id == "ListOptions")
                        myNode = node;

                if(addReference())
                    if(createDatabase())
                        if(createWebConfig())
                            if(modifyWebConfig())
                            {
                                MessageDialog md = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.Close, "Configuration Finished");
                       			md.Run();
                       			md.Destroy();
                                return;
                            }
            }
        }
Пример #3
0
 public bool CanHandle(MonoDevelop.Core.FilePath fileName, string mimeType, MonoDevelop.Projects.Project ownerProject)
 {
     return(mimeType == "text/x-mgcb");
 }
Пример #4
0
 public IViewContent CreateContent(MonoDevelop.Core.FilePath fileName, string mimeType, MonoDevelop.Projects.Project ownerProject)
 {
     return(new MonoGameContentEditorViewContent(fileName, ownerProject));
 }
 public MonoDevelop.Core.FilePath GetFileName(MonoDevelop.Core.FilePath baseName)
 {
     return(baseName + ".os");
 }
 public bool IsSourceCodeFile(MonoDevelop.Core.FilePath fileName)
 {
     return(Path.GetExtension(fileName) == ".os");
 }