Exemple #1
0
        private void SearchCommand_Executing(object sender, ExecutingEventArgs e)
        {
            if (String.IsNullOrWhiteSpace(ResultCollection.SearchContent) || IsLoading)
            {
                return;
            }
            StatusInfo  = String.Format("Searching '{0}' ...", ResultCollection.SearchContent);
            StatusColor = 1;
            if (IsSearching)
            {
                CToken.Cancel();
                CToken = new CancellationTokenSource();
            }
            IsSearching = true;
            var data = VectorFinder.FindWord(ResultCollection.SearchContent, CToken.Token);

            ResultCollection.ResultList.Clear();
            if (data == null)
            {
                return;
            }
            int i = 0;

            foreach (var record in data)
            {
                ResultCollection.ResultList.Add(record);
                record.Index = String.Format("{0}.", ++i);
            }
            IsBeginSearching = true;
            ReloadSignal     = true;
            FindRelations(CToken.Token);
        }
 public static void RegisterDialog(object sender, ExecutingEventArgs e)
 {
     if (e.CommandName == "RegisterDialogs")
     {
         Dialogs.RegisterDialog <ReorderDynamicContent.ReorderDialogCustom>();
     }
 }
Exemple #3
0
        private void OnPersistTaxonomy(object sender, ExecutingEventArgs args)
        {
            if (!(args.CommandName == "CommitTransaction" || args.CommandName == "FlushTransaction"))
            {
                return;
            }

            var taxonomyProvider = sender as TaxonomyDataProvider;

            var dirtyItems = taxonomyProvider.GetDirtyItems();

            if (dirtyItems.Count == 0)
            {
                return;
            }

            foreach (var item in dirtyItems)
            {
                if (item is Taxonomy taxonomy)
                {
                    var itemStatus   = taxonomyProvider.GetDirtyItemStatus(item);
                    var taxonomyName = taxonomy.Name;
                    if (!string.IsNullOrEmpty(taxonomyName) &&
                        (itemStatus == SecurityConstants.TransactionActionType.New || itemStatus == SecurityConstants.TransactionActionType.Updated))
                    {
                        taxonomyName = taxonomyName.ToLowerInvariant();
                        if (!ObjectFactory.Container.IsRegistered(typeof(TaxonParamResolver), taxonomyName))
                        {
                            ObjectFactory.Container.RegisterType <IRouteParamResolver, TaxonParamResolver>(taxonomyName, new InjectionConstructor(taxonomyName));
                        }
                    }
                }
            }
        }
Exemple #4
0
 static void engine_Executing(object sender, ExecutingEventArgs e)
 {
     e.ProfilerItem = new ProfilerItem();
     if (Executing != null)
     {
         Executing.BeginInvoke(sender, e, null, null);
     }
 }
Exemple #5
0
 /// <summary>
 /// Handles the Initializing event of the Bootstrapper.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="ExecutingEventArgs"/> instance containing the event data.</param>
 protected static void OnBootstrapperInitializing(object sender, ExecutingEventArgs e)
 {
     if (e.CommandName == "RegisterRoutes")
     {
         // Register custom Virtual Path
         ConfigHelper.RegisterVirtualPath(string.Concat(Constants.VALUE_CUSTOM_VIRTUAL_ROOT_PATH, "/*"));
     }
 }
Exemple #6
0
 /// <summary>
 /// Handles the Initializing event of the Bootstrapper.
 /// </summary>
 ///
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="ExecutingEventArgs"/> instance containing the event data.</param>
 protected static void OnBootstrapperInitializing(object sender, ExecutingEventArgs e)
 {
     if (e.CommandName == "RegisterRoutes")
     {
         //REGISTER CUSTOM VIRTUAL PATH FOR SITEFINITY TEMPLATES
         ConfigHelper.RegisterVirtualPath(Constants.VALUE_CUSTOM_VIRTUAL_ROOT_PATH + "/*", "Babaganoush.Sitefinity.Themes");
     }
 }
        public void SalesInvoice_cmdProcessAndOrPay_Executing(SalesInvoice entity, ExecutingEventArgs e)
        {
            var customer = entity.BillingCustomer;

            if (!customer.AllowedPaymentTypeLinks.Any())
            {
                entity.cmdProcessAndOrPay.Message(e, 0, new[] { PaymentHelper.CreateHyperlinkToCustomerAllowedPaymentTypeList(entity.BillingCustomer) });
            }
        }
