Ejemplo n.º 1
0
        async Task HandleExport(ExportEvent <TModel> evt)
        {
            string fileName, filterName;

            string [] extensions;

            TModel template = evt.Object;

            Log.Debug("Exporting " + TemplateName);
            filterName = FilterText;
            extensions = new [] { "*" + Extension };
            /* Show a file chooser dialog to select the file to export */
            fileName = App.Current.Dialogs.SaveFile(Catalog.GetString("Export dashboard"),
                                                    System.IO.Path.ChangeExtension(template.Name, Extension),
                                                    App.Current.HomeDir, filterName, extensions);

            if (fileName != null)
            {
                fileName = System.IO.Path.ChangeExtension(fileName, Extension);
                if (App.Current.FileSystemManager.FileExists(fileName))
                {
                    string msg = AlreadyExistsText + " " + OverwriteText;
                    evt.ReturnValue = await App.Current.Dialogs.QuestionMessage(msg, null);

                    if (!evt.ReturnValue)
                    {
                        return;
                    }
                }
                Serializer.Instance.Save(template, fileName);
                App.Current.Dialogs.InfoMessage(ExportedCorrectlyText);
            }
        }
Ejemplo n.º 2
0
        internal void Export(dynamic script, string directory)
        {
            PmxModel.FinalizeModel(VmdSequence.MorphFrameDict.Values.Select(t => t.frame));
            VmdSequence.FinalizeKeyFrame(PmxModel.ModelData.MorphArray);

            ExportEvent?.Invoke(this, new ExportEventArgs(Path.Combine(directory, ExportFileName + ".pmx"), Path.Combine(directory, ExportFileName + ".vmd"))
            {
                Script = script
            });
        }
        protected override void onInstanceActivated(ConceptInstance instance, BeamGenerator generator)
        {
            var subject     = generator.GetValue(instance, Concept2.Subject);
            var description = generator.GetValue(instance, Concept2.Description);

            var conceptDescription = new ConceptDescriptionEvent(subject.Concept, description.Concept.Name);
            var export             = new ExportEvent(conceptDescription);

            generator.Push(export);
            generator.Push(conceptDescription);
        }
Ejemplo n.º 4
0
        public ActionResult Download(string clientid, string historyid)
        {
            string       filePath = @"D:/temp"; //Server.MapPath(System.Configuration.ConfigurationManager.AppSettings["FileManagementPath"]);
            ImportExport im       = new ImportExport(clientid);
            ExportEvent  ev       = im.getExportEvent(historyid);

            string actualFilePath = filePath + "" + ev.FolderPath;
            string filename       = Path.GetFileName(actualFilePath);

            byte[] fileBytes = System.IO.File.ReadAllBytes(actualFilePath);
            return(File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, filename));
        }
Ejemplo n.º 5
0
        public void StartProcessing(CancellationToken cancellationToken = default(CancellationToken),
                                    string clientid = "", ExportSettings exportSettings = null)
        {
            Tz.Net.DataSchema.ImportExport iex = new Net.DataSchema.ImportExport(clientid);
            if (exportSettings == null)
            {
                exportSettings = new ExportSettings();
            }
            ExportEvent exportEvent = iex.ExportScheduleNow(exportSettings, @"D:/temp");

            exportEvent.ExecuteNow();
        }
Ejemplo n.º 6
0
        protected virtual async Task HandleExport(ExportEvent <TModel> evt)
        {
            Project          project = evt.Object;
            IProjectExporter exporter;

            if (project == null)
            {
                return;
            }

            try {
                exporter = App.Current.DependencyRegistry.Retrieve <IProjectExporter> (InstanceType.Default);
            } catch (Exception ex) {
                Log.Exception(ex);
                App.Current.Dialogs.ErrorMessage(string.Format(
                                                     Catalog.GetString("No project exporter found for format {0}"), evt.Format));
                return;
            }

            await exporter.Export(project);
        }
Ejemplo n.º 7
0
 private void OnExport(EventArgs e)
 {
     ExportEvent?.Invoke(this, e);
 }
Ejemplo n.º 8
0
 internal virtual void Visit(ExportEvent evt)
 {
     // nothing do to do by default
 }