protected virtual void OnButtonAddClicked (object sender, System.EventArgs e)
		{
			NewRegistryDialog dlg = new NewRegistryDialog (null);
			dlg.TransientFor = this;
			if (dlg.Run () == (int) Gtk.ResponseType.Ok) {
				RegistryInfo reg = new RegistryInfo ();
				reg.ApplicationName = dlg.ApplicationName;
				reg.ApplicationPath = dlg.ApplicationPath;
				reg.RegistryPath = dlg.RegistryPath;
				AddinAuthoringService.AddCustomRegistry (reg);
				Fill (null);
			}
			dlg.Destroy ();
		}
		public static void RemoveCustomRegistry (RegistryInfo reg)
		{
			config.Registries.Remove (reg);
			SaveConfig ();
		}
		public static void AddCustomRegistry (RegistryInfo reg)
		{
			config.Registries.Add (reg);
			SaveConfig ();
		}
Example #4
0
 public static void RemoveCustomRegistry(RegistryInfo reg)
 {
     config.Registries.Remove(reg);
     SaveConfig();
 }
Example #5
0
 public static void AddCustomRegistry(RegistryInfo reg)
 {
     config.Registries.Add(reg);
     SaveConfig();
 }
        ExecutionCommand CreateCommand(SolutionEntityItem item)
        {
            DotNetProject project = item as DotNetProject;

            if (project == null || project.CompileTarget != CompileTarget.Library || project.ParentSolution == null)
            {
                return(null);
            }

            SolutionAddinData sdata = project.ParentSolution.GetAddinData();

            if (sdata == null || project.GetAddinData() == null || project.GetAddinData().IsRoot)
            {
                return(null);
            }

            RegistryInfo ri = sdata.ExternalRegistryInfo;

            if (ri == null || string.IsNullOrEmpty(ri.TestCommand))
            {
                return(null);
            }

            FilePath cmd;
            string   args;

            if (ri.TestCommand [0] == '"')
            {
                // If the file name is quoted, unquote it
                int i = ri.TestCommand.IndexOf('"', 1);
                if (i == -1)
                {
                    throw new UserException("Invalid add-in test command: " + ri.TestCommand);
                }
                cmd  = ri.TestCommand.Substring(1, i - 1);
                args = ri.TestCommand.Substring(i + 1).Trim();
            }
            else
            {
                int i = ri.TestCommand.IndexOf(' ');
                if (i == -1)
                {
                    cmd  = ri.TestCommand;
                    args = string.Empty;
                }
                else
                {
                    cmd  = ri.TestCommand.Substring(0, i);
                    args = ri.TestCommand.Substring(i + 1).Trim();
                }
            }

            // If the command is an absolute file, take it
            // It not, consider it is a file relative to the startup path
            // If a relative file can't be found, use it as is

            if (!cmd.IsAbsolute)
            {
                FilePath absCmd = cmd.ToAbsolute(ri.ApplicationPath);
                if (System.IO.File.Exists(absCmd))
                {
                    cmd = absCmd;
                }
            }

            ProcessExecutionCommand pcmd = Runtime.ProcessService.CreateCommand(cmd) as ProcessExecutionCommand;

            if (pcmd == null)
            {
                return(null);
            }
            pcmd.Arguments = args;
            pcmd.EnvironmentVariables ["MONO_ADDINS_REGISTRY"] = sdata.TestRegistryPath;
            return(pcmd);
        }
		void AddSolution (Solution sol)
		{
			SolutionAddinData data = sol.GetAddinData ();
			if (data != null) {
				RegistryInfo reg = new RegistryInfo ();
				reg.ApplicationName = data.ApplicationName;
				reg.CachedRegistry = data.Registry;
				tree.AddChild (reg);
				registries [reg.CachedRegistry] = reg;
				solutions [sol] = reg;
			}
		}