当前位置: 首页>>代码示例>>C#>>正文


C# Section.TryGetSection方法代码示例

本文整理汇总了C#中Section.TryGetSection方法的典型用法代码示例。如果您正苦于以下问题:C# Section.TryGetSection方法的具体用法?C# Section.TryGetSection怎么用?C# Section.TryGetSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Section的用法示例。


在下文中一共展示了Section.TryGetSection方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadFrom

        public void LoadFrom(Section section)
        {
            Verify.Argument.IsNotNull(section, "section");

            var localRepositories = section.TryGetSection("LocalRepositories");
            if(localRepositories != null)
            {
                LoadGroupContent(_local, localRepositories);
            }
            var recentRepositories = section.TryGetSection("RecentRepositories");
            if(recentRepositories != null)
            {
                _recent.Clear();
                foreach(var repositorySection in recentRepositories.Sections)
                {
                    var repository = TryLoadRepositoryFrom(repositorySection);
                    if(repository != null)
                    {
                        _recent.Add(repository);
                    }
                }
            }
        }
开发者ID:Kuzq,项目名称:gitter,代码行数:23,代码来源:RepositoryManagerService.cs

示例2: LoadMoreViewFrom

 protected override void LoadMoreViewFrom(Section section)
 {
     base.LoadMoreViewFrom(section);
     var listNode = section.TryGetSection("ReferenceList");
     if(listNode != null)
     {
         _lstReferences.LoadViewFrom(listNode);
     }
 }
开发者ID:Kuzq,项目名称:gitter,代码行数:9,代码来源:ReferencesView.cs

示例3: LoadRepositoryConfig

 protected override void LoadRepositoryConfig(Section section)
 {
     if(Guid == Guids.ContextualDiffViewGuid)
     {
         var node = section.TryGetSection("ContextualDiffOptions");
         if(node != null)
         {
             _options.Context = node.GetValue<int>("Context", _options.Context);
             _options.IgnoreWhitespace = node.GetValue<bool>("IgnoreWhitespace", _options.IgnoreWhitespace);
             _options.UsePatienceAlgorithm = node.GetValue<bool>("UsePatienceAlgorithm", _options.UsePatienceAlgorithm);
             switch(node.GetValue<string>("ViewMode", string.Empty))
             {
                 case "Split":
                     ViewMode = DiffViewMode.Split;
                     break;
                 case "Single":
                 default:
                     ViewMode = DiffViewMode.Single;
                     break;
             }
         }
     }
     base.LoadRepositoryConfig(section);
 }
开发者ID:Kuzq,项目名称:gitter,代码行数:24,代码来源:DiffView.cs

示例4: LoadFrom

        public static void LoadFrom(Section section)
        {
            Verify.Argument.IsNotNull(section, "section");

            var appearanceNode = section.TryGetSection("Appearance");
            if(appearanceNode != null)
            {
                var textRenderer = appearanceNode.TryGetParameter("TextRenderer");
                if(textRenderer != null)
                {
                    switch(textRenderer.Value as string)
                    {
                        case "GDI":
                            GitterApplication.TextRenderer = GitterApplication.GdiTextRenderer;
                            break;
                        case "GDI+":
                            GitterApplication.TextRenderer = GitterApplication.GdiPlusTextRenderer;
                            break;
                    }
                }
            }
            var servicesNode = section.TryGetSection("Services");
            if(servicesNode != null)
            {
                var spellingSection = servicesNode.TryGetSection("Spelling");
                if(spellingSection != null)
                {
                    SpellingService.LoadFrom(spellingSection);
                }
            }
            var featuresSection = section.TryGetSection("IntegrationFeatures");
            if(featuresSection != null)
            {
                GitterApplication.IntegrationFeatures.LoadFrom(featuresSection);
            }
        }
开发者ID:Kuzq,项目名称:gitter,代码行数:36,代码来源:GlobalOptions.cs

示例5: LoadMoreViewFrom

 protected override void LoadMoreViewFrom(Section section)
 {
     base.LoadMoreViewFrom(section);
     var layoutNode = section.TryGetSection("Layout");
     if(layoutNode != null)
     {
         //_toolbar.ShowDiffButton.Checked = ShowDetails = layoutNode.GetValue("ShowDetails", ShowDetails);
     }
     var listNode = section.TryGetSection("RevisionList");
     if(listNode != null)
     {
         RevisionListBox.LoadViewFrom(listNode);
     }
 }
