Ejemplo n.º 1
0
        public FolderSchemaViewModel(
            Models.MainSettings mainSettings,
            Models.FolderSchema schema,
            FolderSchemaViewModel parent,
            String log)
        {
            _log          = log;
            _mainSettings = mainSettings;

            _schema       = new Models.XmlAnything <Models.ISchema>();
            _schema.Value = schema;
            _parent       = parent;

            _schemasViewModels = new ObservableCollection <ISchemaViewModel>();
            foreach (Models.XmlAnything <Models.ISchema> xmlChild in (_schema.Value as Models.FolderSchema).Children)
            {
                if (typeof(Models.FolderSchema) == xmlChild.Value.GetType())
                {
                    _schemasViewModels.Add(
                        new FolderSchemaViewModel(
                            mainSettings,
                            xmlChild.Value as Models.FolderSchema,
                            this,
                            log
                            )
                        );
                }
                if (typeof(Models.FileSchema) == xmlChild.Value.GetType())
                {
                    _schemasViewModels.Add(
                        new FileSchemaViewModel(
                            _mainSettings,
                            xmlChild.Value as Models.FileSchema,
                            this,
                            log
                            )
                        );
                }
            }

            AddDataCommand         = new Commands.AddDataCommand(this);
            RemoveDataCommand      = new Commands.RemoveDataCommand(this);
            AddFileSchemaCommand   = new Commands.AddFileSchemaCommand(this);
            AddFolderSchemaCommand = new Commands.AddFolderSchemaCommand(this);
            RemoveSchemaCommand    = new Commands.RemoveSchemaCommand(this);
        }
        public FileSchemaViewModel(
            Models.MainSettings mainSettings,
            Models.FileSchema schema,
            FolderSchemaViewModel parent,
            String log)
        {
            _log          = log;
            _mainSettings = mainSettings;

            _schema       = new Models.XmlAnything <Models.ISchema>();
            _schema.Value = schema;
            _parent       = parent;

            _engine = new Models.AutoDossierEngine(_mainSettings, schema, parent, _log);

            AddDataCommand     = new Commands.AddDataCommand(this);
            RemoveDataCommand  = new Commands.RemoveDataCommand(this);
            EngineOnOffCommand = new Commands.EngineOnOffCommand(this);
        }