Exemplo n.º 1
0
        static void Main()
        {
#if EASYTEST
            DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register();
#endif
            Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);
			EditModelPermission.AlwaysGranted = System.Diagnostics.Debugger.IsAttached;
			var xafApplication = new WorkflowDemoWindowsFormsApplication();

            //
            // SqlWorkflowInstanceStoreBehavior
            //
            //WorkflowModule workflowModule = xafApplication.Modules.FindModule<WorkflowModule>();
            //workflowModule.WorkflowInstanceType = null;
            //workflowModule.WorkflowInstanceKeyType = null;
#if EASYTEST
            if (ConfigurationManager.ConnectionStrings["EasyTestConnectionString"] != null) {
                xafApplication.ConnectionString = ConfigurationManager.ConnectionStrings["EasyTestConnectionString"].ConnectionString;
            }
#else
            if (ConfigurationManager.ConnectionStrings["ConnectionString"] != null) {
                xafApplication.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
            }
#endif

            xafApplication.Modules.FindModule<WorkflowWindowsFormsModule>().QueryAvailableActivities +=
                (sender, e) =>
                e.ActivitiesInformation.Add(new ActivityInformation(typeof (CreateTask), "Code Activities",
                                                                    "Create Task",
                                                                    ImageLoader.Instance.GetImageInfo("CreateTask")
                                                                               .Image));

            xafApplication.LastLogonParametersReading += xafApplication_LastLogonParametersReading;
            WorkflowServerStarter starter = null;
            xafApplication.LoggedOn += delegate {
                if(starter == null) {
                    starter = new WorkflowServerStarter();
                    starter.OnCustomHandleException += (sender1, args1) => MessageBox.Show(args1.Message);

                    starter.Start(xafApplication.ConnectionString, xafApplication.ApplicationName);
                }
            };

            try
            {
                xafApplication.Setup();
				xafApplication.Start();
            }
            catch (Exception e)
            {
				xafApplication.HandleException(e);
            }

            if(starter != null) {
                starter.Stop();
            }
        }
Exemplo n.º 2
0
        static void Main(string[] arguments)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            WorkflowDemoWindowsFormsApplication xafApplication = new WorkflowDemoWindowsFormsApplication();

#if DEBUG
            DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register();
#endif

            ConnectionStringSettings connectionStringSettings = ConfigurationManager.ConnectionStrings["ConnectionString"];
            if (connectionStringSettings != null)
            {
                xafApplication.ConnectionString = connectionStringSettings.ConnectionString;
            }
            else if (string.IsNullOrEmpty(xafApplication.ConnectionString) && xafApplication.Connection == null)
            {
                connectionStringSettings = ConfigurationManager.ConnectionStrings["SqlExpressConnectionString"];
                if (connectionStringSettings != null)
                {
                    xafApplication.ConnectionString = DbEngineDetector.PatchConnectionString(connectionStringSettings.ConnectionString);
                }
            }

            xafApplication.Modules.FindModule <WorkflowWindowsFormsModule>().QueryAvailableActivities += delegate(object sender, ActivitiesInformationEventArgs e) {
                e.ActivitiesInformation.Add(new ActivityInformation(typeof(CreateTask), "Code Activities", "Create Task", ImageLoader.Instance.GetImageInfo("CreateTask").Image));
            };

            WorkflowServerStarter starter = null;
            xafApplication.LoggedOn += delegate(object sender, LogonEventArgs e) {
                if (starter == null)
                {
                    starter = new WorkflowServerStarter();
                    starter.OnCustomHandleException += delegate(object sender1, ExceptionEventArgs args1) {
                        MessageBox.Show(args1.Message);
                    };

                    starter.Start(xafApplication.ConnectionString, xafApplication.ApplicationName);
                }
            };

            try
            {
                xafApplication.Setup();
                xafApplication.Start();
            }
            catch (Exception e)
            {
                xafApplication.HandleException(e);
            }

            if (starter != null)
            {
                starter.Stop();
            }
        }
Exemplo n.º 3
0
        static void Main(string[] arguments)
        {
            
            Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);
			WorkflowDemoWindowsFormsApplication xafApplication = new WorkflowDemoWindowsFormsApplication();
#if DEBUG
            DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register();