开发者ID:Kuzq,项目名称:gitter,代码行数:14,代码来源:PathHistoryView.cs

示例6: LoadGroupContent

        private static void LoadGroupContent(RepositoryGroup group, Section section)
        {
            Assert.IsNotNull(group);
            Assert.IsNotNull(section);

            group.Groups.Clear();
            group.Respositories.Clear();
            var groups = section.TryGetSection("Groups");
            if(groups != null)
            {
                foreach(var subGroupSection in groups.Sections)
                {
                    var subGroup = TryLoadGroupFrom(subGroupSection);
                    if(subGroup != null)
                    {
                        group.Groups.Add(subGroup);
                    }
                }
            }
            var repositories = section.TryGetSection("Repositories");
            if(repositories != null)
            {
                foreach(var repositorySection in repositories.Sections)
                {
                    var repository = TryLoadRepositoryFrom(repositorySection);
                    if(repository != null)
                    {
                        group.Respositories.Add(repository);
                    }
                }
            }
        }
开发者ID:Kuzq,项目名称:gitter,代码行数:32,代码来源:RepositoryManagerService.cs

示例7: LoadRepositoryConfig

 protected override void LoadRepositoryConfig(Section section)
 {
     base.LoadRepositoryConfig(section);
     var logOptionsNode = section.TryGetSection("LogOptions");
     if(logOptionsNode != null)
     {
         LogOptions.LoadFrom(logOptionsNode);
     }
 }
开发者ID:Kuzq,项目名称:gitter,代码行数:9,代码来源:HistoryView.cs

示例8: LoadMoreViewFrom

 protected override void LoadMoreViewFrom(Section section)
 {
     base.LoadMoreViewFrom(section);
     var listNode = section.TryGetSection("RepositoryList");
     if(listNode != null)
     {
         _lstLocalRepositories.LoadViewFrom(listNode);
         _lstLocalRepositories.BeginUpdate();
         _lstLocalRepositories.Items.Clear();
         _lstLocalRepositories.LoadViewFrom(listNode);
         var itemsNode = listNode.TryGetSection("Items");
         if(itemsNode != null)
         {
             foreach(var s in itemsNode.Sections)
             {
                 var link = new RepositoryLink(s);
                 var item = new RepositoryListItem(link);
                 _lstLocalRepositories.Items.Add(item);
             }
         }
         _lstLocalRepositories.EndUpdate();
     }
 }
开发者ID:Kuzq,项目名称:gitter,代码行数:23,代码来源:StartPageView.cs

示例9: ViewLayout

        /// <summary>
        /// Initializes a new instance of the <see cref="ViewLayout"/> class.
        /// </summary>
        /// <param name="section">The section.</param>
        public ViewLayout(Section section)
        {
            Verify.Argument.IsNotNull(section, "section");

            _root = ToLayout(section.GetSection("Root"));

            var sides = section.TryGetSection("Sides");
            if(sides != null)
            {
                var left = sides.TryGetSection("Left");
                if(left != null)
                {
                    _left = new SideEntry(AnchorStyles.Left, left);
                }
                var top = sides.TryGetSection("Top");
                if(top != null)
                {
                    _top = new SideEntry(AnchorStyles.Top, top);
                }
                var right = sides.TryGetSection("Right");
                if(right != null)
                {
                    _right = new SideEntry(AnchorStyles.Right, right);
                }
                var bottom = sides.TryGetSection("Bottom");
                if(bottom != null)
                {
                    _bottom = new SideEntry(AnchorStyles.Bottom, bottom);
                }
            }
            var floats = section.TryGetSection("Floats");
            if(floats != null)
            {
                foreach(var f in floats.Sections)
                {
                    _floats.Add(new FloatEntry(f));
                }
            }
        }
开发者ID:Kuzq,项目名称:gitter,代码行数:43,代码来源:ViewLayout.cs

示例10: LoadMoreViewFrom

 protected override void LoadMoreViewFrom(Section section)
 {
     base.LoadMoreViewFrom(section);
     var listSection = section.TryGetSection("ConfigParameterList");
     if(listSection != null)
     {
         _lstConfig.LoadViewFrom(listSection);
     }
 }
