Esempio n. 1
0
        protected internal virtual PartialViewResult SearchPopup(ControllerBase controller, FindOptions findOptions, FindMode mode, Context context)
        {
            if (!Finder.IsFindable(findOptions.QueryName))
            {
                throw new UnauthorizedAccessException(NormalControlMessage.ViewForType0IsNotAllowed.NiceToString().FormatWith(findOptions.QueryName));
            }

            var desc = DynamicQueryManager.Current.QueryDescription(findOptions.QueryName);

            SetSearchViewableAndCreable(findOptions, desc);
            SetDefaultOrder(findOptions, desc);

            controller.ViewData.Model = context;

            controller.ViewData[ViewDataKeys.FindMode]         = mode;
            controller.ViewData[ViewDataKeys.FindOptions]      = findOptions;
            controller.ViewData[ViewDataKeys.QueryDescription] = desc;

            if (!controller.ViewData.ContainsKey(ViewDataKeys.Title))
            {
                controller.ViewData[ViewDataKeys.Title] = QueryUtils.GetNiceName(findOptions.QueryName);
            }

            return(new PartialViewResult
            {
                ViewName = SearchPopupControlView,
                ViewData = controller.ViewData,
                TempData = controller.TempData
            });
        }
Esempio n. 2
0
        protected internal virtual ViewResult SearchPage(ControllerBase controller, FindOptions findOptions)
        {
            if (!Finder.IsFindable(findOptions.QueryName))
            {
                throw new UnauthorizedAccessException(SearchMessage.Query0IsNotAllowed.NiceToString().FormatWith(findOptions.QueryName));
            }

            QueryDescription description = DynamicQueryManager.Current.QueryDescription(findOptions.QueryName);

            //Finder.SetTokens(findOptions.FilterOptions, description, canAggregate: false);
            SetSearchViewableAndCreable(findOptions, description);
            SetDefaultOrder(findOptions, description);

            controller.ViewData.Model = new Context(null, "");

            controller.ViewData[ViewDataKeys.QueryDescription] = DynamicQueryManager.Current.QueryDescription(findOptions.QueryName);
            controller.ViewData[ViewDataKeys.FindOptions]      = findOptions;

            if (!controller.ViewData.ContainsKey(ViewDataKeys.Title))
            {
                controller.ViewData[ViewDataKeys.Title] = QueryUtils.GetNiceName(findOptions.QueryName);
            }

            return(new ViewResult()
            {
                ViewName = SearchPageView,
                MasterName = null,
                ViewData = controller.ViewData,
                TempData = controller.TempData
            });
        }
Esempio n. 3
0
 public QuickLinkExplore(FindOptions findOptions)
 {
     FindOptions = findOptions;
     IsVisible   = Finder.IsFindable(findOptions.QueryName);
     Text        = QueryUtils.GetNiceName(findOptions.QueryName);
     Name        = Finder.ResolveWebQueryName(findOptions.QueryName);
 }
Esempio n. 4
0
        public static void TaskSetHeader(MenuItem menuItem)
        {
            if (menuItem.NotSet(MenuItem.HeaderProperty))
            {
                object o = menuItem.Tag;

                if (o == null)
                {
                    return;
                }

                if (o is FindOptionsBase)
                {
                    menuItem.Header = QueryUtils.GetNiceName(((FindOptionsBase)o).QueryName);
                }
                else if (o is Type)
                {
                    menuItem.Header = ((Type)o).NicePluralName();
                }
                else if (o is Enum)
                {
                    menuItem.Header = ((Enum)o).NiceToString();
                }
                else
                {
                    menuItem.Header = o.ToString();
                }
            }
        }
Esempio n. 5
0
        public override string ToString()
        {
            if (QueryName == null)
            {
                return(KeywordMatch.Value.ToString());
            }

            return("{0} {1}".FormatWith(KeywordMatch.Value, QueryUtils.GetNiceName(QueryName).ToOmniboxPascal()));
        }
Esempio n. 6
0
        public async Task <HttpResponseMessage> ToPlainExcel(ChartRequest request, CancellationToken token)
        {
            var resultTable = await ChartLogic.ExecuteChartAsync(request, token);

            byte[] binaryFile = PlainExcelGenerator.WritePlainExcel(resultTable, QueryUtils.GetNiceName(request.QueryName));

            var fileName = request.ChartScript.ToString() + " " + QueryUtils.GetKey(request.QueryName) + TimeZoneManager.Now.ToString("yyyyMMdd-HHmmss") + ".xlsx";

            return(FilesController.GetHttpReponseMessage(new MemoryStream(binaryFile), fileName));
        }
Esempio n. 7
0
        ViewResult OpenChartRequest(ChartRequest request, Lite <UserChartEntity> currentUserChart)
        {
            ViewData[ViewDataKeys.Title]            = QueryUtils.GetNiceName(request.QueryName);
            ViewData[ViewDataKeys.QueryDescription] = DynamicQueryManager.Current.QueryDescription(request.QueryName);;
            ViewData[ViewDataKeys.FilterOptions]    = request.Filters.Select(f => new FilterOption {
                Token = f.Token, Operation = f.Operation, Value = f.Value
            }).ToList();
            ViewData["UserChart"] = currentUserChart;

            return(View(ChartClient.ChartRequestView, new TypeContext <ChartRequest>(request, "")));
        }
Esempio n. 8
0
        public async Task <HttpResponseMessage> ToPlainExcel(QueryRequestTS request, CancellationToken token)
        {
            var queryRequest = request.ToQueryRequest();

            ResultTable queryResult = await DynamicQueryManager.Current.ExecuteQueryAsync(queryRequest, token);

            byte[] binaryFile = PlainExcelGenerator.WritePlainExcel(queryResult, QueryUtils.GetNiceName(queryRequest.QueryName));

            var fileName = request.queryKey + TimeZoneManager.Now.ToString("yyyyMMdd-HHmmss") + ".xlsx";

            return(FilesController.GetHttpReponseMessage(new MemoryStream(binaryFile), fileName));
        }
Esempio n. 9
0
        public async Task <FileStreamResult> ToPlainExcel([Required, FromBody] QueryRequestTS request, CancellationToken token)
        {
            var queryRequest = request.ToQueryRequest();

            ResultTable queryResult = await QueryLogic.Queries.ExecuteQueryAsync(queryRequest, token);

            byte[] binaryFile = PlainExcelGenerator.WritePlainExcel(queryResult, QueryUtils.GetNiceName(queryRequest.QueryName));

            var fileName = request.queryKey + TimeZoneManager.Now.ToString("yyyyMMdd-HHmmss") + ".xlsx";

            return(FilesController.GetFileStreamResult(new MemoryStream(binaryFile), fileName));
        }
