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);
             }
         }
     }
 }
Esempio n. 2
0
 public override Task Load(FileOpenInformation fileOpenInformation)
 {
     ContentName = fileOpenInformation.FileName;
     entry.Load(fileOpenInformation.FileName);
     widget.DesktopEntry = entry;
     return(Task.FromResult(true));
 }
Esempio n. 3
0
        protected override Control OnGetViewControl(DocumentViewContent view)
        {
            widget          = new DotDesktopViewWidget();
            widget.Changed += delegate {
                HasUnsavedChanges = true;
            };
            entry = new DesktopEntry();
            widget.DesktopEntry = entry;

            entry.Load(FilePath);
            widget.DesktopEntry = entry;
            return((Control)widget);
        }
		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);
				}
			}
		}
Esempio n. 5
0
 public override void Load(string fileName)
 {
     ContentName = fileName;
     entry.Load(fileName);
     widget.DesktopEntry = entry;
 }
Esempio n. 6
0
 public override void Load(FileOpenInformation fileOpenInformation)
 {
     ContentName = fileOpenInformation.FileName;
     entry.Load(fileOpenInformation.FileName);
     widget.DesktopEntry = entry;
 }