/// <summary> /// Deserializing contructor. /// </summary> public AdapterManagementComponent(SerializationInfo info, StreamingContext context) : base(info, context) { _adapters = new GenericContainer<IIntegrationAdapter>(); _adapters.ItemAddedEvent += new GenericContainer<IIntegrationAdapter>.ItemUpdateDelegate(Adapters_ItemAddedEvent); _adapters.ItemRemovedEvent += new GenericContainer<IIntegrationAdapter>.ItemUpdateDelegate(Adapters_ItemRemovedEvent); _startedAdaptersIds = (List<ComponentId>)info.GetValue("startedAdaptersIds", _startedAdaptersIds.GetType()); // Adapters are serialized one by one, to add safety when deserializing (one adapter will // otherwise block the entire deserialization for the manager). int adaptersCount = (int)info.GetValue("adapterCount", typeof(int)); for (int i = 0; i < adaptersCount; i++) { try { IIntegrationAdapter adapter = (IIntegrationAdapter)info.GetValue("adapter_" + i, typeof(IIntegrationAdapter)); _adapters.Add(adapter); } catch (SerializationException ex) { SystemMonitor.OperationError("Failed to deserialize integration adapter [" + ex.Message + "]."); } catch (InvalidCastException ex) { SystemMonitor.OperationError("Failed to deserialize integration adapter [" + ex.Message + "]."); } } ChangeOperationalState(OperationalStateEnum.Constructed); }
/// <summary> /// Initializes the controls part of your template. /// </summary> /// <param name="container">Template container for all controls.</param> /// <remarks> /// Initialize your controls in this method. Do not override CreateChildControls method. /// </remarks> protected override void InitializeControls(GenericContainer container) { JavaScriptSerializer serializer = new JavaScriptSerializer(); List<Hashtable> images = this.GetImages(); string serializedCollection = serializer.Serialize(images); this.imagesField = container.GetControl<HiddenField>("imagesField", true); this.imagesField.Value = serializedCollection; }
protected override void InitializeControls(GenericContainer container) { //string productStringId = Product.ToString(); //Guid productId = Guid.Parse(Product); var cm = CatalogManager.GetManager(); var dm = DynamicModuleManager.GetManager(); IQueryable<DynamicContent> source = GetReviewsById(Product); lblGoToReviews.Text = source.Count() + " reviews"; rating.Value = totalRating(source); }
protected override void InitializeControls(GenericContainer container) { this.RadUploadControl.AllowedFileExtensions = new string[] { ".zip" }; this.RadUploadControl.ControlObjectsVisibility = ControlObjectsVisibility.None; this.RadUploadControl.OverwriteExistingFiles = true; this.RadUploadControl.TargetPhysicalFolder = AppDomain.CurrentDomain.BaseDirectory; this.RadUploadControl.MaxFileSize = 2147483647; this.ImportButton.Text = "Import template"; this.ImportButton.Click += new EventHandler(this.UploadButton_Click); this.ImageControl.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(TemplateImporterServerControl), "TemplateImporter.Web.Controls.importer_bg.jpg"); }
protected override void InitializeControls(GenericContainer container) { // ensure the username is valid if (string.IsNullOrEmpty(Username)) return; // retrieve contents var url = string.Format(FEED_URL, Username); var vidXml = XDocument.Load(url); if (vidXml == null) return; // parse to collection var query = from t in vidXml.Descendants("item") select new { Url = t.Element("link").Value, Title = t.Element("title").Value, Thumbnail = ToThumbnail(t.Element("link").Value) }; // empty set? if (query.Count() == 0) return; // bind, limiting count YouTubeRepeater.DataSource = query.Take(MaxVideos); YouTubeRepeater.DataBind(); }
protected override void InitializeControls(GenericContainer container) { // TODO: Possibly change the visibility of the different controls dependent on the 'ItemsPerPage' and the 'ItemCount' if (this.ItemsPerPage <= 0) { this.Visible = false; return; } int selectedItemCount = DetermineSelectedItemCount(); if (selectedItemCount == NoSelectedItemCount) { selectedItemCount = this.ItemsPerPage; } InitilizeSelectorLink(ItemsTimesOne, 1, selectedItemCount); InitilizeSelectorLink(ItemsTimesTwo, 2, selectedItemCount); InitilizeSelectorLink(ItemsTimesThree, 3, selectedItemCount); ViewAll.NavigateUrl = BuildNavigateUrl(ShowAllItemsItemCountValue); if (selectedItemCount == ShowAllItemsItemCountValue) { ViewAll.Enabled = false; } }
/// <summary> /// Initializes the controls. /// </summary> /// <param name="container">The controls container.</param> /// <param name="definition">The content view definition.</param> protected override void InitializeControls(GenericContainer container, IContentViewDefinition definition) { var detailDefinition = definition as IContentViewDetailDefinition; if (detailDefinition != null) { var productsView = (ProductsView)this.Host; var item = productsView.DetailItem as ProductItem; if (item == null) { if (this.IsDesignMode()) { this.Controls.Clear(); this.Controls.Add(new LiteralControl("A product item was not selected or has been deleted. Please select another one.")); } return; } else { this.DetailsView.ItemDataBound += new EventHandler<RadListViewItemEventArgs>(DetailsView_ItemDataBound); this.DetailsView.DataSource = new ProductItem[] { item }; } } }
/// <summary> /// Initializes the controls. /// </summary> /// <param name="container">The controls container.</param> /// <param name="definition">The content view definition.</param> protected override void InitializeControls(GenericContainer container, IContentViewDefinition definition) { // ensure a valid definition is passed var detailDefinition = definition as IContentViewDetailDefinition; if (detailDefinition == null) return; // retrieve item from host control var ProjectsView = (ProjectsView)this.Host; var item = ProjectsView.DetailItem as ProjectItem; if (item == null) { // no item if (this.IsDesignMode()) { this.Controls.Clear(); this.Controls.Add(new LiteralControl("A Project item was not selected or has been deleted. Please select another one.")); } return; } // show item details this.DetailsViewControl.DataSource = new ProjectItem[] { item }; }
/// <summary> /// Initializes the controls. /// </summary> /// <param name="container">The controls container.</param> /// <param name="definition">The content view definition.</param> protected override void InitializeControls(GenericContainer container, IContentViewDefinition definition) { if (this.CurrentPage != null) { this.Title.Text = this.CurrentPage.Title; } lbnListView.Click += new EventHandler(ViewTypeButtonsClicked); lbnThumbnailView.Click += new EventHandler(ViewTypeButtonsClicked); lbnItemPerPage_Nine.Click += new EventHandler(ItemPerPageButtonsClicked); lbnItemPerPage_Eighteen.Click += new EventHandler(ItemPerPageButtonsClicked); lbnItemPerPage_Twentyseven.Click += new EventHandler(ItemPerPageButtonsClicked); lbnSortBy_Price.Click += new EventHandler(SortByButtonsClicked); //lbnSortBy_Location.Click += new EventHandler(SortByButtonsClicked); if (!Page.IsPostBack) { this.BindItems(); } }
protected override void InitializeControls(GenericContainer container) { this.TitleLabel.Text = this.Title; this.DescriptionLabel.Text = this.Description; this.ExampleLabel.Text = this.Example; this.ItemsSelector.ServiceUrl = RelatedUsersField.UsersServicePath; this.ItemsSelector.ItemType = this.UserType; }
/// <summary> /// Initializes the controls. /// </summary> /// <param name="container"></param> /// <remarks> /// Initialize your controls in this method. Do not override CreateChildControls method. /// </remarks> protected override void InitializeControls(GenericContainer container) { Repeater rptLightBox = this.rptLightBox; var album = App.WorkWith().Albums() .FirstThat(a => a.Id.ToString().ToLower() == this.Images.ToLower() || a.Title.ToString().ToLower() == Images.ToLower()); if (album != null) { rptLightBox.DataSource = album.Images().Where(c => c.Visible).OrderBy(c => c.Ordinal).Get(); rptLightBox.ItemDataBound += rptLightBox_ItemDataBound; rptLightBox.DataBind(); //rptTmbLightBox rptTmbLightBox.DataSource = album.Images().Where(c => c.Visible).OrderBy(c => c.Ordinal).Get(); rptTmbLightBox.ItemDataBound += rptTmbLightBox_ItemDataBound; rptTmbLightBox.DataBind(); } }
void Adapters_ItemOperationalStatusChangedEvent(GenericContainer <IIntegrationAdapter> keeper, IIntegrationAdapter item) { WinFormsHelper.BeginFilteredManagedInvoke(this, UpdateUI); }
/// <summary> /// Initializes the controls. /// </summary> /// <param name="container">The controls container.</param> /// <param name="definition">The content view definition.</param> protected override void InitializeControls(GenericContainer container, IContentViewDefinition definition) { // ensure a valid definition is passed var masterDefinition = definition as IContentViewMasterDefinition; if (masterDefinition == null) return; // retrieve Projects from the manager var manager = ProjectsManager.GetManager(this.Host.ControlDefinition.ProviderName); var query = manager.GetProjects(); // check for filters on the Projects query if (masterDefinition.AllowUrlQueries.HasValue && masterDefinition.AllowUrlQueries.Value) { query = this.EvaluateUrl(query, "Date", "PublicationDate", this.Host.UrlEvaluationMode, this.Host.UrlKeyPrefix); query = this.EvaluateUrl(query, "Author", "Owner", this.Host.UrlEvaluationMode, this.Host.UrlKeyPrefix); query = this.EvaluateUrl(query, "Taxonomy", "", typeof(ProjectItem), this.Host.UrlEvaluationMode, this.Host.UrlKeyPrefix); } // modify pager based on query results int? totalCount = 0; int? itemsToSkip = 0; if (masterDefinition.AllowPaging.HasValue && masterDefinition.AllowPaging.Value) itemsToSkip = this.GetItemsToSkipCount(masterDefinition.ItemsPerPage, this.Host.UrlEvaluationMode, this.Host.UrlKeyPrefix); // culture for Urls in pager CultureInfo uiCulture = null; if (Config.Get<ResourcesConfig>().Multilingual) uiCulture = System.Globalization.CultureInfo.CurrentUICulture; // check for additional filters set by the definition var filterExpression = String.Empty; // modify the query with everything from above query = Telerik.Sitefinity.Data.DataProviderBase.SetExpressions( query, filterExpression, masterDefinition.SortExpression, uiCulture, itemsToSkip, masterDefinition.ItemsPerPage, ref totalCount); this.IsEmptyView = (totalCount == 0); // display results if (totalCount == 0) this.ProjectsListControl.Visible = false; else { this.ConfigurePager(totalCount.Value, masterDefinition); this.ProjectsListControl.DataSource = query.ToList(); } }
protected override void InitializeControls(GenericContainer container, Telerik.Sitefinity.Web.UI.ContentUI.Contracts.IContentViewDefinition definition) { this.SetBrowserAutocomplete(); base.InitializeControls(container, definition); }
protected override void InitializeControls(GenericContainer container) { _currentSiteId = SystemManager.CurrentContext.CurrentSite.Id; _sfTrackingCookie = HttpContext.Current.Request.Cookies["sf-trckngckie"]; switch (ExtendedFormType) { case "conditional": _isConditionalForm = true; break; case "progressive": _isProgressiveForm = true; break; } if (_isProgressiveForm) { _isProgressiveForm = true; _priorFormEntry = GetPriorFormEntry(); } if (!this.IsLicensed) { this.ErrorsPanel.Visible = true; ControlCollection controls = this.ErrorsPanel.Controls; Label label = new Label() { Text = Res.Get <FormsResources>().ModuleNotLicensed }; controls.Add(label); return; } if (this.FormData != null) { bool flag = true; CultureInfo currentUICulture = CultureInfo.CurrentUICulture; if (this.CurrentLanguage != null) { currentUICulture = new CultureInfo(this.CurrentLanguage); } if (!this.FormData.IsPublished(currentUICulture)) { flag = false; } if (flag) { this.RenderFormFields(); } } if (!this.formDescriptionFound && this.IsDesignMode()) { this.ErrorsPanel.Visible = true; ControlCollection controlCollections = this.ErrorsPanel.Controls; Label label1 = new Label() { Text = Res.Get <FormsResources>().TheSpecifiedFormNoLongerExists }; controlCollections.Add(label1); } HttpContextBase currentHttpContext = SystemManager.CurrentHttpContext; if (currentHttpContext != null && this.formDescriptionFound) { if (!currentHttpContext.Items.Contains("PageFormControls")) { currentHttpContext.Items["PageFormControls"] = string.Empty; } currentHttpContext.Items["PageFormControls"] = string.Format("{0}Id={1},ValidationGroup={2};", (string)currentHttpContext.Items["PageFormControls"], this.FormId, this.ValidationGroup); } }
public void RemoveContainer(GenericContainer c) { m_CollectionList.Remove(c); c.ParentComplexType = null; }
public void AddContainer(GenericContainer c) { m_CollectionList.Add(c); c.ParentComplexType = this; }
/// <summary> /// Initializes the controls. /// </summary> /// <param name="container"></param> /// <remarks> /// Initialize your controls in this method. Do not override CreateChildControls method. /// </remarks> protected override void InitializeControls(GenericContainer container) { PageSelector.RootNodeID = Telerik.Sitefinity.Abstractions.SiteInitializer.CurrentFrontendRootNodeId; }
/// <summary> /// Initializes the controls. /// </summary> /// <param name="container"></param> /// <remarks> /// Initialize your controls in this method. Do not override CreateChildControls method. /// </remarks> protected override void InitializeControls(GenericContainer container) { base.DesignerMode = ControlDesignerModes.Simple; base.AdvancedModeIsDefault = false; }
/// <summary> /// Initializes the controls. /// </summary> /// <param name="controlContainer">The control container.</param> protected override void InitializeControls(GenericContainer controlContainer) { controlContainer.GetControl <Button>("SubmitButton", true).Click += new EventHandler(this.JobApplicationUpload_Click); }
public void Validate(GenericContainer genericContainer) { Assert.IsNotNull(genericContainer); Validate(genericContainer.JSON); }
/// <inheritdoc /> protected override void InitializeControls(GenericContainer container) { var config = Config.Get <MailchimpConnectorConfig>(); this.ApiKeyTextBox.Text = config.MailchimpApiKey; }
/// <summary> /// Initializes the controls. /// </summary> /// <param name="container"></param> /// <remarks> /// Initialize your controls in this method. Do not override CreateChildControls method. /// </remarks> protected override void InitializeControls(GenericContainer container) { var sb = new StringBuilder(); // append fb script if (WidgetMode == WidgetModeType.FBML) sb.Append(Constants.FBML_SCRIPT); // bind html to control if (WidgetMode == WidgetModeType.IFRAME) sb.AppendFormat(IFRAME_SRC, Server.UrlEncode(this.Url), this.Layout, this.ShowFaces, WidgetWidth, this.Action.ToString().ToLower(), Server.UrlEncode(this.Font.ToLower()), this.ColorScheme.ToString().ToLower(), WidgetHeight); else sb.AppendFormat(FBML_SRC, HttpContext.Current.Server.UrlEncode(this.Url), this.Layout, this.ShowFaces, WidgetWidth, this.Action.ToString().ToLower(), this.Font.ToLower(), this.ColorScheme.ToString().ToLower()); LikeButtonHtml.Text = sb.ToString(); }
/// <summary> /// Initializes the controls. /// </summary> /// <param name="container">The container.</param> protected override void InitializeControls(GenericContainer container) { // defaults EventCalendar.Width = _width; EventCalendar.Height = _height; // attach event handlers EventCalendar.DayRender += Cal_DayRender; EventCalendar.DefaultViewChanged += Cal_DefaultViewChanged; // retrieve details page url DetailsPage = GetDetailsPage(); // empty page means use the current page if (string.IsNullOrEmpty(DetailsPage)) DetailsPage = HttpContext.Current.Request.RawUrl; if (Page.IsPostBack) return; // init calendar SelectedDate = EventCalendar.FocusedDate; LoadData(); }
/// <summary> /// Called when the deisnger loads /// </summary> /// <param name="container">The generic container</param> protected override void InitializeControls(GenericContainer container) { WidgetDesignerHelper helper = new WidgetDesignerHelper(); helper.AddStandardValue(container.Controls[0].Controls.Cast <Control>()); }
void Adapters_ItemRemovedEvent(GenericContainer<IIntegrationAdapter> keeper, IIntegrationAdapter item) { WinFormsHelper.BeginFilteredManagedInvoke(this, UpdateUI); }
protected override void InitializeControls(GenericContainer container) { // TODO: Implement this method FeedLink.NavigateUrl = FeedUrl; FeedLink.Text = LinkText; }
/// <summary> /// Initializes the controls. /// </summary> /// <param name="container"></param> /// <remarks> /// Initialize your controls in this method. Do not override CreateChildControls method. /// </remarks> protected override void InitializeControls(GenericContainer container) { if (this.NumberOfEventsToShow > 0) { this.EventsList.ItemDataBound += new EventHandler<RadListViewItemEventArgs>(EventsList_ItemDataBound); List<Event> dataSource = this.GetEventsListDataSource(); if (dataSource.Count > 0) { this.EventsList.DataSource = dataSource; this.EventsList.DataBind(); } else { this.Visible = false; } //this.ContentHtml.Text = LinkParser.ResolveLinks(this.Html, DynamicLinksParser.GetContentUrl, null, false); } this.IsEmpty = this.NumberOfEventsToShow < 1; }
/// <summary> /// Initializes the controls. /// </summary> /// <param name="container"></param> /// <remarks> /// Initialize your controls in this method. Do not override CreateChildControls method. /// </remarks> protected override void InitializeControls(GenericContainer container) { Sumbit.Click += Submit_Click; }
protected override void InitializeControls(GenericContainer container) { _currentSiteId = SystemManager.CurrentContext.CurrentSite.Id; _sfTrackingCookie = HttpContext.Current.Request.Cookies["sf-trckngckie"]; switch (ExtendedFormType) { case "conditional": _isConditionalForm = true; break; case "progressive": _isProgressiveForm = true; break; } if (_isProgressiveForm) { _isProgressiveForm = true; _priorFormEntry = GetPriorFormEntry(); } if (!this.IsLicensed) { this.ErrorsPanel.Visible = true; ControlCollection controls = this.ErrorsPanel.Controls; Label label = new Label() { Text = Res.Get<FormsResources>().ModuleNotLicensed }; controls.Add(label); return; } if (this.FormData != null) { bool flag = true; CultureInfo currentUICulture = CultureInfo.CurrentUICulture; if (this.CurrentLanguage != null) { currentUICulture = new CultureInfo(this.CurrentLanguage); } if (!this.FormData.IsPublished(currentUICulture)) { flag = false; } if (flag) { this.RenderFormFields(); } } if (!this.formDescriptionFound && this.IsDesignMode()) { this.ErrorsPanel.Visible = true; ControlCollection controlCollections = this.ErrorsPanel.Controls; Label label1 = new Label() { Text = Res.Get<FormsResources>().TheSpecifiedFormNoLongerExists }; controlCollections.Add(label1); } HttpContextBase currentHttpContext = SystemManager.CurrentHttpContext; if (currentHttpContext != null && this.formDescriptionFound) { if (!currentHttpContext.Items.Contains("PageFormControls")) { currentHttpContext.Items["PageFormControls"] = string.Empty; } currentHttpContext.Items["PageFormControls"] = string.Format("{0}Id={1},ValidationGroup={2};", (string)currentHttpContext.Items["PageFormControls"], this.FormId, this.ValidationGroup); } }
private GenericContainer SetViewBagErrorMessageInvalidResponse(ResponseBase response, GenericContainer container) { if (container == null) { container = new GenericContainer(); } container.Add("IsValid", response.IsValid); if (!response.IsValid) { var urlDecode = HttpUtility.UrlDecode(response.ErrorMessage); if (urlDecode != null) { var message = HttpUtility.HtmlEncode(urlDecode.Replace(Environment.NewLine, " ")); container.Add("ErrorMessage", message); } } return(container); }
static void Main(string[] args) { try { String[] fff = System.IO.File.ReadAllLines(@"C:\Users\t-raynal\Desktop\ticker.txt").Where(v => (v != Environment.NewLine || v != string.Empty)).ToArray(); IEnumerable <String> value = fff.Where(v => (v.Length >= 2 && v.Substring(0, 2) == "GO")); foreach (String s in value) { Console.Out.WriteLine(s); } IContainer container = new GenericContainer(); container.RegisterProperty <String>("str", "ttttt"); container.RegisterProperty <DateTime>("date", DateTime.Parse("10/01/2001")); container.RegisterProperty <DateTime>("date", DateTime.Parse("12/02/2002")); foreach (IProperty p in container.Where(p => (p.Type == typeof(DateTime)))) { Console.Out.WriteLine(p.TryGetS <DateTime>().Value.ToShortDateString()); } //Console.Out.WriteLine(Type.GetType("ESGI.Yahoo.Finance.StockInfo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null").ToString()); //ESGI.Yahoo.Finance.StockInfo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null //GenericContainer container; //IOperation<GenericContainer> options = new OptionsInfo(); //options.Get("criterias").Set<String>("*"); //options.Get("symbol").Set<String>("GOOG"); //container = options.Execute(); //Console.Out.WriteLine("***********************************************"); //Console.Out.WriteLine(container.ToString()); //IOperation<GenericContainer> newsInfo = new NewsInfo(); //newsInfo.Get("symbol").Set<String>("GOOG"); //container = newsInfo.Execute(); //Console.Out.WriteLine("***********************************************"); //Console.Out.WriteLine(container.ToString()); //IOperation<GenericContainer> historic = new StockHistoryInfo(); //historic.Get("symbol").Set<String>("GOOG"); //container = historic.Execute(); //Console.Out.WriteLine("***********************************************"); //Console.Out.WriteLine(container.ToString()); //IOperation<GenericContainer> infos = new StockInfo(); //infos.Get("criterias").Set<String>("*"); //infos.Get("symbols").Set<String>("GOOG, AAPL"); //container = infos.Execute(); //Console.Out.WriteLine("***********************************************"); //Console.Out.WriteLine(container.ToString()); } catch (Exception e) { Console.Out.WriteLine(e.ToString()); } return; }
protected override void InitializeControls(GenericContainer container) { IFormFieldControl thisControl = base.ParentDesigner.PropertyEditor.Control as IFormFieldControl; FormDraftControl thisControlData = base.ParentDesigner.PropertyEditor.ControlData as FormDraftControl; FormDescription form = FManager.GetFormByName(thisControlData.Form.Name); IControlsContainer cc = GetControlsContainer(form.Id); List <ControlData> formControls = (List <ControlData>) typeof(PageHelper) .GetMethod("SortControls", BindingFlags.Static | BindingFlags.NonPublic) .Invoke(null, new object[] { new[] { cc }, 1 }); formControls.RemoveAll(fc => fc.ObjectType == "Telerik.Sitefinity.Modules.Forms.Web.UI.Fields.FormSubmitButton, Telerik.Sitefinity" || fc.IsLayoutControl == true); if (formControls.Count > 0) { List <CriteriaOption> criteriaOptions = new List <CriteriaOption>(); CultureInfo uiCulture = CultureInfo.GetCultureInfo(this.GetUICulture()); foreach (var formControl in formControls) { FieldControl fieldControl = FManager.LoadControl(formControl, uiCulture) as FieldControl; CriteriaOption co = new CriteriaOption(); if (fieldControl is FormChoiceField) { co.FieldType = "ChoiceField"; co.FieldName = Helpers.GetFieldName(fieldControl); co.Options = ((FormChoiceField)fieldControl).Choices .Select(c => new SimpleChoiceItem() { Text = c.Text, Value = c.Value }).ToList(); co.Conditions = new List <SimpleChoiceItem>() { new SimpleChoiceItem() { Text = "=", Value = "==" }, new SimpleChoiceItem() { Text = "!=", Value = "!=" } }; } if (fieldControl is TextField) { co.FieldType = "TextField"; co.FieldName = Helpers.GetFieldName(fieldControl); co.Conditions = new List <SimpleChoiceItem>() { new SimpleChoiceItem() { Text = "=", Value = "==" }, new SimpleChoiceItem() { Text = "!=", Value = "!=" }, new SimpleChoiceItem() { Text = "<", Value = "lt" }, new SimpleChoiceItem() { Text = ">", Value = "gt" } }; } criteriaOptions.Add(co); } StringBuilder script = new StringBuilder(); script.Append(@"<script>"); script.AppendFormat(@"var currentCultureC = ""{0}"";", this.GetUICulture()); script.AppendFormat(@"var optionFilter = ""{0}"";", Helpers.GetFieldName((FieldControl)thisControl)); script.AppendFormat(@"var criteriaOptions = {0};", Helpers.SerializeJSON <List <CriteriaOption> >(criteriaOptions)); string criteriaSetPropertyValue = ((IConditionalFormControl)thisControl).CriteriaSet; string criteriaSet = "[]"; if (!String.IsNullOrWhiteSpace(criteriaSetPropertyValue)) { criteriaSet = criteriaSetPropertyValue; } script.AppendFormat("var criteria = {0};", criteriaSet); script.Append(@"</script>"); Script.Text = script.ToString(); } }
/// <summary> /// Called when the deisnger loads /// </summary> /// <param name="container">The generic container</param> protected override void InitializeControls(GenericContainer container) { WidgetDesignerHelper helper = new WidgetDesignerHelper(); helper.AddStandardValue(container.Controls[0].Controls.Cast<Control>()); }
public void SubredditStylesheet() { GenericContainer res = reddit.Models.Subreddits.SubredditStylesheet(new SubredditsSubredditStylesheetInput(".whatever{}", "This is a test."), testData["Subreddit"]); Validate(res); }
protected override void InitializeControls(GenericContainer container) { this.ProductSelector.ServiceUrl = ProductBackendDefinitions.ProductServiceUrl + "?filter=[PublishedDrafts]"; this.ProductSelector.ItemType = typeof(Product).FullName; }
public NATSFixture() { _container = new ContainerBuilder <NATSContainer>() .Build(); }
/// <summary> /// Initializes the controls. /// </summary> /// <param name="container">The controls container.</param> /// <param name="definition">The content view definition.</param> protected override void InitializeControls(GenericContainer container, IContentViewDefinition definition) { var masterDefinition = definition as IContentViewMasterDefinition; if (masterDefinition != null) { var query = this.Manager.GetProducts(); if (masterDefinition.AllowUrlQueries.HasValue && masterDefinition.AllowUrlQueries.Value) { query = this.EvaluateUrl(query, "Date", "PublicationDate", this.Host.UrlEvaluationMode, this.Host.UrlKeyPrefix); query = this.EvaluateUrl(query, "Author", "Owner", this.Host.UrlEvaluationMode, this.Host.UrlKeyPrefix); query = this.EvaluateUrl(query, "Taxonomy", string.Empty, typeof(ProductItem), this.Host.UrlEvaluationMode, this.Host.UrlKeyPrefix); } int? totalCount = 0; int? itemsToSkip = 0; if (masterDefinition.AllowPaging.HasValue && masterDefinition.AllowPaging.Value) { itemsToSkip = this.GetItemsToSkipCount(masterDefinition.ItemsPerPage, this.Host.UrlEvaluationMode, this.Host.UrlKeyPrefix); } CultureInfo uiCulture = null; if (AppSettings.CurrentSettings.Multilingual) { uiCulture = System.Globalization.CultureInfo.CurrentUICulture; } //the filter is adapted to the implementation of ILifecycleDataItemGeneric, so the culture is taken in advance when filtering published items. this.FilterExpression = ContentHelper.AdaptMultilingualFilterExpression(this.FilterExpression); var filterExpression = DefinitionsHelper.GetFilterExpression(this.FilterExpression, this.AdditionalFilter); query = Telerik.Sitefinity.Data.DataProviderBase.SetExpressions( query, filterExpression, masterDefinition.SortExpression, uiCulture, itemsToSkip, masterDefinition.ItemsPerPage, ref totalCount); this.IsEmptyView = (totalCount == 0); if (totalCount == 0) { this.NewsList.Visible = false; } else { this.ConfigurePager(totalCount.Value, masterDefinition); this.NewsList.DataSource = query.ToList(); this.NewsList.PreRender += new EventHandler(NewsList_PreRender); } } }
protected override void InitializeControls(GenericContainer container) { var sb = new StringBuilder(); if (WidgetMode == WidgetModeType.FBML) sb.Append(Constants.FBML_SCRIPT); sb.AppendFormat(WidgetMode == WidgetModeType.IFRAME ? IFRAME_SRC : FBML_SRC, HttpContext.Current.Server.UrlEncode(Url), WidgetWidth, ColorScheme.ToString().ToLower(), NumConnections, ShowStream, ShowHeader, WidgetHeight); LikeBoxHtml.Text = sb.ToString(); }
/// <summary> /// Initializes the controls. /// </summary> /// <param name="container"></param> /// <remarks> /// Initialize your controls in this method. Do not override CreateChildControls method. /// </remarks> protected override void InitializeControls(GenericContainer container) { if (!Page.IsPostBack) { this.Calendar.VisibleDate = DateTime.Today; } this.Calendar.SelectionMode = CalendarSelectionMode.None; this.Calendar.DayRender += new DayRenderEventHandler(Calendar_DayRender); this.Calendar.VisibleMonthChanged += new MonthChangedEventHandler(Calendar_VisibleMonthChanged); this.Calendar.DataBinding += new EventHandler(Calendar_DataBinding); if (!Page.IsPostBack) { this.Calendar.DataBind(); } }
protected override void InitializeControls(GenericContainer container) { }
/// <summary> /// Initializes the controls. /// </summary> /// <param name="container"></param> /// <remarks> /// Initialize your controls in this method. Do not override CreateChildControls method. /// </remarks> protected override void InitializeControls(GenericContainer container) { if (this.NumberOfItemsToShow > 0) { this.ItemsList.ItemDataBound += new EventHandler<RadListViewItemEventArgs>(ItemsList_ItemDataBound); List<RealEstateItem> dataSource = this.GetRealEstateItems(); if (dataSource.Count > 0) { this.ItemsList.DataSource = dataSource; this.ItemsList.DataBind(); } else { if (!this.IsBackend() && !this.IsDesignMode()) { this.Visible = false; } } } }
protected override void InitializeControls(GenericContainer container) { IFormFieldControl thisControl = base.ParentDesigner.PropertyEditor.Control as IFormFieldControl; FormDraftControl thisControlData = base.ParentDesigner.PropertyEditor.ControlData as FormDraftControl; FormDescription form = FManager.GetFormByName(thisControlData.Form.Name); IControlsContainer cc = GetControlsContainer(form.Id); List <ControlData> formControls = (List <ControlData>) typeof(PageHelper) .GetMethod("SortControls", BindingFlags.Static | BindingFlags.NonPublic) .Invoke(null, new object[] { new[] { cc }, 1 }); formControls.RemoveAll(fc => fc.ObjectType == "Telerik.Sitefinity.Modules.Forms.Web.UI.Fields.FormSubmitButton, Telerik.Sitefinity" || fc.IsLayoutControl == true); ControlData progressiveKeyFieldControlData = formControls.Where(c => ((FormDraftControl)c).Properties.Any(p => p.Name == "IsProgressiveKeyField" && p.Value == "True")).FirstOrDefault(); if (progressiveKeyFieldControlData != null) { FieldControl progressiveKeyFieldControl = FManager.LoadControl(progressiveKeyFieldControlData, CultureInfo.CurrentUICulture) as FieldControl; _progressiveKeyFieldName = Helpers.GetFieldName(progressiveKeyFieldControl); if (!String.IsNullOrEmpty(_progressiveKeyFieldName) && _progressiveKeyFieldName != Helpers.GetFieldName(thisControl as FieldControl)) { _disableKeyFieldSelector = true; } } if (!(thisControl is FormTextBox)) { _disableKeyFieldSelector = true; _wrongTypeForKeyField = true; } if (formControls.Count > 0) { List <CriteriaOption> progressiveCriteriaOptions = new List <CriteriaOption>(); CultureInfo uiCulture = CultureInfo.GetCultureInfo(this.GetUICulture()); foreach (var formControl in formControls) { FieldControl fieldControl = FManager.LoadControl(formControl, uiCulture) as FieldControl; CriteriaOption co = new CriteriaOption(); co.FieldName = Helpers.GetFieldName(fieldControl); progressiveCriteriaOptions.Add(co); } StringBuilder script = new StringBuilder(); script.Append(@"<script>"); script.AppendFormat(@"var currentProgressiveCulture = ""{0}"";", this.GetUICulture()); script.AppendFormat(@"var progressiveOptionFilter = ""{0}"";", Helpers.GetFieldName((FieldControl)thisControl)); script.AppendFormat(@"var progressiveCriteriaOptions = {0};", Helpers.SerializeJSON <List <CriteriaOption> >(progressiveCriteriaOptions)); string progressiveCriteriaSetPropertyValue = ((IProgressiveFormControl)thisControl).ProgressiveCriteriaSet; string criteriaSet = "[]"; if (!String.IsNullOrWhiteSpace(progressiveCriteriaSetPropertyValue)) { criteriaSet = progressiveCriteriaSetPropertyValue; } script.AppendFormat("var progressiveCriteria = {0};", criteriaSet); script.Append(@"</script>"); Script.Text = script.ToString(); } }
protected override void InitializeControls(GenericContainer container) { IFormFieldControl thisControl = base.ParentDesigner.PropertyEditor.Control as IFormFieldControl; FormDraftControl thisControlData = base.ParentDesigner.PropertyEditor.ControlData as FormDraftControl; FormDescription form = FManager.GetFormByName(thisControlData.Form.Name); IControlsContainer cc = GetControlsContainer(form.Id); List<ControlData> formControls = (List<ControlData>)typeof(PageHelper) .GetMethod("SortControls", BindingFlags.Static | BindingFlags.NonPublic) .Invoke(null, new object[] { new[] { cc }, 1 }); formControls.RemoveAll(fc => fc.ObjectType == "Telerik.Sitefinity.Modules.Forms.Web.UI.Fields.FormSubmitButton, Telerik.Sitefinity" || fc.IsLayoutControl == true); if (formControls.Count > 0) { List<CriteriaOption> criteriaOptions = new List<CriteriaOption>(); CultureInfo uiCulture = CultureInfo.GetCultureInfo(this.GetUICulture()); foreach (var formControl in formControls) { FieldControl fieldControl = FManager.LoadControl(formControl, uiCulture) as FieldControl; CriteriaOption co = new CriteriaOption(); if (fieldControl is FormChoiceField) { co.FieldType = "ChoiceField"; co.FieldName = Helpers.GetFieldName(fieldControl); co.Options = ((FormChoiceField)fieldControl).Choices .Select(c => new SimpleChoiceItem() { Text = c.Text, Value = c.Value }).ToList(); co.Conditions = new List<SimpleChoiceItem>() { new SimpleChoiceItem() { Text = "=", Value = "==" }, new SimpleChoiceItem() { Text = "!=", Value = "!=" } }; } if (fieldControl is TextField) { co.FieldType = "TextField"; co.FieldName = Helpers.GetFieldName(fieldControl); co.Conditions = new List<SimpleChoiceItem>() { new SimpleChoiceItem() { Text = "=", Value = "==" }, new SimpleChoiceItem() { Text = "!=", Value = "!=" }, new SimpleChoiceItem() { Text = "<", Value = "lt" }, new SimpleChoiceItem() { Text = ">", Value = "gt" } }; } criteriaOptions.Add(co); } StringBuilder script = new StringBuilder(); script.Append(@"<script>"); script.AppendFormat(@"var currentCultureC = ""{0}"";", this.GetUICulture()); script.AppendFormat(@"var optionFilter = ""{0}"";", Helpers.GetFieldName((FieldControl)thisControl)); script.AppendFormat(@"var criteriaOptions = {0};", Helpers.SerializeJSON<List<CriteriaOption>>(criteriaOptions)); string criteriaSetPropertyValue = ((IConditionalFormControl)thisControl).CriteriaSet; string criteriaSet = "[]"; if (!String.IsNullOrWhiteSpace(criteriaSetPropertyValue)) { criteriaSet = criteriaSetPropertyValue; } script.AppendFormat("var criteria = {0};", criteriaSet); script.Append(@"</script>"); Script.Text = script.ToString(); } }
/// <summary> /// Initializes the controls. /// </summary> /// <remarks> /// Initialize your controls in this method. Do not override CreateChildControls method. /// </remarks> protected override void InitializeControls(GenericContainer container) { // Set the label values this.ExampleLabel.Text = this.Example; this.TitleLabel.Text = this.Title; this.DescriptionLabel.Text = this.Description; this.TextBox1.Text = GetCurrentSitefinityUser(); this.ddBlogsSources.DataSource = BlogsProviderFactory.GetAll(); this.ddBlogsSources.DataBind(); this.btnSubmit.Click += btnSubmit_Click; }
public KafkaFixture() { _kafka = new ContainerBuilder <KafkaContainer>() .Build(); }
protected override void InitializeControls(GenericContainer container) { if (!this.IsDesignMode()) { if (this.ProductId == Guid.Empty) { this.WidgetStatus.Visible = true; this.WidgetStatusMessage.Text = "This widget is not configured, please choose a product by editing the widget."; this.DonationsWidgetWrapper.Visible = false; } else { this.WidgetStatus.Visible = false; this.WidgetStatusMessage.Text = ""; this.DonationsWidgetWrapper.Visible = true; AddToCartButton.Command += new CommandEventHandler(AddToCartButton_Command); } } }