public MainAdapter( Project project, IFieldPathFactory pathFactory, PresetView preset, StandardView standard, AdvancedView advanced, RetrieveFieldsView fields) : base(project) { PathFactory = pathFactory; Preset = preset; Standard = standard; Advanced = advanced; _views.Add("Preset", preset.Adapter); _views.Add("Standard", standard.Adapter); _views.Add("Advanced", advanced.Adapter); RetrieveFields = fields; Preset.Adapter.Search += Adapter_Search; Standard.Adapter.Search += Adapter_Search; Advanced.Adapter.Search += Adapter_Search; SelectedSubjectChanged += delegate { RefreshPaths(); }; Project.CurrentConnectionChanged += delegate { RefreshPaths(); }; Result = new BindingSource(); RefreshPaths(); }
public MainWindowAdapter( Project project, IFieldPathFactory pathFactory, PresetView preset, StandardView standard, AdvancedView advanced, RetrieveFieldsView fields) : base(project) { _appWidth = Properties.Settings.Default.AppWidth; _appHeight = Properties.Settings.Default.AppHeight; _appWindowState = Properties.Settings.Default.AppWindowState; _viewColumnSize = new GridLength(Properties.Settings.Default.ViewColumnSize); Preset = preset; Standard = standard; Advanced = advanced; RetrieveFields = fields; _views.Add("Preset", preset.Adapter); _views.Add("Standard", standard.Adapter); _views.Add("Advanced", advanced.Adapter); Preset.Adapter.Search += Adapter_Search; Standard.Adapter.Search += Adapter_Search; Advanced.Adapter.Search += Adapter_Search; ProjectAdapter = new ProjectAdapter(project); ProjectAdapter.Project.CurrentConnectionChanged += delegate { RefreshPaths(); OnPropertyChanged("ApplicationTitle"); }; PathFactory = pathFactory; CurrentView = Preset.Adapter; SelectedSubjectChanged += delegate { RefreshPaths(); }; RefreshPaths(); }
public MainAdapter( Project project, DbServiceFactory serviceFactory, IFieldPathFactory pathFactory, PresetView preset, StandardView standard, AdvancedView advanced, RetrieveFieldsView fields) : base(project) { ServiceFactory = serviceFactory; PathFactory = pathFactory; Preset = preset; Standard = standard; Advanced = advanced; _views.Add("Preset", preset.Adapter); _views.Add("Standard", standard.Adapter); _views.Add("Advanced", advanced.Adapter); RetrieveFields = fields; Preset.Adapter.Search += Adapter_Search; Standard.Adapter.Search += Adapter_Search; Advanced.Adapter.Search += Adapter_Search; SelectedSubjectChanged += delegate { RefreshPaths(); }; var refresh = new EventHandler((s, e) => { RefreshPaths(); _dbService = ServiceFactory.CreateAsync(Project.CurrentConnection); }); Project.CurrentConnectionChanged += refresh; Result = new BindingSource(); refresh(this, EventArgs.Empty); }
protected override void OnInit(EventArgs e) { string culture = Request.QueryString["culture"]; if (!string.IsNullOrEmpty(culture)) { Thread.CurrentThread.CurrentCulture = new CultureInfo(culture); } string uiCulture = Request.QueryString["uiculture"]; if (!string.IsNullOrEmpty(uiCulture)) { Thread.CurrentThread.CurrentUICulture = new CultureInfo(uiCulture); } base.OnInit(e); if (!IsPostBack) { List <int> invalidRowIds; if (UrlTrackerRepository.HasInvalidEntries(out invalidRowIds)) { ltlError.Text = string.Format(UrlTrackerResources.ErrorMessageOldUrlAndOldRegexEmpty, string.Join(", ", invalidRowIds)); lbDeleteErrorRows.Text = UrlTrackerResources.ErrorMessageOldUrlAndOldRegexEmptyButton; mvUrlTrackerError.SetActiveView(vwUrlTrackerErrorMessage); odsUrlTrackerEntries.Selecting += odsUrlTrackerEntries_Selecting; } gvUrlTracker.Sort("Inserted", SortDirection.Descending); gvNotFound.Sort("NotFoundCount", SortDirection.Descending); } if (!_earlyErrorDetected) { pnlBreadcrumb.Visible = false; if (icAutoView == null) { icAutoView = (AutoView)LoadControl("~/Umbraco/UrlTracker/InfoCaster.Umbraco.UrlTracker.UI.UserControls.AutoView.ascx"); icCustomView = (CustomView)LoadControl("~/Umbraco/UrlTracker/InfoCaster.Umbraco.UrlTracker.UI.UserControls.CustomView.ascx"); icNotFoundView = (NotFoundView)LoadControl("~/Umbraco/UrlTracker/InfoCaster.Umbraco.UrlTracker.UI.UserControls.NotFoundView.ascx"); icAdvancedView = (AdvancedView)LoadControl("~/Umbraco/UrlTracker/InfoCaster.Umbraco.UrlTracker.UI.UserControls.AdvancedView.ascx"); icCreateView = (CreateView)LoadControl("~/Umbraco/UrlTracker/InfoCaster.Umbraco.UrlTracker.UI.UserControls.CreateView.ascx"); pnlEditValidationGroup.Controls.AddAt(0, icAutoView); pnlEditValidationGroup.Controls.AddAt(1, icCustomView); pnlEditValidationGroup.Controls.AddAt(2, icNotFoundView); pnlEditValidationGroup.Controls.AddAt(3, icAdvancedView); pnlCreateValidationGroup.Controls.AddAt(0, icCreateView); } } }