コード例 #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;
			}
		}
コード例 #3
0
 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);
             }
         }
     }
 }
コード例 #4
0
		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
ファイル: DotDesktopView.cs プロジェクト: zcf7822/monodevelop
 public override Task Save(FileSaveInformation fileSaveInformation)
 {
     entry.Save(fileSaveInformation.FileName);
     IsDirty = false;
     return(Task.FromResult(true));
 }