Esempio n. 10
0
        public ActionResult ToExcelPlain(QueryRequest request)
        {
            if (!Finder.IsFindable(request.QueryName))
            {
                throw new UnauthorizedAccessException(NormalControlMessage.ViewForType0IsNotAllowed.NiceToString().FormatWith(request.QueryName));
            }

            ResultTable queryResult = DynamicQueryManager.Current.ExecuteQuery(request);

            byte[] binaryFile = PlainExcelGenerator.WritePlainExcel(queryResult, QueryUtils.GetNiceName(request.QueryName));

            return(File(binaryFile, MimeMapping.GetMimeMapping(".xlsx"), Finder.ResolveWebQueryName(request.QueryName) + ".xlsx"));
        }
Esempio n. 11
0
        public static MvcHtmlString CountSearchControlSpan(this HtmlHelper helper, FindOptions findOptions, Context context, Action <CountSearchControl> settingsModifier = null)
        {
            var options = new CountSearchControl();

            if (settingsModifier != null)
            {
                settingsModifier(options);
            }

            return("{0} {1}".FormatHtml(
                       options.QueryLabelText ?? QueryUtils.GetNiceName(findOptions.QueryName),
                       CountSearchControlInternal(findOptions, options, context)));
        }
Esempio n. 12
0
    public async Task <FileStreamResult> ToPlainExcel([Required, FromBody] QueryRequestTS request, CancellationToken token)
    {
        ExcelPermission.PlainExcel.AssertAuthorized();

        var queryRequest = request.ToQueryRequest(SignumServer.JsonSerializerOptions);

        ResultTable queryResult = await QueryLogic.Queries.ExecuteQueryAsync(queryRequest, token);

        byte[] binaryFile = PlainExcelGenerator.WritePlainExcel(queryResult, QueryUtils.GetNiceName(queryRequest.QueryName));

        var fileName = request.queryKey + Clock.Now.ToString("yyyyMMdd-HHmmss") + ".xlsx";

        return(FilesController.GetFileStreamResult(new MemoryStream(binaryFile), fileName));
    }
Esempio n. 13
0
        public override string ToString()
        {
            string queryName = QueryUtils.GetNiceName(QueryName).ToOmniboxPascal();

            string filters = Filters.ToString(" ");

            if (string.IsNullOrEmpty(filters))
            {
                return(queryName);
            }
            else
            {
                return(queryName + " " + filters);
            }
        }
Esempio n. 14
0
        public ActionResult ExportData()
        {
            var request = ExtractChartRequestCtx(null).Value;

            if (!Finder.IsFindable(request.QueryName))
            {
                throw new UnauthorizedAccessException(ChartMessage.Chart_Query0IsNotAllowed.NiceToString().FormatWith(request.QueryName));
            }

            var resultTable = ChartLogic.ExecuteChartAsync(request, CancellationToken.None).Result;

            byte[] binaryFile = PlainExcelGenerator.WritePlainExcel(resultTable, QueryUtils.GetNiceName(request.QueryName));

            return(File(binaryFile, MimeMapping.GetMimeMapping(".xlsx"), Finder.ResolveWebQueryName(request.QueryName) + ".xlsx"));
        }
Esempio n. 15
0
        public static QueryHelpService GetQueryHelpService(object queryName)
        {
            var entity = GetQueryHelp(queryName);

            var url = HelpUrls.QueryUrl(queryName);

            return(new QueryHelpService
            {
                QueryName = queryName,

                Info = GetHelpToolTipInfo(QueryUtils.GetNiceName(queryName), entity.Info, entity.UserDescription, url),

                Columns = entity.Columns.Where(a => a.Value.IsAllowed() == null).ToDictionary(kvp => kvp.Key, kvp =>
                                                                                              GetHelpToolTipInfo(kvp.Value.NiceName, kvp.Value.Info, kvp.Value.UserDescription, url)),
            });
        }
Esempio n. 16
0
        void SetTitle()
        {
            tbEntityType.Text = EntityType.NicePluralName();

            string niceQueryName = QueryUtils.GetNiceName(Request.QueryName);

            if (niceQueryName.StartsWith(tbEntityType.Text))
            {
                niceQueryName = niceQueryName.Substring(tbEntityType.Text.Length).Trim();
            }
            else
            {
                niceQueryName = "- " + niceQueryName;
            }

            tbQueryName.Text = niceQueryName;
        }
Esempio n. 17
0
        public static MenuItem Construct(SearchControl sc)
        {
            MenuItem miResult = new MenuItem()
            {
                Header = ExcelMessage.ExcelReport.NiceToString(),
                Icon   = ExtensionsImageLoader.GetImageSortName("excelPlain.png").ToSmallImage(),
            };

            miResult.Click += (object sender, RoutedEventArgs e) =>
            {
                e.Handled = true;

                SaveFileDialog sfd = new SaveFileDialog()
                {
                    AddExtension    = true,
                    DefaultExt      = ".xlsx",
                    Filter          = ExcelMessage.Excel2007Spreadsheet.NiceToString(),
                    OverwritePrompt = true,
                    FileName        = "{0}.xlsx".FormatWith(QueryUtils.GetNiceName(sc.QueryName)),
                    Title           = ExcelMessage.FindLocationFoExcelReport.NiceToString()
                };

                if (sfd.ShowDialog(Window.GetWindow(sc)) == true)
                {
                    var request = sc.GetQueryRequest(true);

                    byte[] file = Server.Return((IExcelReportServer s) => s.ExecutePlainExcel(request));

                    File.WriteAllBytes(sfd.FileName, file);

                    System.Diagnostics.Process.Start(sfd.FileName);
                }
            };

            sc.ResultChanged += (object sender, ResultChangedEventArgs e) =>
            {
                ResultTable qr = sc.ResultTable;
                miResult.IsEnabled = (qr != null && qr.Rows.Length > 0);
            };

            return(miResult);
        }
Esempio n. 18
0
        public QuickLinkExplore(ExploreOptions options)
        {
            Options = options;
            Label   = QueryUtils.GetNiceName(Options.QueryName);
            //Icon = Navigator.Manager.GetFindIcon(Options.QueryName, false);
            IsVisible = Finder.IsFindable(Options.QueryName);

            if (ShowResultCount && IsVisible)
            {
                EvaluateFunValues();

                DynamicQueryServer.QueryCountBatch(new QueryCountOptions(Options.QueryName)
                {
                    FilterOptions = options.FilterOptions,
                }, count =>
                {
                    Label = "{0} ({1})".FormatWith(Label, count);
                }, () => { });
            }
        }
Esempio n. 19
0
        public void Search()
        {
            if (IsSearching)
            {
                searchQueued = true;
                return;
            }

            FormattedText = (TextWaiting ?? QueryUtils.GetNiceName(QueryName) + "...");
            tb.FontWeight = FontWeights.Regular;

            var options = new QueryCountOptions
            {
                QueryName     = QueryName,
                FilterOptions = FilterOptions.ToList()
            };

            DynamicQueryServer.QueryCountBatch(options, count =>
            {
                ItemsCount = count;
                if (ItemsCount == 0)
                {
                    FormattedText = (TextZeroItems ?? SearchMessage.ThereIsNo0.NiceToString()).FormatWith(QueryUtils.GetNiceName(QueryName));
                    tb.FontWeight = FontWeights.Regular;
                }
                else
                {
                    FormattedText = (Text ?? (QueryUtils.GetNiceName(QueryName) + ": {0}")).FormatWith(ItemsCount);
                    tb.FontWeight = FontWeights.Bold;
                }

                if (searchQueued)
                {
                    searchQueued = false;
                    Search();
                }
            },
                                               () => { });
        }
