Esempio n. 1
0
 public void Shown(IWizardStage previous, WizardDirection direction)
 {
     if (direction == WizardDirection.Forward)
     {
         this.Previous = previous;
     }
 }
 public override bool OnPageExit(WizardDirection todirection)
 {
     ImportContext.FieldMappings = _model.Select((vm) => {
         return(vm.Model);
     });
     return(true);
 }
 /// <summary>
 /// Occurs when the users clicks on Cancel.
 /// So close the wizard form with DialogResult=Cancel.
 /// </summary>
 private void OnWizardCancel(object sender, HandledEventArgs e)
 {
     if (e != null && e.Handled == false)
     {
         wizardDirection   = WizardDirection.Initializing;
         this.DialogResult = DialogResult.Cancel;
     }
 }
 /// <summary>
 /// Occurs when the users clicks on Back.
 /// So display the previous page in the wizard.
 /// </summary>
 private void OnWizardBack(object sender, HandledEventArgs e)
 {
     if (e != null && e.Handled == false)
     {
         wizardStep--;
         wizardDirection = WizardDirection.MovingBack;
         DisplayActiveWizardPage();
     }
 }
        /// <summary>
        /// Occurs when the wizard form is first loaded.
        /// So display the first wizard page.
        /// </summary>
        private void OnShown(object sender, EventArgs e)
        {
            ShowMovementButtons = true;
            ShowRepeatWizard    = false;
            ShowOKButton        = false;

            wizardStep      = 0;
            wizardDirection = WizardDirection.Initializing;
            RepeatWizard    = false;
            DisplayActiveWizardPage();
        }
Esempio n. 6
0
        public void Shown(IWizardStage previous, WizardDirection direction)
        {
            if (direction == WizardDirection.Forward)
            {
                this.m_previousStage = previous;
            }
            tmrStatus.Enabled = true;
            this.loadAssemblies();
            m_gpmrRenderPipeline = new Pipeline();
            //m_gpmrRenderPipeline.StateChanged += new StateChangeHandler(m_gpmrRenderPipeline_StateChanged);

            bwStatus.RunWorkerAsync();
        }
