예제 #1
0
        public MainDecoderViewModel(SchemaManager schemaManager, /* MetaDataFile metaDataFile,*/ PackFileService pf, bool allTablesReadOnly = true)
        {
            _pf            = pf;
            _schemaManager = schemaManager;

            TableDefinitionEditor = new TableDefinitionEditor(schemaManager, ActiveMentaDataContent, ActiveTableDefinition);
            DataTable             = new MetaDataTable(ActiveTableDefinition, ActiveMentaDataContent, pf, allTablesReadOnly);
            FieldExplorer         = new FieldExplorer(TableDefinitionEditor, ActiveMentaDataContent, ActiveTableDefinition);

            //ActiveMentaDataContent.File = metaDataFile;
        }
        //
        public FieldExplorer(TableDefinitionEditor tableDefEditor, ActiveMetaDataContentModel activeMetaDataContent, TableDefinitionModel tableDefinition)
        {
            Create(DbTypesEnum.String_ascii);
            Create(DbTypesEnum.Optstring_ascii);
            Create(DbTypesEnum.String);
            Create(DbTypesEnum.Optstring);
            Create(DbTypesEnum.Int64);
            Create(DbTypesEnum.Integer);
            Create(DbTypesEnum.Single);
            Create(DbTypesEnum.Float16);
            Create(DbTypesEnum.Short);
            Create(DbTypesEnum.Byte);
            Create(DbTypesEnum.Boolean);

            _tableDefEditor        = tableDefEditor;
            _tableDefinition       = tableDefinition;
            _activeMetaDataContent = activeMetaDataContent;

            _tableDefinition.DefinitionChanged            += OnTableDefinitionChanged;
            _activeMetaDataContent.SelectedTagItemChanged += OnSelectedTagItemChanged;
        }