|
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections.Generic;
using System.Drawing;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;
using System.Data.DLinq;
using System.Query;
using DashboardDataAccess;
namespace DashboardBusiness.Activities
{
public partial class GetWidgetsInPageActivity : System.Workflow.ComponentModel.Activity
{
public GetWidgetsInPageActivity()
{
InitializeComponent();
}
private static DependencyProperty WidgetInstancesProperty = DependencyProperty.Register("WidgetInstances", typeof(List<WidgetInstance>), typeof(GetWidgetsInPageActivity));
public List<WidgetInstance> WidgetInstances
{
get { return (List<WidgetInstance>)base.GetValue(WidgetInstancesProperty); }
set { base.SetValue(WidgetInstancesProperty, value); }
}
private static DependencyProperty PageIdProperty = DependencyProperty.Register("PageId", typeof(int), typeof(GetWidgetsInPageActivity));
public int PageId
{
get { return (int)base.GetValue(PageIdProperty); }
set { base.SetValue(PageIdProperty, value); }
}
private static DependencyProperty UserGuidProperty = DependencyProperty.Register("UserGuid", typeof(Guid), typeof(GetWidgetsInPageActivity));
public Guid UserGuid
{
get { return (Guid)base.GetValue(UserGuidProperty); }
set { base.SetValue(UserGuidProperty, value); }
}
protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
{
using( new TimedLog(UserGuid.ToString(), "Activity: Get Widgets in page: " + PageId) )
{
var db = DatabaseHelper.GetDashboardData();
// Load widget instances along with the Widget definition
// for the specified page
this.WidgetInstances = (from widgetInstance in db.WidgetInstances
where widgetInstance.PageId == this.PageId
orderby widgetInstance.ColumnNo, widgetInstance.OrderNo
select widgetInstance)
.Including(widgetInstance => widgetInstance.Widget)
.ToList();
return ActivityExecutionStatus.Closed;
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.