Exemple #8
0
 private static void executor_Executing(object sender, ExecutingEventArgs e)
 {
     Console.ForegroundColor = ConsoleColor.Yellow;
     Console.WriteLine();
     Console.Write("----------------------------------");
     Console.Write("执行开始");
     Console.Write("----------------------------------");
     Console.WriteLine();
 }
Exemple #9
0
        private void ListBoxDoubleClickCommand_Executing(object sender, ExecutingEventArgs e)
        {
            var record = e.Parameter as ResultModel;

            if (record == null)
            {
                return;
            }
            ResultCollection.SearchContent = record.Content;
            SearchCommand.Execute(null);
        }
        private static void Provider_Executing(object sender, ExecutingEventArgs args)
        {
            if (!(args.CommandName == "CommitTransaction" || args.CommandName == "FlushTransaction"))
            {
                return;
            }

            var provider = sender as PageDataProvider;

            var dirtyItems = provider.GetDirtyItems();

            if (dirtyItems.Count == 0)
            {
                return;
            }

            var createdPageTemplates = provider.GetExecutionStateData(CreatedPageTemplatesCategoryIds) as HashSet <string>;

            if (createdPageTemplates == null)
            {
                createdPageTemplates = new HashSet <string>();
            }

            foreach (var item in dirtyItems)
            {
                SecurityConstants.TransactionActionType itemStatus = provider.GetDirtyItemStatus(item);
                var pageTemplate = item as PageTemplate;
                if (pageTemplate != null)
                {
                    if (itemStatus == SecurityConstants.TransactionActionType.New && pageTemplate.Framework == PageTemplateFramework.Mvc)
                    {
                        // the template name is formulated as Bootstrap.default
                        var nameParts = pageTemplate.Name.Split(new char[] { '.' }, StringSplitOptions.RemoveEmptyEntries);
                        if (nameParts.Length > 1)
                        {
                            var package = nameParts[0];

                            // always create the template, desipite if the package is not there
                            // in case the client first performs a sync and then deploys the files by mistake
                            createdPageTemplates.Add(package);
                        }
                    }
                }
            }

            if (createdPageTemplates.Any())
            {
                provider.SetExecutionStateData(CreatedPageTemplatesCategoryIds, createdPageTemplates);
            }
        }