Esempio n. 20
0
        public static MvcHtmlString SearchControl(this HtmlHelper helper, FindOptions findOptions, Context context, Action <SearchControl> settingsModifier)
        {
            var options = new SearchControl {
                Prefix = context.Prefix
            };

            if (settingsModifier != null)
            {
                settingsModifier(options);
            }

            QueryDescription description = DynamicQueryManager.Current.QueryDescription(findOptions.QueryName);

            FilterOption.SetFilterTokens(findOptions.FilterOptions, description, false);
            OrderOption.SetOrderTokens(findOptions.OrderOptions, description, false);
            ColumnOption.SetColumnTokens(findOptions.ColumnOptions, description, false);
            Finder.Manager.SetSearchViewableAndCreable(findOptions, description);
            FinderManager.SetDefaultOrder(findOptions, description);

            var viewData = new ViewDataDictionary(context);

            viewData[ViewDataKeys.FindOptions]      = findOptions;
            viewData[ViewDataKeys.QueryDescription] = DynamicQueryManager.Current.QueryDescription(findOptions.QueryName);

            viewData[ViewDataKeys.Title] = helper.ViewData.ContainsKey(ViewDataKeys.Title) ?
                                           helper.ViewData[ViewDataKeys.Title] : QueryUtils.GetNiceName(findOptions.QueryName);

            if (!options.ToolBarButton.IsNullOrEmpty())
            {
                viewData[ViewDataKeys.ManualToolbarButtons] = options.ToolBarButton;
            }

            if (options.AvoidFullScreenButton)
            {
                viewData[ViewDataKeys.AvoidFullScreenButton] = true;
            }

            return(helper.Partial(Finder.Manager.SearchControlView, viewData));
        }
Esempio n. 21
0
        void searchControl_Loaded(object sender, RoutedEventArgs e)
        {
            if (this.EntityTypeTitle == null)
            {
                this.EntityTypeTitle = searchControl.EntityType.NicePluralName();
            }

            if (this.QueryNameTitle == null)
            {
                this.QueryNameTitle = QueryUtils.GetNiceName(QueryName);
            }

            if (this.QueryNameTitle.StartsWith(this.EntityTypeTitle))
            {
                this.QueryNameTitle = this.QueryNameTitle.Substring(this.EntityTypeTitle.Length).Trim();
            }
            else
            {
                this.QueryNameTitle = "- " + this.QueryNameTitle;
            }

            AutomationProperties.SetName(this, QueryUtils.GetQueryUniqueKey(QueryName));
        }
Esempio n. 22
0
        internal static void OpenChartRequest(ChartRequest chartRequest, UserChartEntity uc, Entity currentEntity)
        {
            Navigator.OpenIndependentWindow(() =>
            {
                var crw = new ChartRequestWindow()
                {
                    DataContext = chartRequest,
                    Title       = ChartMessage.ChartOf0.NiceToString().FormatWith(QueryUtils.GetNiceName(chartRequest.QueryName)),
                    Icon        = Finder.Manager.GetFindIcon(chartRequest.QueryName, false) ?? ExtensionsImageLoader.GetImageSortName("chartIcon.png")
                };

                if (uc != null)
                {
                    SetUserChart(crw, uc);
                }

                if (currentEntity != null)
                {
                    UserAssetsClient.SetCurrentEntity(crw, currentEntity);
                }

                return(crw);
            });
        }
Esempio n. 23
0
 public Dictionary <string, object> GetQueries()
 {
     return(queries.GetOrAdd(CultureInfo.CurrentCulture, ci =>
                             GetAllQueryNames().ToOmniboxPascalDictionary(qn =>
                                                                          qn is Type t ? (EnumEntity.Extract(t) ?? t).NiceName() : QueryUtils.GetNiceName(qn), qn => qn)));
 }
