Ejemplo n.º 1
0
        protected void lvNotifications_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item != null)
            {
                if (e.Item.ItemType == ListViewItemType.DataItem)
                {
                    var aspxItem = e.Item;
                    var dataItem = (INotification)e.Item.DataItem;

                    if (dataItem is ConnectNotification)
                    {
                        ConnectNotification conObj = (ConnectNotification)dataItem;

                        var connectionNotifUC = LoadControl(Constants.NotificationElements.ConnectTemplateFrontPath) as ConnectTemplateFront;

                        connectionNotifUC.ConnectionObj = conObj;
                        aspxItem.Controls.Add(connectionNotifUC);
                    }
                    if (dataItem is CommentNotification)
                    {
                        var commentNotifUC = LoadControl(Constants.NotificationElements.CommentTemplateFrontPath) as CommentTemplateFront;

                        aspxItem.Controls.Add(commentNotifUC);
                    }

                    if (dataItem is ForumReplyNotification)
                    {
                        var commentNotifUC = LoadControl(Constants.NotificationElements.ForumReplyTemplateFrontPath) as ForumReplyTemplateFront;

                        aspxItem.Controls.Add(commentNotifUC);
                    }
                    aspxItem.DataBind();
                }
            }
        }
Ejemplo n.º 2
0
 protected void btnAccept_Click(object sender, EventArgs e)
 {
     ConnectionObj.OnAccept(sender, e);
     ConnectionObj = null;
     Notifications = null;
     Page.Response.Redirect(Page.Request.Url.ToString(), false);
 }
Ejemplo n.º 3
0
        public MainWindowViewModel(MainViewModel mainViewModel, DatabaseSchemaViewModel databaseSchemaViewModel, IEventAggregator evAgg, ConnectNotification connectNotification)
        {
            eventAgg = evAgg;

            ConnectRequest = new ConnectRequest();

            this.connectNotification = connectNotification;
            MainViewModel            = mainViewModel;
            DatabaseSchemaViewModel  = databaseSchemaViewModel;

            //ConnectRequest = new ConnectRequest(evAgg);
            Connect = new DelegateCommand(() => {
                DoConnect();
            });

            LoadDbSchema = new DelegateCommand(() =>
            {
                DoLoadDbSchema();
            });
        }