Exemple #11
0
        private void NewsListBoxDoubleClickCommand_Executing(object sender, ExecutingEventArgs e)
        {
            var record = e.Parameter as ResultModel;

            if (record == null)
            {
                return;
            }

            IsShowNewsContent = true;
            try
            {
                NewsContent = PageVector.ReadFile(record.Content);
            }
            catch (IOException ex)
            {
                StatusInfo  = ex.Message;
                StatusColor = 2;
                return;
            }
            //NewsResultCollection.SearchContent = record.Content;
            //SearchCommand.Execute(null);
        }
        internal static void PublishinManager_Executing(object sender, ExecutingEventArgs e)
        {
            if (e.CommandName == "CommitTransaction" || e.CommandName == "FlushTransaction")
            {
                try
                {
                    var provider   = sender as PageDataProvider;
                    var dirtyItems = provider.GetDirtyItems();
                    if (dirtyItems.Count != 0)
                    {
                        foreach (var item in dirtyItems)
                        {
                            var pageData = item as PageData;
                            var url      = System.Web.HttpContext.Current.Request.Url.ToString();

                            if (IsValidPublishingOperation(item, pageData, provider))
                            {
                                var contextDictionary     = new Dictionary <string, string>();
                                var isManualSelectionMode = pageData.GetPropertyValue <ProductsController>(p => p.IsManualSelectionMode);
                                if (!string.IsNullOrEmpty(isManualSelectionMode) && bool.TryParse(isManualSelectionMode, out bool result) && result == true)
                                {
                                    pageData.LoadToContextDictionary <ProductsController>(x => x.CategoryIds, contextDictionary);
                                    pageData.LoadToContextDictionary <ProductsController>(x => x.ProductIds, contextDictionary);
                                }

                                pageData.NavigationNode.SetValue(PAGE_CONTEXT_FIELD_NAME, JsonConvert.SerializeObject(contextDictionary));
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    Log.Write($"Page context was not set due to unhandled exception, which occured during the page publishing event handler. The following exception was thrown: {Environment.NewLine} {ex}", ConfigurationPolicy.ErrorLog);
                }
            }
        }
 private void DataEngine_SavingItem(object sender, ExecutingEventArgs<SaveItemCommand> e)
 {
     EnterDisabledState("Saving item '{0}'", e.Command.Item.Name);
 }
 private void DataEngine_CopyingItem(object sender, ExecutingEventArgs<CopyItemCommand> e)
 {
     EnterDisabledState("Copying item '{0}'", e.Command.Source.Name);
 }
 private void DataEngine_AddingVersion(object sender, ExecutingEventArgs<AddVersionCommand> e)
 {
     EnterDisabledState("Adding Version of '{0}' ('{1}:{2}')", e.Command.Item.Name, e.Command.Item.Language.Name, e.Command.Item.Version.Number);
 }
 private void DataEngine_AddingFromTemplate(object sender, ExecutingEventArgs<AddFromTemplateCommand> e)
 {
     EnterDisabledState("Adding From Template item '{0}'", e.Command.ItemName);
 }
Exemple #17
0
 private void DataEngine_AddingVersion(object sender, ExecutingEventArgs <AddVersionCommand> e)
 {
     EnterDisabledState("Adding Version of '{0}' ('{1}:{2}')", e.Command.Item.Name, e.Command.Item.Language.Name, e.Command.Item.Version.Number);
 }
Exemple #18
0
 private static void executor_Executing(object sender, ExecutingEventArgs e)
 {
     Console.ForegroundColor = ConsoleColor.Yellow;
     Console.WriteLine();
     Console.Write("----------------------------------");
     Console.Write("执行开始");
     Console.Write("----------------------------------");
     Console.WriteLine();
 }
Exemple #19
0
 private void DataEngine_CreatingItem(object sender, ExecutingEventArgs <CreateItemCommand> e)
 {
     EnterDisabledState("Creating item '{0}'", e.Command.ItemName);
 }
Exemple #20
0
 private void DataEngine_CopyingItem(object sender, ExecutingEventArgs <CopyItemCommand> e)
 {
     EnterDisabledState("Copying item '{0}'", e.Command.Source.Name);
 }
		protected virtual void OnExecuting(ExecutingEventArgs args)
		{
			var executing = this.Executing;

			if(executing != null)
				executing(this, args);
		}
		protected ExecutionResult Execute(ExecutionContext context)
		{
			if(context == null)
				throw new ArgumentNullException("context");

			//创建“Executing”事件的调用参数
			ExecutingEventArgs executingArgs = new ExecutingEventArgs(context);

			//激发“Executing”事件
			this.OnExecuting(executingArgs);

			if(executingArgs.Cancel)
				return new ExecutionResult(context);

			//通过选择器获取当前请求对应的管道集
			var pipelines = this.SelectPipelines(context, _pipelines);

			//如果当前执行的处理管道数为零则退出
			if(pipelines == null || pipelines.Count() < 1)
				return null;

			//调用执行器过滤器的前半截
			var stack = ExecutionUtility.InvokeFiltersExecuting(context.Executor.Filters, filter => this.OnFilterExecuting(filter, context));

			//执行管道集,并将其执行的最终结果保存到执行器上下文的Result属性中
			context.Result = this.InvokePipelines(pipelines, p => this.CreatePipelineContext(context, p, context.Parameter));

			//调用执行器过滤器的后半截
			ExecutionUtility.InvokeFiltersExecuted(stack, filter => this.OnFilterExecuted(filter, context));

			//激发“Executed”事件
			this.OnExecuted(new ExecutedEventArgs(context));

			return new ExecutionResult(context);
		}
 private static void OnPublished(object sender, ExecutingEventArgs e)
 {
     Trace.WriteLine($"AzureServicePublisher: Executing publishing event {e.GetType().FullName} {e.Dump()}");
 }
Exemple #24
0
 private void DataEngine_AddingFromTemplate(object sender, ExecutingEventArgs <AddFromTemplateCommand> e)
 {
     EnterDisabledState("Adding From Template item '{0}'", e.Command.ItemName);
 }