Esempio n. 7
0
        public void Shown(IWizardStage previous, WizardDirection direction)
        {
            if (direction == WizardDirection.Forward)
                this.Previous = previous;

            string renderName = "";
            switch (Program.s_parameters["renderer"][0])
            {
                case "RIMBA_CS":
                    renderName = "RIM Based C#";
                    break;
                case "RIMBA_JA":
                    renderName = "RIM Based Java";
                    break;
                case "DEKI":
                    renderName = "DEKI Wiki / HTML";
                    break;
                case "XSD":
                    renderName = "XML Renderer";
                    break;
            }

            // Assemble information
            StringBuilder options = new StringBuilder();
            options.AppendFormat("Mode: {0}\r\n", Program.s_parameters.ContainsKey("quirks") ? "Quirks" : Program.s_parameters.ContainsKey("strict") ? "Strict" : "Normal");
            options.AppendFormat("Renderer: {0}\r\n", renderName);
            options.AppendFormat("Output Directory: {0}\r\n", Program.s_parameters["o"][0]);
            options.Append("Files:\r\n");
            foreach (var f in Program.s_parameters["s"])
                options.AppendFormat("\t{0}\r\n", Path.GetFileName(f));

            txtParameters.Text = options.ToString();

            StringBuilder cmdBuilder = new StringBuilder("gpmr -c");
            foreach (var kv in Program.s_parameters)
            {

                if (kv.Value == null)
                    cmdBuilder.AppendFormat(" --{0}", kv.Key);
                else
                    foreach (var itm in kv.Value)
                    {
                        if (kv.Key.Length == 1)
                            cmdBuilder.AppendFormat(" -{0} \"{1}\"", kv.Key, itm);
                        else
                            cmdBuilder.AppendFormat(" --{0}=\"{1}\"", kv.Key, itm);
                    }
            }
            txtCommandLine.Text = cmdBuilder.ToString();
        }
        public override void OnPageEnter(WizardDirection fromdirection)
        {
            var progress = new ProgressWindow(this.FindParentWindow(), "Extracting column information from data source...", true);

            _fields = _fieldSource();
            lvwFields.ItemsSource = _fields;

            CollectionView           myView           = (CollectionView)CollectionViewSource.GetDefaultView(lvwFields.ItemsSource);
            PropertyGroupDescription groupDescription = new PropertyGroupDescription("Category");

            myView.GroupDescriptions.Add(groupDescription);
            var model = new List <ImportFieldMapping>();

            JobExecutor.QueueJob(() => {
                List <String> columns = null;
                columns = ImportContext.Importer.GetColumnNames();

                var existingMappings = ImportContext.FieldMappings;
                if (existingMappings != null && existingMappings.Count() > 0)
                {
                    foreach (ImportFieldMapping mapping in existingMappings)
                    {
                        model.Add(mapping);
                    }
                }
                else
                {
                    foreach (string columnName in columns)
                    {
                        var mapping = new ImportFieldMapping {
                            SourceColumn = columnName
                        };
                        model.Add(mapping);
                    }
                }

                _model = new ObservableCollection <ImportFieldMappingViewModel>(model.Select((m) => {
                    return(new ImportFieldMappingViewModel(m));
                }));

                lvwMappings.InvokeIfRequired(() => {
                    lvwMappings.ItemsSource = _model;
                });

                progress.InvokeIfRequired(() => {
                    progress.Dispose();
                });
            });
        }
        /// <summary>
        /// Fired when the wizard stage is shown
        /// </summary>
        public void Shown(IWizardStage previous, WizardDirection direction)
        {
            var installDir = Host.Parameters.Find(o => o.Name == "InstallDir") as ValueDataParameter;

            AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += new ResolveEventHandler(CurrentDomain_ReflectionOnlyAssemblyResolve);
            // Scan the installation director
            foreach (var file in Directory.GetFiles(Path.Combine(installDir.Value.ToString(), "lib"), "*.dll"))
            {
                try
                {
                    Assembly asm      = Assembly.ReflectionOnlyLoadFrom(file);
                    var      cad      = CustomAttributeData.GetCustomAttributes(asm);
                    bool     isGPMR   = false;
                    string   desc     = string.Empty,
                             iVersion = string.Empty;
                    foreach (var ad in cad)
                    {
                        isGPMR |= (ad.ToString().Contains("AssemblyDescription") && ad.ConstructorArguments[0].Value.ToString().Contains("GPMR"));
                        if (ad.ToString().Contains("AssemblyTitleAttribute"))
                        {
                            desc = ad.ConstructorArguments[0].Value.ToString();
                        }
                        else if (ad.ToString().Contains("AssemblyInformationalVersion"))
                        {
                            iVersion = ad.ConstructorArguments[0].Value.ToString();
                        }
                    }
                    if (isGPMR)
                    {
                        cboGPMR.Items.Add(new DisplayableKeyValuePair <String, String>(String.Format("{0} ({1})", desc, iVersion), file));
                    }
                    else if (!String.IsNullOrEmpty(desc))
                    {
                        cklFeatures.Items.Add(new DisplayableKeyValuePair <String, String>(desc, file));
                        if (Path.GetFileNameWithoutExtension(file).Equals("MARC.Everest"))
                        {
                            cklFeatures.SetItemChecked(cklFeatures.Items.Count - 1, true);
                        }
                    }
                }
                catch (Exception) { }
            }
            AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve -= new ResolveEventHandler(CurrentDomain_ReflectionOnlyAssemblyResolve);
            cboGPMR.SelectedIndex = 0;
        }
        public override bool OnPageExit(WizardDirection todirection)
        {
            var selected = listBox.SelectedItem as TabularDataImporter;

            if (selected != null)
            {
                var c = WizardContext as ImportWizardContext;
                if (c != null)
                {
                    if (selected.GetOptions(this.FindParentWindow(), c))
                    {
                        c.Importer = selected;
                        return(true);
                    }
                }
            }
            return(false);
        }
        /// <summary>
        /// Occurs when the users clicks on Finish.
        /// </summary>
        private void OnWizardFinish(object sender, HandledEventArgs e)
        {
            if (e != null && e.Handled == false)
            {
                wizardDirection = WizardDirection.Finishing;

                if (hasFinishPage)
                {
                    // If the wizard has a finish page,
                    // then display it.
                    DisplayFinishPage();
                }
                else
                {
                    // If the wizard does not have a finish page,
                    // then close the wizard form with DialogResult=OK.
                    this.DialogResult = DialogResult.OK;
                }
            }
        }
