Esempio n. 1
0
        static void Main(string[] args)
        {
            //Application a = new Application();
            //a.StartupUri = new Uri("MainWindow.xaml", System.UriKind.Relative);
            //a.Run();
            app = new System.Windows.Application();

            MainWindowClass window = new MainWindowClass();

            app.Run(window);
            //window.Show();
        }
Esempio n. 2
0
        /// <summary>
        /// View Data menu workflow
        /// </summary>
        private void ShowWindow()
        {
            if (!CanProcess())
            {
                return;
            }


            // ModulePageBorder.BorderBrush = System.Windows.Media.Brushes.Blue;

            ModuleState state = null;

            try
            {
                logger.Info($"Calling {InputModule.DisplayName}.Run() on input module");


                // JdSuite.Common.ApplicationWindowUtil.ShowStatusBarMessage($"Output Module: Sending run command to Module [{InputModule.DisplayName}]");

                /*
                 * bool status = await System.Threading.Tasks.Task.Factory.StartNew(() =>
                 * {
                 *   return InputModule.Run(this.MarkedMenu);
                 * });
                 */


                /*
                 * bool status = await InputModule.Run(this.MarkedMenu);
                 *
                 *
                 * logger.Info($"{InputModule.DisplayName}.Run() Status={status}");
                 *
                 * var workFlow = InputModule.GetState(InputModule);
                 * state = ((OutputNode)this.InputNode.Connector).State;
                 *
                 * string tempmsg = status ? "Successful" : "Failed";
                 *
                 * JdSuite.Common.ApplicationWindowUtil.ShowStatusBarMessage($"Output Module: [{InputModule.DisplayName}] execution status {tempmsg}");
                 *
                 * if (!status)
                 * {
                 *  MessageService.ShowError("Module Execution Error", $"{InputModule.DisplayName} execution error");
                 *  return;
                 * }
                 *
                 *
                 * if (state.Schema == null)
                 * {
                 *  MessageService.ShowError("Data Connection Error", $"In Module {InputModule.DisplayName} Sate has invalid Schema");
                 *  return;
                 * }
                 *
                 * if (!File.Exists(state.DataFilePath))
                 * {
                 *  MessageService.ShowError("Data Connection Error", $"In Module {InputModule.DisplayName} output file [{state.DataFilePath}] does not exists");
                 *  return;
                 * }
                 */
                // ModulePageBorder.BorderBrush = System.Windows.Media.Brushes.Green;

                if (mainWindowClass != null)
                {
                    mainWindowClass.Close();
                }
                mainWindowClass = null;

                mainWindowClass          = new MainWindowClass();
                mainWindowClass.Schema   = InputNode.State.Schema;
                mainWindowClass.DataFile = InputNode.State.DataFilePath;
                mainWindowClass.TextBlockModuleTitle.Text = "Output Module [" + DisplayName + "]";

                logger.Info("Loading data from xml file [{0}]", InputNode.State.DataFilePath);

                JdSuite.Common.ApplicationWindowUtil.ShowStatusBarMessage($"Ready...");

                mainWindowClass.ShowDialog();
            }
            catch (Exception ex)
            {
                if (state == null)
                {
                    logger.Error(ex, $"Data loading error in module class");
                }
                else
                {
                    logger.Error(ex, $"XML Loading Error {state.DataFilePath}");
                }

                MessageService.ShowError("DataOutput Module Execution Error", ex.Message);
            }
        }