/// <summary> /// get all picked items as a collection of Enum /// </summary> /// <returns>a collection of Enums, or empty collection</returns> public IEnumerable <Enum> AsEnums() { List <Enum> enums = new List <Enum>(); PreValue dataSourceJson = this.GetDataTypePreValue("dataSource"); if (dataSourceJson != null) { EnumDataSource enumDataSouce = JsonConvert.DeserializeObject <EnumDataSource>(dataSourceJson.Value); Type enumType = Helper.GetAssembly(enumDataSouce.AssemblyName).GetType(enumDataSouce.EnumName); foreach (string pickedKey in this.PickedKeys) { foreach (Enum enumItem in Enum.GetValues(enumType)) { if (pickedKey == enumItem.GetKey()) { enums.Add(enumItem); } } } } return(enums); }
public static IFieldConverter GetDataSource(Column field) { IFieldConverter result = null; if (field.Type.ToLower() == "bit") { result = new EnumDataSource() { EnumTypeFullName = typeof(YesOrNo).FullName }; } if (field.Name.IndexOf("UserId") >= 0 || field.Name.IndexOf("Creator") >= 0) { result = new EntityDataSource() { EntityType = typeof(User) }; } if (field.Name.IndexOf("DepartmentId") >= 0) { result = new EntityDataSource() { EntityType = typeof(Department) }; } return(result); }
public TemplateView(ITemplatePresentationModel model, IShell shell) { this.shell = shell; this.DataContext = model; InitializeComponent(); model.View = this; var animations = EnumDataSource.FromType <VideoTextAnimations>(); var animationColumn = textGridView.Columns[5] as GridViewComboBoxColumn; animationColumn.ItemsSource = animations; }
public LoadAnimation() { InitializeComponent(); _cbTrans.ItemsSource = EnumDataSource.FromType <AnimationTransform>(); _cbTrans.SelectedIndex = 1; _cbOrigin.ItemsSource = EnumDataSource.FromType <AnimationOrigin>(); _cbOrigin.SelectedIndex = 1; _cbEasing.ItemsSource = EnumDataSource.FromType <Easing>(); _cbEasing.SelectedIndex = 0; _chart.Tapped += (s, e) => NewData(); _chart.Loaded += (s, e) => NewData(); }
public AggregateChart() { InitializeComponent(); _dict["red"] = CreateBrush(Colors.Red); _dict["blue"] = CreateBrush(Color.FromArgb(255, 2, 150, 252)); _dict["yellow"] = CreateBrush(Colors.Yellow); _cb.ItemsSource = EnumDataSource.FromType(typeof(Aggregate)); _cb.SelectedIndex = 0; _cb.SelectionChanged += (s, e) => _chart.Aggregate = (Aggregate)((EnumMember)_cb.SelectedItem).Value; int cnt = 30; _chart.Data.ItemNames = CreateRandomStrings(cnt, new string[] { "blue", "red", "yellow" });; var vals = CreateRandomValues(cnt); var ds = new DataSeries() { ValuesSource = vals }; ds.PlotElementLoaded += (s, e) => { PlotElement pe = (PlotElement)s; if (_dict.ContainsKey(pe.DataPoint.Name)) { pe.Fill = _dict[pe.DataPoint.Name]; } pe.StrokeThickness = 0; }; _chart.Data.Children.Add(ds); _chart.View.AxisX.AnnoVisibility = AnnoVisibility.ShowAll; BarColumnOptions.SetRadiusX(_chart, 4); BarColumnOptions.SetRadiusY(_chart, 4); }
private EnumDataSource GetEnumItemsSource(Type enumType) { EnumDataSource source = new EnumDataSource(); source.EnumType = enumType; return source; }
public override string ToString() { stamps = new List <SingleStamp>(); IApplicationAction appaction = IOCFactory.GetInstance <IApplicationAction>(); IApplication application = IOCFactory.GetInstance <IApplication>(); ApplicationUI app = application.GetpplicationByID(this.applicationId); List <ApplicationActionUI> appcationList = appaction.GetApplicationActionByAppID(this.applicationId, action); if (appcationList != null && appcationList.Count > 0) { foreach (var item in appcationList) { var actionuser = item.ActionUserName; if (item.Action == (int)ApprovalAction.Create && !string.IsNullOrEmpty(item.AgentToUserName) && item.AgentToUserName != item.ActionUserName) { actionuser = item.AgentToUserName.Trim(); } stamps.Add(new SingleStamp() { ImgPath = imgPathBase + GetAppActionPicture((ApprovalAction)item.Action), Line1 = actionuser, Line2 = item.ActionTime.ToString("yyyy-MM-dd"), ToolTips = EnumDataSource <ApprovalAction> .GetDisplayValue(item.Action, "zh-cn") }); } if (action != ApprovalAction.Approve) { IAttendance leave = IOCFactory.GetInstance <IAttendance>(); IApplication iapplication = IOCFactory.GetInstance <IApplication>(); List <TaskUserExtendUI> taskListuser = iapplication.GetApplicationToDoTaskWithUser(this.applicationId); List <TaskGroupExtendUI> taskListgroup = iapplication.GetApplicationToDoTaskWithGroup(this.applicationId); if (app.Status == (int)ApplicationStatus.Pending) { string todouser = string.Empty; if (taskListuser != null && taskListuser.Count > 0) { int length = taskListuser.Count; for (int i = 0; i < length; i++) { todouser = todouser + taskListuser[i].vwEmpBasicInfo.ChineseName + ";"; } } if (taskListgroup != null && taskListgroup.Count > 0) { int length = taskListgroup.Count; for (int i = 0; i < length; i++) { todouser = todouser + taskListgroup[i].AuthorizationGroup.NAME + ";"; } } todouser = todouser.Trim(';'); stamps.Add(new SingleStamp() { ImgPath = imgPathBase + imgPending, Line1 = todouser, Line2 = "", ToolTips = "待处理" }); } } //string CNTitle = "<p>" + Resources.NameResource.Process + " (" + Resources.NameResource.Current + ":"; //int count = appcationList.Count - 1; //string Status = appcationList[count].ActionUserName + " " + EnumDataSource<ApprovalAction>.GetDisplayValue(appcationList[count].Action, "zh-cn"); //string TotalContent = CNTitle + Status + ")</p>"; //return TotalContent + base.ToString(); return(base.ToString()); } else { return(string.Empty); } }