Esempio n. 12
0
        public void ShowStage(IWizardStage stage, WizardDirection direction)
        {
            System.Diagnostics.Trace.WriteLine(String.Format("Showing stage {0}...", stage.StageName));

            lblStatus.Text = stage.StageName;

            stage.Host = this;
            pnlContent.Controls.Clear();
            pnlContent.Controls.Add(stage as Control);

            // Setup buttons
            btnNextFinish.Text = stage.IsTerminal ? "Finish" : "Next";
            btnExitPrevious.Text = stage.CanExit ? "Cancel" : "Back";

            if (CurrentStage != null)
                CurrentStage.Hiding();

            stage.Shown(CurrentStage, direction); 

            CurrentStage = stage;
        }
Esempio n. 13
0
        public void ShowStage(IWizardStage stage, WizardDirection dir)
        {
            System.Diagnostics.Trace.WriteLine(String.Format("Showing stage {0}...", stage.StageName));

            if (CurrentStage != null)
            {
                try
                {
                    CurrentStage.Hiding();
                }
                catch (Exception e)
                {
                    if (dir == WizardDirection.Forward)
                    {
                        MessageBox.Show(e.Message);
                        return;
                    }
                }
            }

            lblStatus.Text = stage.StageName;

            stage.Host = this;
            pnlContent.Controls.Clear();
            pnlContent.Controls.Add(stage as Control);

            // Setup buttons
            btnNextFinish.Text   = stage.IsTerminal ? "Finish" : "Next";
            btnExitPrevious.Text = stage.CanExit ? "Cancel" : "Back";

            var prevStage = CurrentStage;

            CurrentStage = stage;
            UpdateNextPrev();

            CurrentStage.Shown(prevStage, dir);

            // Select the stage
            SelectCurrentStage(trvStages.Nodes);
        }
Esempio n. 14
0
        public void ShowStage(IWizardStage stage, WizardDirection dir)
        {
            System.Diagnostics.Trace.WriteLine(String.Format("Showing stage {0}...", stage.StageName));

            if (CurrentStage != null)
            {
                try
                {
                    CurrentStage.Hiding();
                }
                catch(Exception e)
                {
                    if (dir == WizardDirection.Forward)
                    {
                        MessageBox.Show(e.Message);
                        return;
                    }
                }
            }

            lblStatus.Text = stage.StageName;

            stage.Host = this;
            pnlContent.Controls.Clear();
            pnlContent.Controls.Add(stage as Control);

            // Setup buttons
            btnNextFinish.Text = stage.IsTerminal ? "Finish" : "Next";
            btnExitPrevious.Text = stage.CanExit ? "Cancel" : "Back";

            var prevStage = CurrentStage;
            CurrentStage = stage;
            UpdateNextPrev();

            CurrentStage.Shown(prevStage, dir); 

            // Select the stage
            SelectCurrentStage(trvStages.Nodes);
        }
Esempio n. 15
0
        public void ShowStage(IWizardStage stage, WizardDirection direction)
        {
            System.Diagnostics.Trace.WriteLine(String.Format("Showing stage {0}...", stage.StageName));

            lblStatus.Text = stage.StageName;

            stage.Host = this;
            pnlContent.Controls.Clear();
            pnlContent.Controls.Add(stage as Control);

            // Setup buttons
            btnNextFinish.Text   = stage.IsTerminal ? "Finish" : "Next";
            btnExitPrevious.Text = stage.CanExit ? "Cancel" : "Back";

            if (CurrentStage != null)
            {
                CurrentStage.Hiding();
            }

            stage.Shown(CurrentStage, direction);

            CurrentStage = stage;
        }