Esempio n. 24
0
        public override void Execute()
        {
            DefineSection("head", () => {
                WriteLiteral("\r\n");

                WriteLiteral("    ");


            #line 12 "..\..\Help\Views\ViewEntity.cshtml"
                Write(Html.ScriptCss("~/help/Content/help.css"));


            #line default
            #line hidden
                WriteLiteral("\r\n");
            });

            WriteLiteral("\r\n");


            #line 15 "..\..\Help\Views\ViewEntity.cshtml"

            EntityHelp eh = (EntityHelp)Model;
            ViewBag.Title = eh.Type.NiceName();


            #line default
            #line hidden
            WriteLiteral("\r\n\r\n");

            WriteLiteral("\r\n\r\n<div");

            WriteLiteral(" class=\"row\"");

            WriteLiteral(">\r\n    <div");

            WriteLiteral(" class=\"col-md-9\"");

            WriteLiteral(">\r\n");


            #line 52 "..\..\Help\Views\ViewEntity.cshtml"


            #line default
            #line hidden

            #line 52 "..\..\Help\Views\ViewEntity.cshtml"
            using (TypeContext <EntityHelpEntity> ec = new TypeContext <EntityHelpEntity>(eh.Entity.Value, null))
            {
                var name = Navigator.ResolveWebTypeName(eh.Type);
                ec.FormGroupStyle = FormGroupStyle.None;


                using (Html.BeginForm((HelpController hc) => hc.SaveEntity(), new { id = "form-save" }))
                {
            #line default
            #line hidden

            #line 60 "..\..\Help\Views\ViewEntity.cshtml"
                    Write(Html.HiddenRuntimeInfo(ec));


            #line default
            #line hidden

            #line 60 "..\..\Help\Views\ViewEntity.cshtml"



            #line default
            #line hidden

            #line 61 "..\..\Help\Views\ViewEntity.cshtml"
                    Write(Html.HiddenRuntimeInfo(ec, e => e.Culture));


            #line default
            #line hidden

            #line 61 "..\..\Help\Views\ViewEntity.cshtml"



            #line default
            #line hidden

            #line 62 "..\..\Help\Views\ViewEntity.cshtml"
                    Write(Html.HiddenRuntimeInfo(ec, e => e.Type));


            #line default
            #line hidden

            #line 62 "..\..\Help\Views\ViewEntity.cshtml"

                    if (!Navigator.IsReadOnly(typeof(EntityHelpEntity)))
                    {
                        Html.RenderPartial(HelpClient.Buttons, new ViewDataDictionary
                        {
                            { "options", Database.Query <EntityHelpEntity>()
                              .Where(e => e.Type == ec.Value.Type && e.Culture != ec.Value.Culture)
                              .Select(e => new { e.Culture })
                              .ToList()
                              .Select(e => KVP.Create(e.Culture.ToCultureInfo(), this.Url.Action((HelpController a) => a.TraslateEntity(e.Culture.Name))))
                              .ToDictionary() }
                        });
                    }


            #line default
            #line hidden
                    WriteLiteral("            <div");

                    WriteLiteral(" class=\"edit-container\"");

                    WriteLiteral(">\r\n                <h1");

                    WriteAttribute("title", Tuple.Create(" title=\"", 2876), Tuple.Create("\"", 2902)

            #line 76 "..\..\Help\Views\ViewEntity.cshtml"
                                   , Tuple.Create(Tuple.Create("", 2884), Tuple.Create <System.Object, System.Int32>(eh.Type.Namespace

            #line default
            #line hidden
                                                                                                                     , 2884), false)
                                   );

                    WriteLiteral(">");


            #line 76 "..\..\Help\Views\ViewEntity.cshtml"
                    Write(eh.Type.NiceName());


            #line default
            #line hidden
                    WriteLiteral("</h1>\r\n                <code");

                    WriteLiteral(" class=\'shortcut\'");

                    WriteLiteral(">[e:");


            #line 77 "..\..\Help\Views\ViewEntity.cshtml"
                    Write(name);


            #line default
            #line hidden
                    WriteLiteral("]</code>\r\n                <span");

                    WriteLiteral(" class=\"info\"");

                    WriteLiteral(">\r\n");

                    WriteLiteral("                    ");


            #line 79 "..\..\Help\Views\ViewEntity.cshtml"
                    Write(Html.WikiParse(eh.Info, HelpWiki.DefaultWikiSettings));


            #line default
            #line hidden
                    WriteLiteral("\r\n                </span>\r\n");

                    WriteLiteral("                ");


            #line 81 "..\..\Help\Views\ViewEntity.cshtml"
                    Write(Html.TextArea(ec.SubContextPrefix(a => a.Description), eh.Description, 5, 80, new { @class = "editable" }));


            #line default
            #line hidden
                    WriteLiteral("\r\n                <span");

                    WriteLiteral(" class=\"wiki\"");

                    WriteLiteral(">\r\n");

                    WriteLiteral("                    ");


            #line 83 "..\..\Help\Views\ViewEntity.cshtml"
                    Write(Html.WikiParse(eh.Description, HelpWiki.DefaultWikiSettings));


            #line default
            #line hidden
                    WriteLiteral("\r\n                </span>\r\n            </div>\r\n");

                    WriteLiteral("            <div");

                    WriteLiteral(" id=\"entityContent\"");

                    WriteLiteral(" class=\"help_left\"");

                    WriteLiteral(">\r\n");


            #line 87 "..\..\Help\Views\ViewEntity.cshtml"


            #line default
            #line hidden

            #line 87 "..\..\Help\Views\ViewEntity.cshtml"

                    var allowedProps = eh.Properties.Where(a => a.Value.IsAllowed() == null).ToDictionary();


            #line default
            #line hidden
                    WriteLiteral("\r\n\r\n");


            #line 91 "..\..\Help\Views\ViewEntity.cshtml"


            #line default
            #line hidden

            #line 91 "..\..\Help\Views\ViewEntity.cshtml"
                    if (allowedProps.Any())
                    {
            #line default
            #line hidden
                        WriteLiteral("                    <div");

                        WriteLiteral(" id=\"properties\"");

                        WriteLiteral(">\r\n                        <h2");

                        WriteLiteral(" class=\"greyTitle\"");

                        WriteLiteral(">");


            #line 94 "..\..\Help\Views\ViewEntity.cshtml"
                        Write(Html.PropertyNiceName(() => eh.Entity.Value.Properties));


            #line default
            #line hidden
                        WriteLiteral("</h2>\r\n");


            #line 95 "..\..\Help\Views\ViewEntity.cshtml"


            #line default
            #line hidden

            #line 95 "..\..\Help\Views\ViewEntity.cshtml"

                        var elementContexts = ec.TypeElementContext(e => e.Properties).ToDictionary(a => a.Value.Property.Path);

                        var tuplesDic = allowedProps.Values.Select(p => Tuple.Create(p, elementContexts.GetOrThrow(p.PropertyRoute.PropertyString()))).ToDictionary(a => a.Item1.PropertyRoute);

                        var roots = TreeHelper.ToTreeC(tuplesDic.Values, kvp =>
                        {
                            var parent = kvp.Item1.PropertyRoute.Parent;
                            if (parent.PropertyRouteType == PropertyRouteType.Root || parent.PropertyRouteType == PropertyRouteType.Mixin)
                            {
                                return(null);
                            }

                            if (parent.PropertyRouteType == PropertyRouteType.MListItems)
                            {
                                parent = parent.Parent;
                            }

                            return(tuplesDic.GetOrThrow(parent));
                        });


            #line default
            #line hidden
                        WriteLiteral("\r\n\r\n                        <dl");

                        WriteLiteral(" class=\"dl-horizontal\"");

                        WriteLiteral(">\r\n");


            #line 114 "..\..\Help\Views\ViewEntity.cshtml"


            #line default
            #line hidden

            #line 114 "..\..\Help\Views\ViewEntity.cshtml"
                        foreach (var node in roots)
                        {
            #line default
            #line hidden

            #line 116 "..\..\Help\Views\ViewEntity.cshtml"
                            Write(WriteProperty(node, name));


            #line default
            #line hidden

            #line 116 "..\..\Help\Views\ViewEntity.cshtml"
                            ;
                        }


            #line default
            #line hidden
                        WriteLiteral("                        </dl>\r\n                    </div>\r\n");


            #line 120 "..\..\Help\Views\ViewEntity.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("\r\n");


            #line 122 "..\..\Help\Views\ViewEntity.cshtml"


            #line default
            #line hidden

            #line 122 "..\..\Help\Views\ViewEntity.cshtml"

                    var allowedOperations = eh.Operations.Where(a => a.Value.IsAllowed() == null).ToDictionary();


            #line default
            #line hidden
                    WriteLiteral("\r\n\r\n");


            #line 126 "..\..\Help\Views\ViewEntity.cshtml"


            #line default
            #line hidden

            #line 126 "..\..\Help\Views\ViewEntity.cshtml"
                    if (allowedOperations.Any())
                    {
                        var operations = ec.TypeElementContext(e => e.Operations).ToDictionary(a => a.Value.Operation);



            #line default
            #line hidden
                        WriteLiteral("                    <div");

                        WriteLiteral(" id=\"operations\"");

                        WriteLiteral(">\r\n                        <h2");

                        WriteLiteral(" class=\"greyTitle\"");

                        WriteLiteral(">");


            #line 131 "..\..\Help\Views\ViewEntity.cshtml"
                        Write(Html.PropertyNiceName(() => eh.Entity.Value.Operations));


            #line default
            #line hidden
                        WriteLiteral("</h2>\r\n                        <dl");

                        WriteLiteral(" class=\"dl-horizontal\"");

                        WriteLiteral(">\r\n");


            #line 133 "..\..\Help\Views\ViewEntity.cshtml"


            #line default
            #line hidden

            #line 133 "..\..\Help\Views\ViewEntity.cshtml"
                        foreach (var op in allowedOperations)
                        {
                            using (TypeElementContext <OperationHelpEntity> ctx = operations.GetOrThrow(op.Key))
                            {
            #line default
            #line hidden
                                WriteLiteral("                                <dt");

                                WriteAttribute("id", Tuple.Create(" id=\"", 5953), Tuple.Create("\"", 5987)

            #line 137 "..\..\Help\Views\ViewEntity.cshtml"
                                               , Tuple.Create(Tuple.Create("", 5958), Tuple.Create <System.Object, System.Int32>(HelpUrls.IdOperation(op.Key)

            #line default
            #line hidden
                                                                                                                                 , 5958), false)
                                               );

                                WriteLiteral(">");


            #line 137 "..\..\Help\Views\ViewEntity.cshtml"
                                Write(op.Key.NiceToString());


            #line default
            #line hidden
                                WriteLiteral("<code");

                                WriteLiteral(" class=\'shortcut\'");

                                WriteLiteral(">[o:");


            #line 137 "..\..\Help\Views\ViewEntity.cshtml"
                                Write(op.Key.Key);


            #line default
            #line hidden
                                WriteLiteral("]</code></dt>\r\n");

                                WriteLiteral("                                <dd>\r\n                                    <span");

                                WriteLiteral(" class=\"info\"");

                                WriteLiteral(">\r\n");

                                WriteLiteral("                                        ");


            #line 140 "..\..\Help\Views\ViewEntity.cshtml"
                                Write(Html.WikiParse(op.Value.Info, HelpWiki.DefaultWikiSettings));


            #line default
            #line hidden
                                WriteLiteral("\r\n                                    </span>\r\n");

                                WriteLiteral("                                    ");


            #line 142 "..\..\Help\Views\ViewEntity.cshtml"
                                Write(Html.HiddenRuntimeInfo(ctx));


            #line default
            #line hidden
                                WriteLiteral("\r\n");

                                WriteLiteral("                                    ");


            #line 143 "..\..\Help\Views\ViewEntity.cshtml"
                                Write(Html.HiddenRuntimeInfo(ctx, e => e.Culture));


            #line default
            #line hidden
                                WriteLiteral("\r\n");

                                WriteLiteral("                                    ");


            #line 144 "..\..\Help\Views\ViewEntity.cshtml"
                                Write(Html.HiddenRuntimeInfo(ctx, a => a.Operation));


            #line default
            #line hidden
                                WriteLiteral("\r\n");

                                WriteLiteral("                                    ");


            #line 145 "..\..\Help\Views\ViewEntity.cshtml"
                                Write(Html.TextArea(ctx.SubContextPrefix(a => a.Description), op.Value.UserDescription, new { @class = "editable" }));


            #line default
            #line hidden
                                WriteLiteral("\r\n                                    <span");

                                WriteLiteral(" class=\"wiki\"");

                                WriteLiteral(">\r\n");

                                WriteLiteral("                                        ");


            #line 147 "..\..\Help\Views\ViewEntity.cshtml"
                                Write(Html.WikiParse(op.Value.UserDescription, HelpWiki.DefaultWikiSettings));


            #line default
            #line hidden
                                WriteLiteral("\r\n                                    </span>\r\n                                </" +
                                             "dd>\r\n");


            #line 150 "..\..\Help\Views\ViewEntity.cshtml"
                            }
                        }


            #line default
            #line hidden
                        WriteLiteral("                        </dl>\r\n                    </div>\r\n");


            #line 154 "..\..\Help\Views\ViewEntity.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("\r\n");


            #line 156 "..\..\Help\Views\ViewEntity.cshtml"


            #line default
            #line hidden

            #line 156 "..\..\Help\Views\ViewEntity.cshtml"

                    var allowedQueries = eh.Queries.Where(a => a.Value.IsAllowed() == null).ToDictionary();


            #line default
            #line hidden
                    WriteLiteral("\r\n\r\n");


            #line 160 "..\..\Help\Views\ViewEntity.cshtml"


            #line default
            #line hidden

            #line 160 "..\..\Help\Views\ViewEntity.cshtml"
                    if (allowedQueries.Any())
                    {
                        var queries = ec.TypeElementContext(e => e.Queries).ToDictionary(a => a.Value.Query);



            #line default
            #line hidden
                        WriteLiteral("                    <div");

                        WriteLiteral(" id=\"queries\"");

                        WriteLiteral(">\r\n                        <h2");

                        WriteLiteral(" class=\"greyTitle\"");

                        WriteLiteral(">");


            #line 165 "..\..\Help\Views\ViewEntity.cshtml"
                        Write(typeof(QueryEntity).NicePluralName());


            #line default
            #line hidden
                        WriteLiteral("</h2>\r\n");


            #line 166 "..\..\Help\Views\ViewEntity.cshtml"


            #line default
            #line hidden

            #line 166 "..\..\Help\Views\ViewEntity.cshtml"
                        foreach (var mq in allowedQueries)
                        {
                            using (TypeElementContext <QueryHelpEntity> qctx = queries.GetOrThrow(QueryLogic.GetQueryEntity(mq.Key)))
                            {
            #line default
            #line hidden

            #line 171 "..\..\Help\Views\ViewEntity.cshtml"
                                Write(Html.HiddenRuntimeInfo(qctx));


            #line default
            #line hidden

            #line 171 "..\..\Help\Views\ViewEntity.cshtml"



            #line default
            #line hidden

            #line 172 "..\..\Help\Views\ViewEntity.cshtml"
                                Write(Html.HiddenRuntimeInfo(qctx, e => e.Culture));


            #line default
            #line hidden

            #line 172 "..\..\Help\Views\ViewEntity.cshtml"



            #line default
            #line hidden

            #line 173 "..\..\Help\Views\ViewEntity.cshtml"
                                Write(Html.HiddenRuntimeInfo(qctx, a => a.Query));


            #line default
            #line hidden

            #line 173 "..\..\Help\Views\ViewEntity.cshtml"



            #line default
            #line hidden
                                WriteLiteral("                            <h3");

                                WriteAttribute("id", Tuple.Create(" id=\"", 8163), Tuple.Create("\"", 8193)

            #line 174 "..\..\Help\Views\ViewEntity.cshtml"
                                               , Tuple.Create(Tuple.Create("", 8168), Tuple.Create <System.Object, System.Int32>(HelpUrls.IdQuery(mq.Key)

            #line default
            #line hidden
                                                                                                                                 , 8168), false)
                                               );

                                WriteLiteral(">");


            #line 174 "..\..\Help\Views\ViewEntity.cshtml"
                                Write(QueryUtils.GetNiceName(mq.Key));


            #line default
            #line hidden
                                WriteLiteral("</h3>\r\n");

                                WriteLiteral("                            <div");

                                WriteLiteral(" class=\"queryName\"");

                                WriteLiteral(">\r\n                                <code");

                                WriteLiteral(" class=\'shortcut\'");

                                WriteLiteral(">[q:");


            #line 176 "..\..\Help\Views\ViewEntity.cshtml"
                                Write(QueryUtils.GetKey(mq.Key));


            #line default
            #line hidden
                                WriteLiteral("]</code>\r\n                                <span");

                                WriteLiteral(" class=\"info\"");

                                WriteLiteral(">\r\n");

                                WriteLiteral("                                    ");


            #line 178 "..\..\Help\Views\ViewEntity.cshtml"
                                Write(Html.WikiParse(mq.Value.Info, HelpWiki.DefaultWikiSettings));


            #line default
            #line hidden
                                WriteLiteral("\r\n                                </span>\r\n");

                                WriteLiteral("                                ");


            #line 180 "..\..\Help\Views\ViewEntity.cshtml"
                                Write(Html.TextArea(qctx.SubContextPrefix(a => a.Description), mq.Value.UserDescription, new { @class = "editable" }));


            #line default
            #line hidden
                                WriteLiteral("\r\n                                <span");

                                WriteLiteral(" class=\"wiki\"");

                                WriteLiteral(">\r\n");

                                WriteLiteral("                                    ");


            #line 182 "..\..\Help\Views\ViewEntity.cshtml"
                                Write(Html.WikiParse(mq.Value.UserDescription, HelpWiki.DefaultWikiSettings));


            #line default
            #line hidden
                                WriteLiteral("\r\n                                </span>\r\n                            </div>\r\n");


            #line 185 "..\..\Help\Views\ViewEntity.cshtml"

                                var allowedColumn = mq.Value.Columns.Where(a => a.Value.IsAllowed() == null);
                                if (allowedColumn.Any())
                                {
                                    var columns = qctx.TypeElementContext(a => a.Columns).ToDictionary(a => a.Value.ColumnName);



            #line default
            #line hidden
                                    WriteLiteral("                            <dl");

                                    WriteLiteral(" class=\"dl-horizontal columns\"");

                                    WriteLiteral(">\r\n");


            #line 192 "..\..\Help\Views\ViewEntity.cshtml"


            #line default
            #line hidden

            #line 192 "..\..\Help\Views\ViewEntity.cshtml"
                                    foreach (var qc in allowedColumn)
                                    {
                                        using (var ctx = columns.GetOrThrow(qc.Value.Column.Name))
                                        {
            #line default
            #line hidden

            #line 196 "..\..\Help\Views\ViewEntity.cshtml"
                                            Write(Html.HiddenRuntimeInfo(ctx));


            #line default
            #line hidden

            #line 196 "..\..\Help\Views\ViewEntity.cshtml"



            #line default
            #line hidden
                                            WriteLiteral("                                    <dt>");


            #line 197 "..\..\Help\Views\ViewEntity.cshtml"
                                            Write(qc.Value.NiceName);


            #line default
            #line hidden
                                            WriteLiteral("</dt>\r\n");

                                            WriteLiteral("                                    <dd>\r\n                                       " +
                                                         " <span");

                                            WriteLiteral(" class=\"info\"");

                                            WriteLiteral(">\r\n");

                                            WriteLiteral("                                            ");


            #line 200 "..\..\Help\Views\ViewEntity.cshtml"
                                            Write(Html.WikiParse(qc.Value.Info, HelpWiki.DefaultWikiSettings));


            #line default
            #line hidden
                                            WriteLiteral("\r\n                                        </span>\r\n");

                                            WriteLiteral("                                        ");


            #line 202 "..\..\Help\Views\ViewEntity.cshtml"
                                            Write(Html.Hidden(ctx.SubContextPrefix(a => a.ColumnName), ctx.Value.ColumnName));


            #line default
            #line hidden
                                            WriteLiteral("\r\n");

                                            WriteLiteral("                                        ");


            #line 203 "..\..\Help\Views\ViewEntity.cshtml"
                                            Write(Html.TextArea(ctx.SubContextPrefix(a => a.Description), ctx.Value.Description, new { @class = "editable" }));


            #line default
            #line hidden
                                            WriteLiteral("\r\n                                        <span");

                                            WriteLiteral(" class=\"wiki\"");

                                            WriteLiteral(">\r\n");

                                            WriteLiteral("                                            ");


            #line 205 "..\..\Help\Views\ViewEntity.cshtml"
                                            Write(Html.WikiParse(qc.Value.UserDescription, HelpWiki.DefaultWikiSettings));


            #line default
            #line hidden
                                            WriteLiteral("\r\n                                        </span>\r\n                              " +
                                                         "      </dd>\r\n");


            #line 208 "..\..\Help\Views\ViewEntity.cshtml"
                                        }
                                    }


            #line default
            #line hidden
                                    WriteLiteral("                            </dl>\r\n");


            #line 211 "..\..\Help\Views\ViewEntity.cshtml"
                                }
                            }
                        }


            #line default
            #line hidden
                        WriteLiteral("                    </div>\r\n");


            #line 216 "..\..\Help\Views\ViewEntity.cshtml"
                    }


            #line default
            #line hidden
                    WriteLiteral("            </div>\r\n");


            #line 218 "..\..\Help\Views\ViewEntity.cshtml"
                }
            }


            #line default
            #line hidden
            WriteLiteral("    </div>\r\n\r\n    <div");

            WriteLiteral(" class=\"col-md-3\"");

            WriteLiteral(">\r\n");


            #line 223 "..\..\Help\Views\ViewEntity.cshtml"


            #line default
            #line hidden

            #line 223 "..\..\Help\Views\ViewEntity.cshtml"
            Html.RenderPartial(HelpClient.MiniMenu, new ViewDataDictionary {
                { "type", eh.Type }
            });

            #line default
            #line hidden
            WriteLiteral("\r\n    </div>\r\n</div>\r\n");
        }
Esempio n. 25
0
        public static MvcHtmlString CountSearchControl(this HtmlHelper helper, FindOptions findOptions, Context context, Action <CountSearchControl> settingsModifier)
        {
            var options = new CountSearchControl();

            if (settingsModifier != null)
            {
                settingsModifier(options);
            }

            var val = CountSearchControlInternal(findOptions, options, context);

            return(helper.FormGroup(context, context.Prefix, options.QueryLabelText ?? QueryUtils.GetNiceName(findOptions.QueryName),
                                    new HtmlTag("p").Class("form-control-static").InnerHtml(val)));
        }
Esempio n. 26
0
        public static WikiLink LinkParser(string content)
        {
            Match m = HelpLogic.HelpLinkRegex.Match(content);

            if (m.Success)
            {
                string letter = m.Groups["letter"].ToString();
                string link   = m.Groups["link"].ToString();
                string text   = m.Groups["text"].ToString();

                switch (letter)
                {
                case WikiFormat.EntityLink:
                    Type t = TypeLogic.TryGetType(link);
                    return(new WikiLink(
                               HelpUrls.EntityUrl(t),
                               text.HasText() ? text : t.NiceName()));

                case WikiFormat.Hyperlink:
                    return(new WikiLink(link, text));

                case WikiFormat.OperationLink:
                    OperationSymbol operation = SymbolLogic <OperationSymbol> .TryToSymbol(link);

                    List <Type> types = OperationLogic.FindTypes(operation).Where(TypeLogic.TypeToEntity.ContainsKey).ToList();
                    if (types.Count == 1)
                    {
                        return(new WikiLink(
                                   HelpUrls.OperationUrl(types[0], operation),
                                   text.HasText() ? text : operation.NiceToString()));
                    }
                    else
                    {
                        return(new MultiWikiLink(operation.NiceToString())
                        {
                            Links = types.Select(currentType =>
                                                 new WikiLink(
                                                     HelpUrls.OperationUrl(currentType, operation),
                                                     currentType.NiceName(), operation.NiceToString())).ToList()
                        });
                    }

                case WikiFormat.PropertyLink:
                    PropertyRoute route = PropertyRoute.Parse(TypeLogic.TryGetType(link.Before('.')), link.After('.'));

                    while (route.PropertyRouteType == PropertyRouteType.LiteEntity ||
                           route.PropertyRouteType == PropertyRouteType.Mixin ||
                           route.PropertyRouteType == PropertyRouteType.MListItems)
                    {
                        route = route.Parent;
                    }

                    return(new WikiLink(HelpUrls.PropertyUrl(route), route.PropertyInfo.NiceName()));

                case WikiFormat.QueryLink:
                    object o = QueryLogic.TryToQueryName(link);
                    if (o as Enum != null)
                    {
                        Enum query = (Enum)o;
                        return(new WikiLink(
                                   HelpUrls.QueryUrl(query),
                                   text.HasText() ? text : QueryUtils.GetNiceName(query)));
                    }
                    else
                    {
                        Type query = (Type)o;
                        return(new WikiLink(
                                   HelpUrls.QueryUrl(query),
                                   text.HasText() ? text : QueryUtils.GetNiceName(query)));
                    }

                case WikiFormat.NamespaceLink:
                    NamespaceHelp nameSpace = HelpLogic.GetNamespaceHelp(link);
                    return(new WikiLink(
                               HelpUrls.NamespaceUrl(link),
                               text.HasText() ? text : link,
                               nameSpace != null ? "" : "unavailable"));

                case WikiFormat.AppendixLink:
                    AppendixHelp appendix = HelpLogic.GetAppendixHelp(link);
                    return(new WikiLink(
                               HelpUrls.AppendixUrl(link),
                               text.HasText() ? text : link,
                               appendix != null ? "" : "unavailable"));
                }
            }
            return(null);
        }
Esempio n. 27
0
        public override void Execute()
        {
            WriteLiteral("\r\n\r\n");


            #line 12 "..\..\UserQueries\Views\UserQuery.cshtml"
            using (var e = Html.TypeContext <UserQueryEntity>())
            {
                e.LabelColumns = new BsColumn(2);

                object queryName = QueryLogic.ToQueryName(e.Value.Query.Key);
                ViewData[ViewDataKeys.QueryDescription] = DynamicQueryManager.Current.QueryDescription(queryName); //To be use inside Repeaters



            #line default
            #line hidden

            #line 19 "..\..\UserQueries\Views\UserQuery.cshtml"
                Write(Html.EntityLine(e, f => f.Owner, el => el.Create = false));


            #line default
            #line hidden

            #line 19 "..\..\UserQueries\Views\UserQuery.cshtml"


                using (var query = e.SubContext(f => f.Query))
                {
            #line default
            #line hidden

            #line 23 "..\..\UserQueries\Views\UserQuery.cshtml"
                    Write(Html.HiddenRuntimeInfo(query));


            #line default
            #line hidden

            #line 23 "..\..\UserQueries\Views\UserQuery.cshtml"



            #line default
            #line hidden

            #line 25 "..\..\UserQueries\Views\UserQuery.cshtml"
                    Write(Html.Hidden(query.Compose("Key"), query.Value.Key));


            #line default
            #line hidden

            #line 25 "..\..\UserQueries\Views\UserQuery.cshtml"


                    var niceName = QueryUtils.GetNiceName(query.Value.ToQueryName());



            #line default
            #line hidden

            #line 29 "..\..\UserQueries\Views\UserQuery.cshtml"
                    Write(Html.FormGroup(e, null, typeof(QueryEntity).NiceName(), Finder.IsFindable(queryName) ?
                                         new HtmlTag("a").Class("form-control-static").Attr("href", Finder.FindRoute(queryName)).SetInnerText(niceName).ToHtml() :
                                         Html.Span(null, niceName, "form-control-static")));


            #line default
            #line hidden

            #line 31 "..\..\UserQueries\Views\UserQuery.cshtml"
                }



            #line default
            #line hidden

            #line 35 "..\..\UserQueries\Views\UserQuery.cshtml"
                Write(Html.ValueLine(e, f => f.DisplayName));


            #line default
            #line hidden

            #line 35 "..\..\UserQueries\Views\UserQuery.cshtml"


                var entityTypePrefix = e.SubContext(a => a.EntityType).Prefix;



            #line default
            #line hidden

            #line 39 "..\..\UserQueries\Views\UserQuery.cshtml"
                Write(Html.EntityLine(e, f => f.EntityType, el =>
                {
                    el.AutocompleteUrl = Url.Action("TypeAutocomplete", "Finder");
                    el.AttachFunction  = UserAssetsClient.Module["attachShowCurrentEntity"](el);
                }));


            #line default
            #line hidden

            #line 43 "..\..\UserQueries\Views\UserQuery.cshtml"



            #line default
            #line hidden
                WriteLiteral("    <p");

                WriteLiteral(" class=\"messageEntity col-sm-offset-2\"");

                WriteLiteral(">\r\n");

                WriteLiteral("        ");


            #line 46 "..\..\UserQueries\Views\UserQuery.cshtml"
                Write(UserQueryMessage.Use0ToFilterCurrentEntity.NiceToString().FormatWith(CurrentEntityConverter.CurrentEntityKey));


            #line default
            #line hidden
                WriteLiteral("\r\n    </p>\r\n");


            #line 48 "..\..\UserQueries\Views\UserQuery.cshtml"



            #line default
            #line hidden

            #line 49 "..\..\UserQueries\Views\UserQuery.cshtml"
                Write(Html.ValueLine(e, f => f.SearchOnLoad));


            #line default
            #line hidden

            #line 49 "..\..\UserQueries\Views\UserQuery.cshtml"



            #line default
            #line hidden

            #line 50 "..\..\UserQueries\Views\UserQuery.cshtml"
                Write(Html.ValueLine(e, f => f.ShowFilterButton));


            #line default
            #line hidden

            #line 50 "..\..\UserQueries\Views\UserQuery.cshtml"



            #line default
            #line hidden

            #line 51 "..\..\UserQueries\Views\UserQuery.cshtml"
                Write(Html.ValueLine(e, f => f.WithoutFilters));


            #line default
            #line hidden

            #line 51 "..\..\UserQueries\Views\UserQuery.cshtml"


                using (var sc = e.SubContext())
                {
                    sc.FormGroupSize = FormGroupSize.Small;



            #line default
            #line hidden
                    WriteLiteral("    <div");

                    WriteLiteral(" class=\"repeater-inline form-inline sf-filters-list \"");

                    WriteLiteral(">\r\n");

                    WriteLiteral("        ");


            #line 58 "..\..\UserQueries\Views\UserQuery.cshtml"
                    Write(Html.EntityRepeater(e, f => f.Filters, er => { er.PreserveViewData = true; }));


            #line default
            #line hidden
                    WriteLiteral("\r\n    </div>\r\n");


            #line 60 "..\..\UserQueries\Views\UserQuery.cshtml"



            #line default
            #line hidden

            #line 61 "..\..\UserQueries\Views\UserQuery.cshtml"
                    Write(Html.ValueLine(e, f => f.ColumnsMode));


            #line default
            #line hidden

            #line 61 "..\..\UserQueries\Views\UserQuery.cshtml"



            #line default
            #line hidden
                    WriteLiteral("    <div");

                    WriteLiteral(" class=\"repeater-inline form-inline sf-filters-list\"");

                    WriteLiteral(">\r\n");

                    WriteLiteral("        ");


            #line 63 "..\..\UserQueries\Views\UserQuery.cshtml"
                    Write(Html.EntityRepeater(e, f => f.Columns, er => { er.PreserveViewData = true; }));


            #line default
            #line hidden
                    WriteLiteral("\r\n    </div>\r\n");


            #line 65 "..\..\UserQueries\Views\UserQuery.cshtml"



            #line default
            #line hidden
                    WriteLiteral("    <div");

                    WriteLiteral(" class=\"repeater-inline form-inline sf-filters-list\"");

                    WriteLiteral(">\r\n");

                    WriteLiteral("        ");


            #line 67 "..\..\UserQueries\Views\UserQuery.cshtml"
                    Write(Html.EntityRepeater(e, f => f.Orders, er => { er.PreserveViewData = true; }));


            #line default
            #line hidden
                    WriteLiteral("\r\n    </div>\r\n");


            #line 69 "..\..\UserQueries\Views\UserQuery.cshtml"
                }



            #line default
            #line hidden

            #line 71 "..\..\UserQueries\Views\UserQuery.cshtml"
                Write(Html.ValueLine(e, f => f.PaginationMode));


            #line default
            #line hidden

            #line 71 "..\..\UserQueries\Views\UserQuery.cshtml"



            #line default
            #line hidden

            #line 72 "..\..\UserQueries\Views\UserQuery.cshtml"
                Write(Html.ValueLine(e, f => f.ElementsPerPage));


            #line default
            #line hidden

            #line 72 "..\..\UserQueries\Views\UserQuery.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("</div>\r\n");
        }
Esempio n. 28
0
        public SearchWindowProxy SelectQuery(object queryName)
        {
            var omniboxName = QueryUtils.GetNiceName(queryName).ToOmniboxPascal();

            return(new SearchWindowProxy(SelectCapture(omniboxName, "Q:" + QueryUtils.GetKey(queryName), className: "SearchWindow")));
        }
Esempio n. 29
0
 public Dictionary <string, object> GetQueries()
 {
     return(queries.GetOrAdd(CultureInfo.CurrentCulture, ci =>
                             GetAllQueryNames().ToOmniboxPascalDictionary(qn => QueryUtils.GetNiceName(qn), qn => qn)));
 }
Esempio n. 30
0
        public static IEnumerable <SearchResult> Search(this EntityHelp entity, Regex regex)
        {
            Type type = entity.Type;

            //Types
            Match m;

            m = regex.Match(type.NiceName().RemoveDiacritics());
            if (m.Success)
            {
                yield return(new SearchResult(TypeSearchResult.Type, type.NiceName(), entity.Description.DefaultText(entity.Info).Etc(etcLength), type, m, HelpUrls.EntityUrl(type)));

                yield break;
            }


            //Types description
            if (entity.Description.HasText())
            {
                // TODO: Some times the rendered Description does not contain the query term and it looks strange. Description should be
                // wiki-parsed and then make the search over this string
                if (m.Success)
                {
                    yield return(new SearchResult(TypeSearchResult.Type, type.NiceName(), entity.Description.Extract(m), type, m, HelpUrls.EntityUrl(type), isDescription: true));

                    yield break;
                }
            }


            //Properties (key)
            foreach (var p in  entity.Properties.Values)
            {
                if (p.PropertyInfo != null)
                {
                    m = regex.Match(p.PropertyInfo.NiceName().RemoveDiacritics());
                    if (m.Success)
                    {
                        yield return(new SearchResult(TypeSearchResult.Property, p.PropertyInfo.NiceName(), p.UserDescription.DefaultText(p.Info).Etc(etcLength), type, m,
                                                      HelpUrls.PropertyUrl(p.PropertyRoute)));

                        continue;
                    }
                }
                else if (p.UserDescription.HasText())
                {
                    m = regex.Match(p.UserDescription.RemoveDiacritics());
                    if (m.Success)
                    {
                        yield return(new SearchResult(TypeSearchResult.Property, p.PropertyInfo?.NiceName(), p.UserDescription.Extract(m), type, m,
                                                      HelpUrls.PropertyUrl(p.PropertyRoute), isDescription: true));
                    }
                }
            }

            //Queries (key)
            foreach (var p in entity.Queries.Values)
            {
                m = regex.Match(QueryUtils.GetNiceName(p.QueryName).RemoveDiacritics());
                if (m.Success)
                {
                    yield return(new SearchResult(TypeSearchResult.Query, QueryUtils.GetNiceName(p.QueryName), p.UserDescription.DefaultText(p.Info).Etc(etcLength), type, m,
                                                  HelpUrls.QueryUrl(p.QueryName, type)));
                }
                else if (p.UserDescription.HasText())
                {
                    m = regex.Match(p.UserDescription.ToString().RemoveDiacritics());
                    if (m.Success)
                    {
                        yield return(new SearchResult(TypeSearchResult.Query, QueryUtils.GetNiceName(p.QueryName), p.UserDescription.Extract(m), type, m,
                                                      HelpUrls.QueryUrl(p.QueryName, type), isDescription: true));
                    }
                }
            }

            //Operations (key)
            foreach (var op in entity.Operations.Values)
            {
                m = regex.Match(op.OperationSymbol.NiceToString().RemoveDiacritics());
                if (m.Success)
                {
                    yield return(new SearchResult(TypeSearchResult.Operation, op.OperationSymbol.NiceToString(), op.UserDescription.DefaultText(op.Info).Etc(etcLength), type, m,
                                                  HelpUrls.OperationUrl(type, op.OperationSymbol)));
                }
                else if (op.UserDescription.HasText())
                {
                    m = regex.Match(op.UserDescription.ToString().RemoveDiacritics());
                    if (m.Success)
                    {
                        yield return(new SearchResult(TypeSearchResult.Operation, op.OperationSymbol.NiceToString(), op.UserDescription.Extract(m), type, m,
                                                      HelpUrls.OperationUrl(type, op.OperationSymbol), isDescription: true));
                    }
                }
            }
        }