{"id":17109134,"url":"https://github.com/dkackman/desktopbridgeenvironment","last_synced_at":"2025-09-01T18:36:48.655Z","repository":{"id":72222133,"uuid":"83228868","full_name":"dkackman/DesktopBridgeEnvironment","owner":"dkackman","description":"Library that helps a Desktop Bridge application run both as a package and regular exe.","archived":false,"fork":false,"pushed_at":"2017-02-26T21:00:11.000Z","size":1315,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-14T20:45:34.638Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dkackman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-26T17:54:41.000Z","updated_at":"2018-05-18T19:45:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"ec452200-1391-47b1-b51b-c25f8772dd85","html_url":"https://github.com/dkackman/DesktopBridgeEnvironment","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkackman%2FDesktopBridgeEnvironment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkackman%2FDesktopBridgeEnvironment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkackman%2FDesktopBridgeEnvironment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkackman%2FDesktopBridgeEnvironment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dkackman","download_url":"https://codeload.github.com/dkackman/DesktopBridgeEnvironment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245171771,"owners_count":20572295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T16:22:13.542Z","updated_at":"2025-03-23T21:28:25.732Z","avatar_url":"https://github.com/dkackman.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# DesktopBridgeEnvironment\nLibrary that helps a Desktop Bridge application run both as a package and regular exe.\n\n[NuGet Package](https://www.nuget.org/packages/DesktopBridgeEnvironment/)\n\nA Desktop Bridge exe doesn't share the same Launch.Suspend semantics as a UWP app. This make Toast notifcations somewhat cumbersome as everytime a user reacts to a UWP notificaiton an new instance is invoked. Further, the lifetime a UWP toast can outlast the app instance. This package helps smooth over those differences between UWP and Win32.\n\n    static void Main(string [] args)\n    {\n        using (var instance = new SingleInstance(ExecutionEnvironment.Current.AppId))\n        {\n            // make sure we are the only instance running before doing anything.\n            if (instance.IsFirstInstance)\n            {\n                ExecutionEnvironment.Current.StartupArgs = args;\n\n                Application.Run(new Form1());\n            }\n        }\n    }\n    \nAnd then elsewhere in the app:\n\n    protected override void OnLoad(EventArgs e)\n    {\n        if (ExecutionEnvironment.Current.IsUwp)\n        {\n            // do uwp form load stuff\n            \n            if (ExecutionEnvironment.Current.StartupArgs != null \u0026\u0026 ExecutionEnvironment.Current.StartupArgs.Length \u003e 0)\n            {\n                // process Uwp notification message\n            }            \n        }\n        else\n        {\n            // do win32 form load stuff\n        }\n        \n        base.OnLoad(e);       \n    }\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkackman%2Fdesktopbridgeenvironment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdkackman%2Fdesktopbridgeenvironment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkackman%2Fdesktopbridgeenvironment/lists"}