Esempio n. 16
0
        /// <summary>
        /// Fired when the wizard stage is shown
        /// </summary>
        public void Shown(IWizardStage previous, WizardDirection direction)
        {

            var installDir = Host.Parameters.Find(o => o.Name == "InstallDir") as ValueDataParameter;

            AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += new ResolveEventHandler(CurrentDomain_ReflectionOnlyAssemblyResolve);
            // Scan the installation director
            foreach (var file in Directory.GetFiles(Path.Combine(installDir.Value.ToString(), "lib"), "*.dll"))
            {
                try
                {
                    Assembly asm = Assembly.ReflectionOnlyLoadFrom(file);
                    var cad = CustomAttributeData.GetCustomAttributes(asm);
                    bool isGPMR = false;
                    string desc = string.Empty,
                        iVersion = string.Empty;
                    foreach (var ad in cad)
                    {
                        isGPMR |= (ad.ToString().Contains("AssemblyDescription") && ad.ConstructorArguments[0].Value.ToString().Contains("GPMR"));
                        if (ad.ToString().Contains("AssemblyTitleAttribute"))
                            desc = ad.ConstructorArguments[0].Value.ToString();
                        else if (ad.ToString().Contains("AssemblyInformationalVersion"))
                            iVersion = ad.ConstructorArguments[0].Value.ToString();

                    }
                    if (isGPMR)
                        cboGPMR.Items.Add(new DisplayableKeyValuePair<String, String>(String.Format("{0} ({1})", desc, iVersion), file));
                    else if (!String.IsNullOrEmpty(desc))
                    {
                        cklFeatures.Items.Add(new DisplayableKeyValuePair<String, String>(desc, file));
                        if (Path.GetFileNameWithoutExtension(file).Equals("MARC.Everest"))
                            cklFeatures.SetItemChecked(cklFeatures.Items.Count - 1, true);
                    }
                }
                catch (Exception) { }
            }
            AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve -= new ResolveEventHandler(CurrentDomain_ReflectionOnlyAssemblyResolve);
            cboGPMR.SelectedIndex = 0;
        }
Esempio n. 17
0
        public void Shown(IWizardStage previous, WizardDirection direction)
        {
            if (direction == WizardDirection.Forward)
            {
                this.Previous = previous;
            }

            string renderName = "";

            switch (Program.s_parameters["renderer"][0])
            {
            case "RIMBA_CS":
                renderName = "RIM Based C#";
                break;

            case "RIMBA_JA":
                renderName = "RIM Based Java";
                break;

            case "DEKI":
                renderName = "DEKI Wiki / HTML";
                break;

            case "XSD":
                renderName = "XML Renderer";
                break;
            }

            // Assemble information
            StringBuilder options = new StringBuilder();

            options.AppendFormat("Mode: {0}\r\n", Program.s_parameters.ContainsKey("quirks") ? "Quirks" : Program.s_parameters.ContainsKey("strict") ? "Strict" : "Normal");
            options.AppendFormat("Renderer: {0}\r\n", renderName);
            options.AppendFormat("Output Directory: {0}\r\n", Program.s_parameters["o"][0]);
            options.Append("Files:\r\n");
            foreach (var f in Program.s_parameters["s"])
            {
                options.AppendFormat("\t{0}\r\n", Path.GetFileName(f));
            }

            txtParameters.Text = options.ToString();

            StringBuilder cmdBuilder = new StringBuilder("gpmr -c");

            foreach (var kv in Program.s_parameters)
            {
                if (kv.Value == null)
                {
                    cmdBuilder.AppendFormat(" --{0}", kv.Key);
                }
                else
                {
                    foreach (var itm in kv.Value)
                    {
                        if (kv.Key.Length == 1)
                        {
                            cmdBuilder.AppendFormat(" -{0} \"{1}\"", kv.Key, itm);
                        }
                        else
                        {
                            cmdBuilder.AppendFormat(" --{0}=\"{1}\"", kv.Key, itm);
                        }
                    }
                }
            }
            txtCommandLine.Text = cmdBuilder.ToString();
        }
Esempio n. 18
0
 public void Shown(IWizardStage previous, WizardDirection direction)
 {
 }
Esempio n. 19
0
 public override bool OnPageExit(WizardDirection todirection)
 {
     var selected = listBox.SelectedItem as TabularDataImporter;
     if (selected != null) {
         var c = WizardContext as ImportWizardContext;
         if (c != null) {
             if (selected.GetOptions(this.FindParentWindow(), c)) {
                 c.Importer = selected;
                 return true;
             }
         }
     }
     return false;
 }
Esempio n. 20
0
 /// <summary>
 /// Occurs when the users clicks on Cancel.
 /// So close the wizard form with DialogResult=Cancel.
 /// </summary>
 private void OnWizardCancel(object sender, HandledEventArgs e)
 {
     if (e != null && e.Handled == false)
     {
         wizardDirection = WizardDirection.Initializing;
         this.DialogResult = DialogResult.Cancel;
     }
 }
