Esempio n. 1
0
        private void ExportCsItemOnSelected(object sender1, EventArgs eventArgs)
        {
            var dlg = new ExportOptionsDialog();

            dlg.ShowModal(_desktop);

            dlg.Closed += (s, a) =>
            {
                if (!dlg.Result)
                {
                    return;
                }

                try
                {
                    Project.ExportOptions.Namespace  = dlg._textNamespace.Text;
                    Project.ExportOptions.OutputPath = dlg._textOutputPath.Text;
                    Project.ExportOptions.Class      = dlg._textClassName.Text;

                    UpdateSource();

                    using (var export = new ExporterCS(Instance.Project))
                    {
                        var strings = new List <string>
                        {
                            "Success. Following files had been written:"
                        };
                        strings.AddRange(export.Export());

                        var msg = Dialog.CreateMessageBox("Export To C#", string.Join("\n", strings));
                        msg.ShowModal(_desktop);
                    }
                }
                catch (Exception ex)
                {
                    var msg = Dialog.CreateMessageBox("Error", ex.Message);
                    msg.ShowModal(_desktop);
                }
            };
        }
Esempio n. 2
0
        private void ExportCsItemOnSelected(object sender1, EventArgs eventArgs)
        {
            var dlg = new ExportOptionsDialog();

            dlg.ShowModal(_desktop);
        }