示例#1
0
        public void Load()
        {
            using (var reader = new ZipReadOperator(backup))
                using (var xml = XmlReader.Create(reader.GetEntry(XML_NAME)))
                {
                    var root = XDocument.Load(xml).Element(ROOT);
                    if (root == null)
                    {
                        return;
                    }

                    var tenant = int.Parse(root.Attribute("tenant").Value);
                    SetupProgress(tenant);
                    foreach (var provider in providers.Values)
                    {
                        try
                        {
                            var element = root.Element(provider.Name);
                            provider.LoadFrom(element != null ? element.Elements() : new XElement[0], tenant, configs, reader);
                        }
                        catch (Exception ex)
                        {
                            OnProgressError(ex);
                        }
                    }
                }
        }
示例#2
0
        public void Load()
        {
            using (var reader = new ZipReadOperator(backup))
                using (var xml = XmlReader.Create(reader.GetEntry(XML_NAME)))
                {
                    var root = XDocument.Load(xml).Element(ROOT);
                    if (root == null)
                    {
                        return;
                    }

                    var tenant = int.Parse(root.Attribute("tenant").Value);
                    foreach (var provider in providers.Values)
                    {
                        var element = root.Element(provider.Name);
                        provider.LoadFrom(element != null ? element.Elements() : new XElement[0], tenant, configs, reader);
                    }
                }
            ProgressChanged(this, new ProgressChangedEventArgs(string.Empty, 100, true));
        }
示例#3
0
        public void Load()
        {
            using (var reader = new ZipReadOperator(backup))
            using (var xml = XmlReader.Create(reader.GetEntry(XML_NAME)))
            {
                var root = XDocument.Load(xml).Element(ROOT);
                if (root == null) return;

                var tenant = int.Parse(root.Attribute("tenant").Value);
                SetupProgress(tenant);
                foreach (var provider in providers.Values)
                {
                    try
                    {
                        var element = root.Element(provider.Name);
                        provider.LoadFrom(element != null ? element.Elements() : new XElement[0], tenant, configs, reader);
                    }
                    catch (Exception ex)
                    {
                        OnProgressError(ex);
                    }
                }
            }
        }
        public void Load()
        {
            using (var reader = new ZipReadOperator(backup))
            using (var xml = XmlReader.Create(reader.GetEntry(XML_NAME)))
            {
                var root = XDocument.Load(xml).Element(ROOT);
                if (root == null) return;

                var tenant = int.Parse(root.Attribute("tenant").Value);
                foreach (var provider in providers.Values)
                {
                    var element = root.Element(provider.Name);
                    provider.LoadFrom(element != null ? element.Elements() : new XElement[0], tenant, configs, reader);
                    ++providersProcessed;
                }
            }
            ProgressChanged(this, new ProgressChangedEventArgs(string.Empty, 100, true));
        }