ZeroInstall.DesktopIntegration.ViewModel.IntegrationState.LoadCommandAccessPoints C# (CSharp) Method

LoadCommandAccessPoints() private method

Reads the CommandAccessPoints from DesktopIntegration.AppEntry.AccessPoints or uses suggestion methods to fill in defaults.
private LoadCommandAccessPoints ( ) : void
return void
        private void LoadCommandAccessPoints()
        {
            if (AppEntry.AccessPoints == null)
            { // Fill in default values for first integration
                MenuEntries.AddRange(Suggest.MenuEntries(Feed));
                SendTo.AddRange(Suggest.SendTo(Feed));
                Aliases.AddRange(Suggest.Aliases(Feed));
            }
            else
            { // Distribute existing CommandAccessPoints among type-specific binding lists
                new PerTypeDispatcher<AccessPoint>(ignoreMissing: true)
                {
                    (Action<MenuEntry>)MenuEntries.Add,
                    (Action<DesktopIcon>)DesktopIcons.Add,
                    (Action<SendTo>)SendTo.Add,
                    (Action<AppAlias>)Aliases.Add,
                    (Action<AutoStart>)AutoStarts.Add
                }.Dispatch(AppEntry.AccessPoints.Entries.CloneElements()); // Use clones so that user modifications can still be canceled
            }
        }