Example #1
0
        protected override bool DoRun()
        {
            if (IsBrepFormat(SourceFilePathResolvedValue))
            {
                var extn = Path.GetExtension(SourceFilePathResolvedValue).ToLowerInvariant();
                var fmt  = Utils.BrepFormats[extn];
                var opts = ExportOptions.Create();

                opts.ExportNames            = true;
                opts.Step.ExportIdentifiers = true;

                var doc = Window.ActiveWindow.Document;

                doc.MainPart.Export(fmt, SourceFilePathResolvedValue, true, opts);
            }
            else
            {
                var fmt      = TessellatedFormat(SourceFilePathResolvedValue);
                var extn     = TessellatedExtension(fmt);
                var fileName = Path.ChangeExtension(SourceFilePathResolvedValue, extn);

                Window.ActiveWindow.ExportPart(fmt, fileName);
            }

            return(true);
        }
        public Task <IAsyncEnumerator <RavenJObject> > ExportItems(ItemType types, OperationState state)
        {
            var options = ExportOptions.Create(state, types, Options.ExportDeletions, Options.Limit);

            var client = (AsyncServerClient)Store.AsyncDatabaseCommands;

            return(client.StreamExportAsync(options));
        }
Example #3
0
        public Task <IAsyncEnumerator <RavenJObject> > ExportItems(ItemType types, OperationState state)
        {
            var exporter = new SmugglerExporter(database, ExportOptions.Create(state, types, Options.ExportDeletions, Options.Limit));

            var items = new List <RavenJObject>();

            exporter.Export(items.Add, database.WorkContext.CancellationToken);

            return(new CompletedTask <IAsyncEnumerator <RavenJObject> >(new AsyncEnumeratorBridge <RavenJObject>(items.GetEnumerator())));
        }