Ejemplo n.º 1
0
        ObservableCollection <DependencyModel> LoadDependencies()
        {
            RemoveEnabled = false;
            ObservableCollection <DependencyModel> dependencies = new ObservableCollection <DependencyModel>();

            _iswixDependencies = new IsWiXDependencies();

            foreach (var iswixDependency in _iswixDependencies)
            {
                DependencyModel dependency = new DependencyModel();
                dependency.RequiredId       = iswixDependency.RequiredId;
                dependency.RequiredLanguage = iswixDependency.RequiredLanguage;
                dependency.RequiredVersion  = iswixDependency.RequiredVersion;
                dependencies.Add(dependency);
            }
            return(dependencies);
        }
Ejemplo n.º 2
0
        public void Read(XDocument Document)
        {
            _dependencies = new IsWiXDependencies(Document);

            dependencies.Tables[0].RowDeleting -= new DataRowChangeEventHandler(Dependencies_RowAddRemove);
            dependencies.Tables[0].RowChanging -= new DataRowChangeEventHandler(Dependencies_RowAddRemove);
            dependencies.Tables[0].Clear();

            try
            {
                foreach (var dependency in _dependencies)
                {
                    dependencies.Tables[0].Rows.Add(new object[] { dependency.RequiredId, dependency.RequiredLanguage, dependency.RequiredVersion });
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            dependencies.Tables[0].RowChanging += new DataRowChangeEventHandler(Dependencies_RowAddRemove);
            dependencies.Tables[0].RowDeleting += new DataRowChangeEventHandler(Dependencies_RowAddRemove);
        }