public FrmGoogleTranslate(EntityLocalizationEntry[] dgvNewDataSource)
 {
     InitializeComponent();
     this.dgvNewDataSource = dgvNewDataSource;
     LoadOriginal();
 }
Exemplo n.º 2
0
        String GenerateOutput(EntityLocalizationEntry[] dsCurrent, EntityLocalizationEntry[] dsNew, EntityLocalizationEntry[] dsDeleted)
        {
            var list = new List<EntityLocalizationEntry>();
            if (dsCurrent != null) list.AddRange(dsCurrent);
            if (dsNew != null) list.AddRange(dsNew);
            if (dsDeleted != null) list.AddRange(dsDeleted);

            var blocks = (from c in list
                          where c.IsChecked
                          group c by new {
                              EntityNameForOverride = c.LocalizableProperty.EnclosingEntity.EntityNameForOverride,
                              IsDextopLocalize = c.LocalizableProperty.EnclosingEntity.IsDextopLocalize
                          } into grp
                          select new LocalizedEntityBlock {
                              EntityNameForOverride = grp.Key.EntityNameForOverride,
                              IsDextopLocalize = grp.Key.IsDextopLocalize,
                              LocalizationGridRows = grp.ToArray()
                          }
                    ).ToArray();

            var com = Composer.CreateComposer(LocalizerType);
            return com.GenerateOutputFile(blocks);
        }