Example #1
0
        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);
            });
        }
Example #2
0
        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);
            //    });
        }
Example #3
0
        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;
        }
Example #4
0
        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);
            });
        }
Example #5
0
        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);
            });
        }
Example #6
0
        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);
                }
            }
        }
Example #7
0
        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);
                }
            }
        }
Example #8
0
        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();
        }
Example #9
0
        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);
            });
            //});
        }
Example #10
0
        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();
        }
Example #11
0
        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();
        }
Example #13
0
        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);
            });
        }
Example #14
0
        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);
            });
        }
Example #15
0
        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);
            });
        }
Example #16
0
        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);
            });
        }
Example #17
0
        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));
        }
Example #18
0
        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);
            });
        }
Example #19
0
        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);
            });
        }
Example #20
0
        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();
        }
Example #22
0
        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);
            });
        }
Example #23
0
        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);
            //    }));
        }
Example #24
0
        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);
            });
        }
Example #25
0
        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);
            });
        }
Example #26
0
        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;
        }
Example #28
0
        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;
        }
Example #29
0
        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);
        }
Example #30
0
        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);
        }