开发者ID:Kuzq,项目名称:gitter,代码行数:9,代码来源:ConfigView.cs

示例11: LoadViewFrom

        public void LoadViewFrom(Section section)
        {
            Verify.Argument.IsNotNull(section, "section");

            BeginUpdate();
            var columnsSection = section.TryGetSection("Columns");
            if(columnsSection != null)
            {
                var dict = new Dictionary<string, CustomListBoxColumn>(_columns.Count);
                foreach(var c in _columns)
                {
                    dict.Add(c.IdentificationString, c);
                }
                _columns.Clear();

                foreach(var child in columnsSection.Sections)
                {
                    var name = child.Name;
                    CustomListBoxColumn column;
                    if(dict.TryGetValue(name, out column))
                    {
                        column.LoadFrom(child);
                        _columns.Add(column);
                        dict.Remove(name);
                    }
                }
                foreach(var column in dict.Values)
                {
                    _columns.Add(column);
                }
            }
            LoadMoreViewFrom(section);
            EndUpdate();
        }
开发者ID:Kuzq,项目名称:gitter,代码行数:34,代码来源:CustomListBox.cs

示例12: LoadMoreViewFrom

        protected override void LoadMoreViewFrom(Section section)
        {
            base.LoadMoreViewFrom(section);

            _toolbar.TreeModeButton.Checked = _treeMode = section.GetValue<bool>("TreeMode", true);
            var stagedListSection = section.TryGetSection("StagedList");
            if(stagedListSection != null)
            {
                _lstStaged.LoadViewFrom(stagedListSection);
            }
            var unstagedListSection = section.TryGetSection("UnstagedList");
            if(unstagedListSection != null)
            {
                _lstUnstaged.LoadViewFrom(unstagedListSection);
            }
        }
开发者ID:Kuzq,项目名称:gitter,代码行数:16,代码来源:CommitView.cs

示例13: LoadFor

        public bool LoadFor(IWorkingEnvironment environment, Section section)
        {
            Verify.Argument.IsNotNull(environment, "environment");

            if(section != null)
            {
                var providerName = section.GetValue<string>("AccessorProvider", string.Empty);
                if(!string.IsNullOrWhiteSpace(providerName))
                {
                    ActiveGitAccessorProvider = GitAccessorProviders.FirstOrDefault(
                        prov => prov.Name == providerName);
                }
                if(ActiveGitAccessorProvider == null)
                {
                    ActiveGitAccessorProvider = GitAccessorProviders.First();
                }
                var gitAccessorSection = section.TryGetSection(ActiveGitAccessorProvider.Name);
                if(gitAccessorSection != null)
                {
                    GitAccessor.LoadFrom(gitAccessorSection);
                }
            }
            else
            {
                ActiveGitAccessorProvider = GitAccessorProviders.First();
            }
            Version gitVersion;
            try
            {
                gitVersion = _gitAccessor.GitVersion;
            }
            catch(Exception exc)
            {
                if(exc.IsCritical())
                {
                    throw;
                }
                gitVersion = null;
            }
            if(gitVersion == null || gitVersion < MinimumRequiredGitVersion)
            {
                using(var dlg = new VersionCheckDialog(environment, this, MinimumRequiredGitVersion, gitVersion))
                {
                    dlg.Run(environment.MainForm);
                    gitVersion = dlg.InstalledVersion;
                    if(gitVersion == null || gitVersion < _minVersion)
                    {
                        return false;
                    }
                }
            }
            GlobalOptions.RegisterPropertyPageFactory(
                new PropertyPageFactory(
                    GitOptionsPage.Guid,
                    Resources.StrGit,
                    null,
                    PropertyPageFactory.RootGroupGuid,
                    env => new GitOptionsPage(env)));
            GlobalOptions.RegisterPropertyPageFactory(
                new PropertyPageFactory(
                    ConfigurationPage.Guid,
                    Resources.StrConfig,
                    null,
                    GitOptionsPage.Guid,
                    env => new ConfigurationPage(env)));
            _environment = environment;
            _configSection = section;
            return true;
        }
开发者ID:Kuzq,项目名称:gitter,代码行数:69,代码来源:RepositoryProvider.cs


注:本文中的Section.TryGetSection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。