Skip to content

Instantly share code, notes, and snippets.

@hishaamn
Created October 2, 2024 19:40
Show Gist options
  • Save hishaamn/f2cb5a7c370f7ab0456136f4e1f23d69 to your computer and use it in GitHub Desktop.
Save hishaamn/f2cb5a7c370f7ab0456136f4e1f23d69 to your computer and use it in GitHub Desktop.
private static StartMenu.ApplicationShortcut GetApplicationShortcut(Item item)
{
Assert.ArgumentNotNull((object) item, nameof (item));
LinkField field = (LinkField) item.Fields["Application"];
Assert.IsNotNull((object) field, "link field");
string internalPath = field.InternalPath;
if (internalPath.Length > 0)
{
Item obj = Client.Site.Database.Items[internalPath];
if (obj != null)
return new StartMenu.ApplicationShortcut()
{
ID = obj.ID.ToString(),
Icon = obj["Icon"],
DisplayName = obj["Display name"],
ToolTip = obj["Tool tip"],
Path = obj.Paths.Path,
Parameters = obj["Parameters"],
Click = "RunShortcut(\"" + (object) item.ID + "\")"
};
}
return (StartMenu.ApplicationShortcut) null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment