示例#1
0
 public DesignPatternDataItem(String uniqueId, String designPatterName, String description, String path, String imagePath, DesignPatternDataGroup group)
     : base(uniqueId, designPatterName)
 {
     _group       = group;
     _description = description;
     _path        = path;
     _imagePath   = imagePath;
     _baseUri     = new Uri("ms-appx:///DesignPatternsManagerW8/DesignPatternsTemplates/");
 }
示例#2
0
        public async Task PopulateDesignPatterns()
        {
            var fileManager          = new FileManager();
            var designPatternUpdater = new DesignPatternsReader(fileManager);

            var designpatternList = await designPatternUpdater.UpdateDesignPatterns(true);

            var designPatternTypesList = from p in designpatternList
                                         group p by p.DesignPatternType
                                         into t
                                         select t;

            foreach (var designPatternType in designPatternTypesList)
            {
                var group = new DesignPatternDataGroup(designPatternType.Key, designPatternType.Key);
                foreach (var designPattern in designPatternType)
                {
                    var item = new DesignPatternDataItem(designPattern.Id.ToString(), designPattern.DesignPatternName,
                                                         designPattern.Description, designPattern.Path, designPattern.Path.Replace(".xml", ".png"), group);
                    group.Items.Add(item);
                }
                _allGroups.Add(group);
            }
        }