Beispiel #1
0
        private List <SettingsPageViewModel> GetParentCollection(ISettingsEditor settingsEditor,
                                                                 List <SettingsPageViewModel> pages)
        {
            if (string.IsNullOrEmpty(settingsEditor.SettingsPagePath))
            {
                return(pages);
            }

            string[] path = settingsEditor.SettingsPagePath.Split(new[] { '\\' }, StringSplitOptions.RemoveEmptyEntries);

            foreach (string pathElement in path)
            {
                SettingsPageViewModel page = pages.FirstOrDefault(s => s.Name == pathElement);

                if (page == null)
                {
                    page = new SettingsPageViewModel {
                        Name = pathElement
                    };
                    pages.Add(page);
                }

                pages = page.Children;
            }

            return(pages);
        }
        private ICollection <SettingsPage> GenerateAndGetParentPages(ISettingsEditor editor,
                                                                     ICollection <SettingsPage> pages)
        {
            if (string.IsNullOrEmpty(editor.SettingsPagePath))
            {
                return(pages);
            }

            var parentPageNames = editor.SettingsPagePath.Split(new[] { '\\' }, StringSplitOptions.RemoveEmptyEntries);

            foreach (var pageName in parentPageNames)
            {
                var page = pages.FirstOrDefault(s => s.Name == pageName);

                if (page == null)
                {
                    page = new SettingsPage {
                        Name = pageName
                    };
                    pages.Add(page);
                }

                pages = page.Children;
            }

            return(pages);
        }
 public RemoteDesktopConnectionService(IServiceProvider serviceProvider)
 {
     this.jobService           = serviceProvider.GetService <IJobService>();
     this.remoteDesktopService = serviceProvider.GetService <IRemoteDesktopService>();
     this.tunnelBrokerService  = serviceProvider.GetService <ITunnelBrokerService>();
     this.settingsEditor       = serviceProvider.GetService <ISettingsEditor>();
     this.credentialsService   = serviceProvider.GetService <ICredentialsService>();
     this.taskDialog           = serviceProvider.GetService <ITaskDialog>();
 }
Beispiel #4
0
        private List<SettingsPageViewModel> GetParentCollection(ISettingsEditor settingsEditor,
            List<SettingsPageViewModel> pages)
        {
            if (string.IsNullOrEmpty(settingsEditor.SettingsPagePath))
            {
                return pages;
            }

            string[] path = settingsEditor.SettingsPagePath.Split(new[] {'\\'}, StringSplitOptions.RemoveEmptyEntries);

            foreach (string pathElement in path)
            {
                SettingsPageViewModel page = pages.FirstOrDefault(s => s.Name == pathElement);

                if (page == null)
                {
                    page = new SettingsPageViewModel {Name = pathElement};
                    pages.Add(page);
                }

                pages = page.Children;
            }

            return pages;
        }