#endif	

            ConnectionStringSettings connectionStringSettings = ConfigurationManager.ConnectionStrings["ConnectionString"];
            if(connectionStringSettings != null) {
                xafApplication.ConnectionString = connectionStringSettings.ConnectionString;
            }
            else if(string.IsNullOrEmpty(xafApplication.ConnectionString) && xafApplication.Connection == null) {
                connectionStringSettings = ConfigurationManager.ConnectionStrings["SqlExpressConnectionString"];
                if(connectionStringSettings != null) {
                    xafApplication.ConnectionString = DbEngineDetector.PatchConnectionString(connectionStringSettings.ConnectionString);
                }
            }

            xafApplication.Modules.FindModule<WorkflowWindowsFormsModule>().QueryAvailableActivities += delegate(object sender, ActivitiesInformationEventArgs e) {
                e.ActivitiesInformation.Add(new ActivityInformation(typeof(CreateTask), "Code Activities", "Create Task", ImageLoader.Instance.GetImageInfo("CreateTask").Image));
			};

            WorkflowServerStarter starter = null;
            xafApplication.LoggedOn += delegate(object sender, LogonEventArgs e) {
                if(starter == null) {
                    starter = new WorkflowServerStarter();
                    starter.OnCustomHandleException += delegate(object sender1, ExceptionEventArgs args1) {
                        MessageBox.Show(args1.Message);
                    };

                    starter.Start(xafApplication.ConnectionString, xafApplication.ApplicationName);
                }
            };

            try
            {
                xafApplication.Setup();
				xafApplication.Start();
            }
            catch (Exception e)
            {
				xafApplication.HandleException(e);
            }

            if(starter != null) {
                starter.Stop();
            }
        }
Exemplo n.º 4
0
 public void Start(string connectionString, string applicationName)
 {
     try {
         domain  = AppDomain.CreateDomain("ServerDomain");
         starter = (WorkflowServerStarter)domain.CreateInstanceAndUnwrap(
             System.Reflection.Assembly.GetEntryAssembly().FullName, typeof(WorkflowServerStarter).FullName);
         starter.OnCustomHandleException_ += starter_OnCustomHandleException_;
         starter.Start_(connectionString, applicationName);
     }
     catch (Exception e) {
         Tracing.Tracer.LogError(e);
         if (OnCustomHandleException != null)
         {
             OnCustomHandleException(null, new ExceptionEventArgs("Exception occurs:\r\n\r\n" + e.Message));
         }
     }
 }
        static void Main(string[] arguments)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            EditModelPermission.AlwaysGranted = System.Diagnostics.Debugger.IsAttached;
            WorkflowDemoWindowsFormsApplication xafApplication = new WorkflowDemoWindowsFormsApplication();
            WorkflowModule workflowModule = xafApplication.Modules.FindModule <WorkflowModule>();

            workflowModule.WorkflowInstanceType    = null;
            workflowModule.WorkflowInstanceKeyType = null;

#if EASYTEST
            try {
                DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register();
            }
            catch (Exception) { }
#endif

            if (ConfigurationManager.ConnectionStrings["ConnectionString"] != null)
            {
                xafApplication.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
            }
#if EASYTEST
            if (ConfigurationManager.ConnectionStrings["EasyTestConnectionString"] != null)
            {
                xafApplication.ConnectionString = ConfigurationManager.ConnectionStrings["EasyTestConnectionString"].ConnectionString;
            }
#endif
            xafApplication.Modules.FindModule <WorkflowWindowsFormsModule>().QueryAvailableActivities += delegate(object sender, ActivitiesInformationEventArgs e) {
                e.ActivitiesInformation.Add(new ActivityInformation(typeof(CreateTask), "Code Activities", "Create Task", ImageLoader.Instance.GetImageInfo("CreateTask").Image));
            };

            xafApplication.LastLogonParametersReading += new EventHandler <LastLogonParametersReadingEventArgs>(xafApplication_LastLogonParametersReading);
            WorkflowServerStarter starter = null;
            xafApplication.LoggedOn += delegate(object sender, LogonEventArgs e) {
                if (starter == null)
                {
                    starter = new WorkflowServerStarter();
                    starter.OnCustomHandleException += delegate(object sender1, ExceptionEventArgs args1) {
                        MessageBox.Show(args1.Message);
                    };

                    starter.Start(xafApplication.ConnectionString, xafApplication.ApplicationName);
                }
            };

            try
            {
                xafApplication.Setup();
                xafApplication.Start();
            }
            catch (Exception e)
            {
                xafApplication.HandleException(e);
            }

            if (starter != null)
            {
                starter.Stop();
            }
        }
Exemplo n.º 6
0
        public void Start(string connectionString, string applicationName) {
            try {
                domain = AppDomain.CreateDomain("ServerDomain");
                starter = (WorkflowServerStarter)domain.CreateInstanceAndUnwrap(
                    System.Reflection.Assembly.GetEntryAssembly().FullName, typeof(WorkflowServerStarter).FullName);
				starter.OnCustomHandleException_ += new EventHandler<ExceptionEventArgs>(starter_OnCustomHandleException_);
                starter.Start_(connectionString, applicationName);
            }
            catch(Exception e) {
                Tracing.Tracer.LogError(e);
                if(OnCustomHandleException != null) {
                    OnCustomHandleException(null, new ExceptionEventArgs("Exception occurs:\r\n\r\n" + e.Message));
                }
            }
        }