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


C# DataNew.Sets方法代码示例

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


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

示例1: SearchControl

 public SearchControl(DataNew.Entities.Game game)
 {
     Game = game;
     InitializeComponent();
     filtersList.ItemsSource =
         Enumerable.Repeat<object>("First", 1).Union(
             Enumerable.Repeat<object>(new SetPropertyDef(Game.Sets()), 1).Union(
                 game.AllProperties().Where(p => !p.Hidden)));
     GenerateColumns(game);
     //resultsGrid.ItemsSource = game.SelectCards(null).DefaultView;
     UpdateDataGrid(game.AllCards().ToDataTable(Game).DefaultView);
 }
开发者ID:haplo63,项目名称:OCTGN,代码行数:12,代码来源:SearchControl.xaml.cs

示例2: SearchControl

 public SearchControl(DataNew.Entities.Game game, DeckBuilderWindow deckWindow)
 {
     _deckWindow = deckWindow;
     NumMod = "";
     Game = game;
     InitializeComponent();
     filtersList.ItemsSource =
         Enumerable.Repeat<object>("First", 1).Union(
             Enumerable.Repeat<object>(new SetPropertyDef(Game.Sets()), 1).Union(
                 game.AllProperties().Where(p => !p.Hidden)));
     GenerateColumns(game);
     //resultsGrid.ItemsSource = game.SelectCards(null).DefaultView;
     UpdateDataGrid(game.AllCards().ToDataTable(Game).DefaultView);
     FileName = "";
     UpdateCount();
 }//Why are we populating the list on load? I'd rather wait until the search is run with no parameters (V)_V
开发者ID:rexperalta,项目名称:OCTGN,代码行数:16,代码来源:SearchControl.xaml.cs

示例3: SearchControl

        // Why are we poluting the code with snide comments instead of fixing the problem or making a generic TODO (V)_V
        // Actually, the more that I think about it, the more I think that the first comment is actually a bad idea. (V)_V
        public SearchControl(DataNew.Entities.Game loadedGame, SearchSave save)
        {
            NumMod = "";
            var game = GameManager.Get().GetById(save.GameId);
            if (game == null)
            {
                TopMostMessageBox.Show("You don't have the game for this search installed", "Oh No", MessageBoxButton.OK, MessageBoxImage.Error);
                save = null;
            }
            else if (loadedGame.Id != save.GameId)
            {
                TopMostMessageBox.Show(
                    "This search is for the game " + game.Name + ". You currently have the game " + loadedGame.Name
                    + " loaded so you can not load this search.", "Oh No", MessageBoxButton.OK, MessageBoxImage.Error);
                save = null;
            }
            Game = loadedGame;
            InitializeComponent();
            filtersList.ItemsSource =
                Enumerable.Repeat<object>("First", 1).Union(
                    Enumerable.Repeat<object>(new SetPropertyDef(Game.Sets()), 1).Union(
                        game.AllProperties().Where(p => !p.Hidden)));
            this.GenerateColumns(game);
            FileName = "";
            if (save != null)
            {

                this.SearchName = save.Name;
                this.FileName = save.FileName;
                // Load filters
                foreach (var filter in save.Filters)
                {
                    DataNew.Entities.PropertyDef prop;
                    if (filter.IsSetProperty)
                    {
                        prop = filtersList.Items.OfType<SetPropertyDef>().First();
                    }
                    else
                    {
                        prop =
                            loadedGame.CustomProperties.FirstOrDefault(
                                x => x.Name.Equals(filter.PropertyName, StringComparison.InvariantCultureIgnoreCase));
                    }
                    if (prop == null) continue;

                    filterList.Items.Add(prop);
                }
                this.Loaded += (sender, args) =>
                    {
                        var generator = filterList.ItemContainerGenerator;
                        for (int i = 0; i < filterList.Items.Count; i++)
                        {
                            DependencyObject container = generator.ContainerFromIndex(i);
                            var filterCtrl = (FilterControl)VisualTreeHelper.GetChild(container, 0);
                            var filter = save.Filters[i];
                            filterCtrl.SetFromSave(Game, filter);
                        }
                        this.RefreshSearch(SearchButton, null);
                    };
            }
            this.UpdateDataGrid(game.AllCards().ToDataTable(Game).DefaultView);
            UpdateCount();
        }
开发者ID:jonbonne,项目名称:OCTGN,代码行数:65,代码来源:SearchControl.xaml.cs

示例4: SearchControl

 public SearchControl(DataNew.Entities.Game game, DeckBuilderWindow deckWindow)
 {
     _deckWindow = deckWindow;
     NumMod = "";
     Game = game;
     InitializeComponent();
     filtersList.ItemsSource =
         Enumerable.Repeat<object>("First", 1).Union(
             Enumerable.Repeat<object>(new SetPropertyDef(Game.Sets().Where(x => x.Hidden == false)), 1).Union(
                 game.AllProperties().Where(p => !p.Hidden)));
     GenerateColumns(game);
     //resultsGrid.ItemsSource = game.SelectCards(null).DefaultView;
     UpdateDataGrid(game.AllCards(true).ToDataTable(Game).DefaultView);
     FileName = "";
     UpdateCount();
 }
开发者ID:octgn,项目名称:OCTGN,代码行数:16,代码来源:SearchControl.xaml.cs


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