void LiveVideoClick(ChannelLinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "LiveVideoClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.liveVideo); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); StreamInfoHelper strinfo = new StreamInfoHelper(); strinfo.streamInfo = () => { return(Apm.Iterate(LoadStreamInfoNVT(evarg, strinfo))); }; ctx.RegisterInstance <IStreamInfoHelper>(strinfo); Ctxdisp = ctx; ctx.RegisterInstance <IVideoInfo>(evarg.videoInfo); string videoSourceToken = evarg.token; string profToken = evarg.profile.token; UIdisp = LiveVideoActivity .Run(ctx, profToken, videoSourceToken) .Subscribe(x => { eventAggregator.GetEvent <VideoChangedEvent>().Publish(evarg); }, err => { dbg.Error(err); }); }
void NVAInputsClick(NVALinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "NVAInputsClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.nvaInputs); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); Ctxdisp = ctx; EngineAnalyticsView.Start(container, column); //UIdisp = ProfileManagementActivity // .Run(ctx, evarg.profileToken, evarg.token) // .ObserveOnCurrentDispatcher() // .Subscribe(x => { // if (x.IsSelect) { // var profTok = ((ProfileManagementActivityResult.Select)x).Item; // ProfileChangedEventArgs evargs = new ProfileChangedEventArgs(evarg.session, evarg.token, profTok); // eventAggregator.GetEvent<ProfileChangedPreviewEvent>().Publish(evargs); // } else if (x.IsRefresh) { // ProfileChangedEventArgs evargs = new ProfileChangedEventArgs(evarg.session, evarg.token, evarg.profileToken); // eventAggregator.GetEvent<ProfileChangedPreviewEvent>().Publish(evargs); // } // }, err => { // dbg.Error(err); // }); }
public static void Start(IUnityContainer container, ContentColumn content) //(Model model, IUnityContainer container, ContentColumn content) { //var view = new EngineAnalyticsView(model, container); { var view = new EngineAnalyticsView(container); content.Content = view; }
void ProfilesClick(ChannelLinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "ProfilesClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.profileEditor); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); Ctxdisp = ctx; UIdisp = ProfileManagementActivity .Run(ctx, evarg.profile == null ? null : evarg.profile.token, evarg.token) .ObserveOnCurrentDispatcher() .Subscribe(x => { if (x.IsSelect) { var profTok = ((ProfileManagementActivityResult.Select)x).Item; ProfileChangedEventArgs evargs = new ProfileChangedEventArgs(evarg.session, evarg.token, profTok); eventAggregator.GetEvent <ProfileChangedPreviewEvent>().Publish(evargs); } else if (x.IsRefresh) { ProfileChangedEventArgs evargs = new ProfileChangedEventArgs(evarg.session, evarg.token, evarg.profile.token); eventAggregator.GetEvent <ProfileChangedPreviewEvent>().Publish(evargs); } }, err => { dbg.Error(err); }); }
void ReceiversClick(DeviceLinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "ReceiversClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LocalTitles.instance, x => x.receivers); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); var uri = evarg.session.deviceUri; ctx.RegisterInstance <Uri>(uri); Ctxdisp = ctx; //ReceiversView review = new ReceiversView(); //review.Init(null); //ShowView(review, "receiver_view", RegionNames.reg_property); UIdisp = ReceiverManagementActivity .Run(ctx) .Subscribe(x => { }, err => { dbg.Error(err); }); }
protected void btnNew_Click(object sender, EventArgs e) { msg.ClearMessage(); if (NewNameField.Text.Trim().Length < 1) { msg.ShowWarning(Localization.GetString("NoNameError")); } else { var c = new ContentColumn(); c.DisplayName = NewNameField.Text.Trim(); c.SystemColumn = false; if (HccApp.ContentServices.Columns.Create(c)) { Response.Redirect("Columns_Edit.aspx?id=" + c.Bvin); } else { msg.ShowError(Localization.GetString("DeleteError")); EventLog.LogEvent("Create Content column Button", "Unable to create content column", EventLogSeverity.Error); } } }
protected void btnNew_Click(object sender, EventArgs e) { msg.ClearMessage(); if (NewNameField.Text.Trim().Length < 1) { msg.ShowWarning("Please enter a name for the new content column."); } else { var c = new ContentColumn(); c.DisplayName = NewNameField.Text.Trim(); c.SystemColumn = false; if (HccApp.ContentServices.Columns.Create(c)) { Response.Redirect("Columns_Edit.aspx?id=" + c.Bvin); } else { msg.ShowError("Unable to create content column. Please see event log for details"); EventLog.LogEvent("Create Content column Button", "Unable to create content column", EventLogSeverity.Error); } } }
public void LoadColumn() { ContentColumn c = MyPage.MTApp.ContentServices.Columns.Find(this.ColumnId); this.lblTitle.Text = c.DisplayName; this.GridView1.DataSource = c.Blocks; this.GridView1.DataBind(); }
void PTZClick(ChannelLinkEventArgs evarg) { //Observable // .Interval(TimeSpan.FromMilliseconds(800)) // .ObserveOnDispatcher() // .Subscribe(l => { // eventAggregator.GetEvent<VideoStreamingClick>().Publish(evarg); // }); //Observable // .Interval(TimeSpan.FromMilliseconds(380)) // .ObserveOnDispatcher() // .Subscribe(l => { // eventAggregator.GetEvent<LiveVideoClick>().Publish(evarg); // }); //Observable // .Interval(TimeSpan.FromMilliseconds(380)) // .ObserveOnDispatcher() // .Subscribe(l => { // var mevarg = new MetadataEventArgs(); // mevarg.currentAccount = evarg.currentAccount; // mevarg.profile = // eventAggregator.GetEvent<MetadataClick>().Publish(evarg); // }); //Observable // .Interval(TimeSpan.FromMilliseconds(50)) // .ObserveOnDispatcher() // .Subscribe(l => { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "PTZClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.ptz); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); Ctxdisp = ctx; ctx.RegisterInstance <IVideoInfo>(evarg.videoInfo); PtzInfo ptzInfo = new PtzInfo() { ProfileToken = evarg.profile.token }; ctx.RegisterInstance <IPtzInfo>(ptzInfo); UIdisp = PtzActivity .Run(ctx, evarg.profile.token) .Subscribe(x => { }, err => { dbg.Error(err); }); //}); }
protected void btnNew_Click(object sender, System.Web.UI.ImageClickEventArgs e) { ContentColumn col = MyPage.MTApp.ContentServices.Columns.Find(this.ColumnId); if (col != null) { ContentBlock b = new ContentBlock(); b.ControlName = this.lstBlocks.SelectedValue; b.ColumnId = this.ColumnId; col.Blocks.Add(b); MyPage.MTApp.ContentServices.Columns.Update(col); } LoadColumn(); }
public async Task <List <ContentColumn> > GetChannelListColumnsAsync(Site site) { var columns = new List <ContentColumn>(); var listColumns = ListUtils.GetStringList(site.ChannelListColumns); if (listColumns.Count == 0) { listColumns.Add(nameof(Channel.ChannelName)); listColumns.Add(nameof(Channel.IndexName)); listColumns.Add(nameof(Channel.GroupNames)); } var styles = GetChannelListStyles(await _databaseManager.TableStyleRepository.GetChannelStylesAsync(await _databaseManager.ChannelRepository.GetAsync(site.Id))); foreach (var style in styles) { if (string.IsNullOrEmpty(style.DisplayName) || style.InputType == InputType.TextEditor) { continue; } var column = new ContentColumn { AttributeName = style.AttributeName, DisplayName = style.DisplayName, InputType = style.InputType }; if (style.AttributeName == nameof(Channel.ChannelName)) { column.IsList = true; } else { if (ListUtils.ContainsIgnoreCase(listColumns, style.AttributeName)) { column.IsList = true; } } if (!ListUtils.ContainsIgnoreCase(UnSearchableAttributes, style.AttributeName)) { column.IsSearchable = true; } columns.Add(column); } return(columns); }
protected void btnClone_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.msg.ClearMessage(); if (this.CloneNameField.Text.Trim().Length < 1) { msg.ShowWarning("Please enter a name first."); } else { ContentColumn clone = MTApp.ContentServices.Columns.Clone(ContentColumnEditor.ColumnId, this.CloneNameField.Text.Trim()); this.msg.ShowOk("Column Copied"); } ContentColumnEditor.LoadColumn(); }
void NVAAnalyticsClick(NVALinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "AnalyticsClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.analytics); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); //TODO: Stub fix for #225 Remove this with plugin functionality ILastChangedModule lmodule = new LastChangedModule(); ctx.RegisterInstance <ILastChangedModule>(lmodule); // StreamInfoHelper strinfo = new StreamInfoHelper(); strinfo.streamInfo = () => { return(Apm.Iterate(LoadStreamInfoNVA(evarg, strinfo))); }; ctx.RegisterInstance <IStreamInfoHelper>(strinfo); Ctxdisp = ctx; //ctx.RegisterInstance<IVideoInfo>(evarg.videoInfo); ctx.RegisterInstance <odm.ui.activities.AnalyticsView.AnalyticType>(odm.ui.activities.AnalyticsView.AnalyticType.ALL); //evarg.controlToken string token = null; if (evarg.control != null) { token = evarg.control.engineConfigToken; } UIdisp = AnalyticsActivity .Run(ctx, token) //evarg.profileToken) .Subscribe(x => { //TODO: handle return from activity }, err => { dbg.Error(err); }); }
void DateTimeClick(DeviceLinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "DateTimeClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.timesettings); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); Ctxdisp = ctx; UIdisp = TimeSettingsActivity .Run(ctx) .Subscribe(x => { }, err => { dbg.Error(err); }); }
void NVAControlsClick(NVALinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "NVAControlsClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.nvaControls); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); Ctxdisp = ctx; string token = null; if (evarg.control != null) { token = evarg.control.token; } UIdisp = NvaControlManagmentActivity .Run(ctx, evarg.engine, token) //evarg.controlToken) .ObserveOnCurrentDispatcher() .Subscribe(x => { if (x.IsSelect) { //var profTok = ((ProfileManagementActivityResult.Select)x).Item; //ProfileChangedEventArgs evargs = new ProfileChangedEventArgs(evarg.session, evarg.token, profTok); //eventAggregator.GetEvent<ProfileChangedPreviewEvent>().Publish(evargs); var controlTok = ((NvaControlManagmentActivityResult.Select)x).Item; ControlChangedEventArgs evargs = new ControlChangedEventArgs(evarg.session, evarg.engine, controlTok); eventAggregator.GetEvent <ControlChangedPreviewEvent>().Publish(evargs); } else if (x.IsRefresh) { //ProfileChangedEventArgs evargs = new ProfileChangedEventArgs(evarg.session, evarg.token, evarg.profileToken); //eventAggregator.GetEvent<ProfileChangedPreviewEvent>().Publish(evargs); ControlChangedEventArgs evargs = new ControlChangedEventArgs(evarg.session, evarg.engine, evarg.control.token); eventAggregator.GetEvent <ControlChangedPreviewEvent>().Publish(evargs); } }, err => { dbg.Error(err); }); }
void SequrityClick(DeviceLinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "CertificatesClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.sequrity); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); Ctxdisp = ctx; UIdisp = CertificateManagementActivity .Run <IUnityContainer>(ctx) .Subscribe(x => { }, err => { dbg.Error(err); }); }
public ActionResult Index(string id) { if (string.IsNullOrEmpty(id)) { return(Content("")); } ContentColumn col = null; col = MTApp.ContentServices.Columns.Find(id); if (col == null) { col = MTApp.ContentServices.Columns.FindByDisplayName(id); } if (col == null) { return(Content(string.Empty)); // Content("Column Not Found"); } return(View(col)); }
void MaintenanceClick(MaintenanceLinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "MaintenanceClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.maintenance); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); ctx.RegisterInstance <IMaintenanceLinkEventArgs>(evarg); Ctxdisp = ctx; UIdisp = MaintenanceActivity .Run(ctx) .Subscribe(x => { }, err => { dbg.Error(err); }); }
void ActionTriggersClick(DeviceLinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "ActionTriggersClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LocalTitles.instance, x => x.triggers); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); Ctxdisp = ctx; UIdisp = ActionTriggerManagementActivity .Run(ctx) .Subscribe(x => { }, err => { dbg.Error(err); }); }
void NVASettingsClick(NVALinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "NVASettingsClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.nvaSettings); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); Ctxdisp = ctx; UIdisp = NvaSimpleConfigureInputsActivity .Run(ctx, evarg.control) .ObserveOnCurrentDispatcher() .Subscribe(x => { }, err => { dbg.Error(err); }); }
protected void btnCopyBlocks_Click(object sender, System.Web.UI.ImageClickEventArgs e) { this.msg.ClearMessage(); ContentColumn c = MTApp.ContentServices.Columns.Find(ContentColumnEditor.ColumnId); if (c != null) { string destinationColumnId = this.CopyToList.SelectedValue; foreach (ContentBlock b in c.Blocks) { MTApp.ContentServices.Columns.CopyBlockToColumn(b.Bvin, destinationColumnId); } this.msg.ShowOk("Column Copied"); } else { this.msg.ShowError("Copy failed. Unknown Error."); } ContentColumnEditor.LoadColumn(); }
void ImagingClick(ChannelLinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "ImagingClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.sensorSettings); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); Ctxdisp = ctx; ctx.RegisterInstance <IVideoInfo>(evarg.videoInfo); UIdisp = ImagingSettingsActivity .Run(ctx, evarg.profile.token) .Subscribe(x => { eventAggregator.GetEvent <VideoChangedEvent>().Publish(evarg); }, err => { dbg.Error(err); }); }
void VideoStreamingClick(ChannelLinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "VideoStreamingClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.videoStreaming); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); Ctxdisp = ctx; ctx.RegisterInstance <IVideoInfo>(evarg.videoInfo); UIdisp = VideoSettingsActivity .Run(ctx, evarg.profile.token) .Subscribe(x => { eventAggregator.GetEvent <VideoChangedEvent>().Publish(evarg); }, err => { dbg.Error(err); }); //subscriptions.Add(evarg.session.GetScopes() // .ObserveOnCurrentDispatcher() // .Subscribe(scopes => { // var slist = (scopes == null ? Enumerable.Empty<string>() : scopes.Select(x => x.ScopeItem)).ToList(); // ScopesHolder sholder = new ScopesHolder(slist.ToArray()); // ctx.RegisterInstance<IScopesHolder>(sholder); // UIdisp = VideoSettingsActivity // .Run(ctx, evarg.profileToken) // .Subscribe(x => { // eventAggregator.GetEvent<VideoChangedEvent>().Publish(evarg); // }, err => { // dbg.Error(err); // }); // }, err => { // dbg.Error(err); // })); }
void IdentificationClick(DeviceLinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "IdentificationClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.identificationAndStatus); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); var uri = evarg.session.deviceUri; ctx.RegisterInstance <Uri>(uri); Ctxdisp = ctx; UIdisp = IdentificationActivity .Run(ctx) .Subscribe(x => { }, err => { dbg.Error(err); }); }
void MetadataClick(MetadataEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "MetadataClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.metadata); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); Ctxdisp = ctx; ctx.RegisterInstance <IVideoInfo>(evarg.videoInfo); ctx.RegisterInstance <Profile>(evarg.profile); ctx.RegisterInstance <INvtSession>(evarg.session); UIdisp = MetadataSettingsActivity .Run(ctx, evarg.profile) .Subscribe(x => { //eventAggregator.GetEvent<VideoChangedEvent>().Publish(evarg); }, err => { dbg.Error(err); }); }
void NVAMetadataClick(NVALinkEventArgs evarg) { ReleaseViewModels(RegionNames.reg_property); ContentColumn column = new ContentColumn(); ShowView(column, "MetadataClick", RegionNames.reg_property); column.CreateBinding(ContentColumn.TitleProperty, LinkButtonsStrings.instance, x => x.nvaMetadata); var ctx = CreateActivityContext(RegionNames.reg_property, evarg.session, column); StreamInfoHelper strinfo = new StreamInfoHelper(); strinfo.streamInfo = () => { return(Apm.Iterate(LoadStreamInfoNVA(evarg, strinfo))); }; ctx.RegisterInstance <IStreamInfoHelper>(strinfo); Ctxdisp = ctx; StreamSetup ssetup = new StreamSetup() { transport = new Transport() { protocol = AppDefaults.visualSettings.Transport_Type } }; //EngineControlsView.Start(new EngineControlsView.Model(null, null), container, column); UIdisp = NvaMetadataSettingsActivity .Run(ctx, evarg.control.token, evarg.control.engineConfigToken, ssetup) .ObserveOnCurrentDispatcher() .Subscribe(x => { }, err => { dbg.Error(err); }); }
public static void Start(Model model, IUnityContainer container, ContentColumn content) { var view = new EngineControlsView(model, container); content.Content = view; }
public List<ContentColumn> GetColumns(List<string> listAttributeNames, List<TableStyle> styles, bool isReply) { var columns = new List<ContentColumn> { new ContentColumn { AttributeName = nameof(DataInfo.Id), DisplayName = "Id", IsList = ListUtils.ContainsIgnoreCase(listAttributeNames, nameof(DataInfo.Id)) }, new ContentColumn { AttributeName = nameof(DataInfo.Guid), DisplayName = "编号", IsList = ListUtils.ContainsIgnoreCase(listAttributeNames, nameof(DataInfo.Guid)) } }; foreach (var style in styles) { if (string.IsNullOrEmpty(style.DisplayName) || style.InputType == InputType.TextEditor) continue; var column = new ContentColumn { AttributeName = style.AttributeName, DisplayName = style.DisplayName, InputType = style.InputType, IsList = ListUtils.ContainsIgnoreCase(listAttributeNames, style.AttributeName) }; columns.Add(column); } columns.AddRange(new List<ContentColumn> { new ContentColumn { AttributeName = nameof(DataInfo.CreatedDate), DisplayName = "添加时间", IsList = ListUtils.ContainsIgnoreCase(listAttributeNames, nameof(DataInfo.CreatedDate)) }, new ContentColumn { AttributeName = nameof(DataInfo.LastModifiedDate), DisplayName = "更新时间", IsList = ListUtils.ContainsIgnoreCase(listAttributeNames, nameof(DataInfo.LastModifiedDate)) } }); if (isReply) { columns.AddRange(new List<ContentColumn> { new ContentColumn { AttributeName = nameof(DataInfo.ReplyDate), DisplayName = "回复时间", IsList = ListUtils.ContainsIgnoreCase(listAttributeNames, nameof(DataInfo.ReplyDate)) }, new ContentColumn { AttributeName = nameof(DataInfo.ReplyContent), DisplayName = "回复内容", IsList = ListUtils.ContainsIgnoreCase(listAttributeNames, nameof(DataInfo.ReplyContent)) } }); } return columns; }
public static List <ContentColumn> GetContentColumns(SiteInfo siteInfo, ChannelInfo channelInfo, bool includeAll) { var columns = new List <ContentColumn>(); var attributesOfDisplay = TranslateUtils.StringCollectionToStringCollection(channelInfo.Additional.ContentAttributesOfDisplay); var pluginIds = PluginContentManager.GetContentPluginIds(channelInfo); var pluginColumns = PluginContentManager.GetContentColumns(pluginIds); var styleInfoList = ContentUtility.GetAllTableStyleInfoList(TableStyleManager.GetContentStyleInfoList(siteInfo, channelInfo)); styleInfoList.Insert(0, new TableStyleInfo { AttributeName = ContentAttribute.Sequence, DisplayName = "序号" }); foreach (var styleInfo in styleInfoList) { if (styleInfo.InputType == InputType.TextEditor) { continue; } var column = new ContentColumn { AttributeName = styleInfo.AttributeName, DisplayName = styleInfo.DisplayName, InputType = styleInfo.InputType }; if (styleInfo.AttributeName == ContentAttribute.Title) { column.IsList = true; } else { if (attributesOfDisplay.Contains(styleInfo.AttributeName)) { column.IsList = true; } } if (StringUtils.ContainsIgnoreCase(ContentAttribute.CalculateAttributes.Value, styleInfo.AttributeName)) { column.IsCalculate = true; } if (includeAll || column.IsList) { columns.Add(column); } } if (pluginColumns != null) { foreach (var pluginId in pluginColumns.Keys) { var contentColumns = pluginColumns[pluginId]; if (contentColumns == null || contentColumns.Count == 0) { continue; } foreach (var columnName in contentColumns.Keys) { var attributeName = $"{pluginId}:{columnName}"; var column = new ContentColumn { AttributeName = attributeName, DisplayName = $"{columnName}({pluginId})", InputType = InputType.Text, IsCalculate = true }; if (attributesOfDisplay.Contains(attributeName)) { column.IsList = true; } if (includeAll || column.IsList) { columns.Add(column); } } } } return(columns); }
IUnityContainer CreateActivityContext(string regionName, INvtSession session, ContentColumn column) { var container = this.container.CreateChildContainer(); //create & register view presenter var presenter = ViewPresenter.Create(view => { var region = regionManager.Regions[regionName]; //dbg.Assert(column.Content == null); column.Content = view; return(Disposable.Create(() => { //column.Content = null; })); }); container.RegisterInstance <IViewPresenter>(presenter); container.RegisterInstance <INvtSession>(session); container.RegisterInstance <Dispatcher>(Dispatcher.CurrentDispatcher); var app = Application.Current as App; if (app != null && app.plugins != null) { try { foreach (var p in app.plugins) { p.OnDeviceSettingsContextCreated(container); } } catch (Exception err) { dbg.Error(err); } } return(container); }