Esempio n. 21
0
        /// <summary>
        /// Occurs when the wizard form is first loaded.
        /// So display the first wizard page.
        /// </summary>
        private void OnShown(object sender, EventArgs e)
        {
            ShowMovementButtons = true;
            ShowRepeatWizard = false;
            ShowOKButton = false;

            wizardStep = 0;
            wizardDirection = WizardDirection.Initializing;
            RepeatWizard = false;
            DisplayActiveWizardPage();


        }
Esempio n. 22
0
 /// <summary>
 /// Occurs when the users clicks on Back.
 /// So display the previous page in the wizard.
 /// </summary>
 private void OnWizardBack(object sender, HandledEventArgs e)
 {
     if (e != null && e.Handled == false)
     {
         wizardStep--;
         wizardDirection = WizardDirection.MovingBack;
         DisplayActiveWizardPage();
     }
 }
Esempio n. 23
0
 public virtual bool OnPageExit(WizardDirection todirection)
 {
     return(true);
 }
Esempio n. 24
0
 public override bool OnPageExit(WizardDirection todirection)
 {
     ImportContext.FieldMappings = _model.Select((vm) => {
         return vm.Model;
     });
     return true;
 }
Esempio n. 25
0
        public override void OnPageEnter(WizardDirection fromdirection)
        {
            var progress = new ProgressWindow(this.FindParentWindow(), "Extracting column information from data source...", true);

            _fields = _fieldSource();
            lvwFields.ItemsSource = _fields;

            CollectionView myView = (CollectionView)CollectionViewSource.GetDefaultView(lvwFields.ItemsSource);
            PropertyGroupDescription groupDescription = new PropertyGroupDescription("Category");
            myView.GroupDescriptions.Add(groupDescription);
            var model = new List<ImportFieldMapping>();

            JobExecutor.QueueJob(() => {

                List<String> columns = null;
                columns = ImportContext.Importer.GetColumnNames();

                var existingMappings = ImportContext.FieldMappings;
                if (existingMappings != null && existingMappings.Count() > 0) {
                    foreach (ImportFieldMapping mapping in existingMappings) {
                        model.Add(mapping);
                    }
                } else {
                    foreach (string columnName in columns) {
                        var mapping = new ImportFieldMapping { SourceColumn = columnName };
                        model.Add(mapping);
                    }
                }

                _model = new ObservableCollection<ImportFieldMappingViewModel>(model.Select((m) => {
                    return new ImportFieldMappingViewModel(m);
                }));

                lvwMappings.InvokeIfRequired(() => {
                    lvwMappings.ItemsSource = _model;
                });

                progress.InvokeIfRequired(() => {
                    progress.Dispose();
                });

            });
        }
Esempio n. 26
0
 /// <summary>
 /// Called when shown
 /// </summary>
 public void Shown(IWizardStage previous, WizardDirection direction)
 {
     
 }
Esempio n. 27
0
 public virtual void OnPageEnter(WizardDirection fromdirection)
 {
 }
Esempio n. 28
0
        public void Shown(IWizardStage previous, WizardDirection direction)
        {

            if(direction == WizardDirection.Forward)
                this.m_previousStage = previous;
            tmrStatus.Enabled = true;
            this.loadAssemblies();
            m_gpmrRenderPipeline = new Pipeline();
            //m_gpmrRenderPipeline.StateChanged += new StateChangeHandler(m_gpmrRenderPipeline_StateChanged);

            bwStatus.RunWorkerAsync();
        }
Esempio n. 29
0
 /// <summary>
 /// Shown
 /// </summary>
 public void Shown(IWizardStage previous, WizardDirection direction)
 {
     if (direction == WizardDirection.Forward)
         this.Previous = previous;
 }
Esempio n. 30
0
        /// <summary>
        /// Occurs when the users clicks on Finish.
        /// </summary>
        private void OnWizardFinish(object sender, HandledEventArgs e)
        {
            if (e != null && e.Handled == false)
            {
                wizardDirection = WizardDirection.Finishing;

                if (hasFinishPage)
                {
                    // If the wizard has a finish page,
                    // then display it.
                    DisplayFinishPage();
                }
                else
                {
                    // If the wizard does not have a finish page,
                    // then close the wizard form with DialogResult=OK.
                    this.DialogResult = DialogResult.OK;
                }
            }
        }
Esempio n. 31
0
 public virtual bool OnPageExit(WizardDirection todirection)
 {
     return true;
 }
Esempio n. 32
0
 public virtual void OnPageEnter(WizardDirection fromdirection)
 {
 }