예제 #1
0
        public void Store()
        {
            DotNetProject project = entry as DotNetProject;

            if (project == null)
            {
                return;
            }

            LinuxDeployData data = LinuxDeployData.GetLinuxDeployData(project);

            data.GenerateScript = checkScript.Active;
            data.ScriptName     = entryScript.Text;
            data.GeneratePcFile = checkPcFile.Active;

            if (checkDesktop.Active)
            {
                DesktopEntry de = new DesktopEntry();
                de.SetEntry("Encoding", "UTF-8");
                de.Type     = DesktopEntryType.Application;
                de.Name     = entry.Name;
                de.Exec     = entryScript.Text;
                de.Terminal = false;
                string file = System.IO.Path.Combine(entry.BaseDirectory, "app.desktop");
                de.Save(file);
                ProjectFile      pfile = project.AddFile(file, BuildAction.Content);
                DeployProperties props = DeployService.GetDeployProperties(pfile);
                props.TargetDirectory = LinuxTargetDirectory.DesktopApplications;
            }
        }
예제 #2
0
		public void Store ()
		{
			DotNetProject project = entry as DotNetProject;
			if (project == null)
				return;
			
			LinuxDeployData data = LinuxDeployData.GetLinuxDeployData (project);
			data.GenerateScript = checkScript.Active;
			data.ScriptName = entryScript.Text;
			data.GeneratePcFile = checkPcFile.Active;
			
			if (checkDesktop.Active) {
				DesktopEntry de = new DesktopEntry ();
				de.SetEntry ("Encoding", "UTF-8");
				de.Type = DesktopEntryType.Application;
				de.Name = entry.Name;
				de.Exec = entryScript.Text;
				de.Terminal = false;
				string file = System.IO.Path.Combine (entry.BaseDirectory, "app.desktop");
				de.Save (file);
				ProjectFile pfile = project.AddFile (file, BuildAction.Content);
				DeployProperties props = DeployService.GetDeployProperties (pfile);
				props.TargetDirectory = LinuxTargetDirectory.DesktopApplications;
			}
		}
 void OnFileAdded(object o, ProjectFileEventArgs args)
 {
     foreach (ProjectFileEventInfo a in args)
     {
         if (a.ProjectFile.Name.EndsWith(".desktop"))
         {
             DesktopEntry de = new DesktopEntry();
             try {
                 de.Load(a.ProjectFile.Name);
                 a.ProjectFile.BuildAction = BuildAction.Content;
                 DeployProperties props = DeployService.GetDeployProperties(a.ProjectFile);
                 props.TargetDirectory = LinuxTargetDirectory.DesktopApplications;
                 if (string.IsNullOrEmpty(de.Exec))
                 {
                     LinuxDeployData dd = LinuxDeployData.GetLinuxDeployData(a.Project);
                     if (dd.GenerateScript && !string.IsNullOrEmpty(dd.ScriptName))
                     {
                         de.Exec = dd.ScriptName;
                         de.Save(a.ProjectFile.Name);
                     }
                 }
             } catch (Exception ex) {
                 LoggingService.LogError("Could not read .desktop file", ex);
             }
         }
     }
 }
		void OnFileAdded (object o, ProjectFileEventArgs a)
		{
			if (a.ProjectFile.Name.EndsWith (".desktop")) {
				DesktopEntry de = new DesktopEntry ();
				try {
					de.Load (a.ProjectFile.Name);
					a.ProjectFile.BuildAction = BuildAction.Content;
					DeployProperties props = DeployService.GetDeployProperties (a.ProjectFile);
					props.TargetDirectory = LinuxTargetDirectory.DesktopApplications;
					if (string.IsNullOrEmpty (de.Exec)) {
						LinuxDeployData dd = LinuxDeployData.GetLinuxDeployData (a.Project);
						if (dd.GenerateScript && !string.IsNullOrEmpty (dd.ScriptName)) {
							de.Exec = dd.ScriptName;
							de.Save (a.ProjectFile.Name);
						}
					}
				} catch (Exception ex) {
					LoggingService.LogError ("Could not read .desktop file", ex);
				}
			}
		}
예제 #5
0
 public override void Save(string fileName)
 {
     entry.Save(fileName);
     IsDirty = false;
 }
예제 #6
0
 public override void Save(FileSaveInformation fileSaveInformation)
 {
     entry.Save(fileSaveInformation.FileName);
     IsDirty = false;
 }
예제 #7
0
 protected override Task OnSave()
 {
     entry.Save(FilePath);
     return(Task.CompletedTask);
 }
예제 #8
0
 public override Task Save(FileSaveInformation fileSaveInformation)
 {
     entry.Save(fileSaveInformation.FileName);
     IsDirty = false;
     return(Task.FromResult(true));
 }