/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); ThisAction.Dispose(); } base.Dispose(disposing); }
private EventHandler GetLeaveHandler(FieldAndPropertyWrapper arg) { ActionArgumentAttribute argAttr = arg.GetArgumentAttribute(); if (argAttr.OnLeaveHandlerName == null) { return(null); } Type actionType = ThisAction.GetType(); MethodInfo method = actionType.GetMethod(argAttr.OnLeaveHandlerName); return((sender, e) => method.Invoke(ThisAction, new[] { sender, e })); }
private void NonLiteralOnTextChanged(object sender, EventArgs eventArgs) { RichTextBox rtb = (RichTextBox)sender; string text = rtb.Text; int oldPos = rtb.SelectionStart; var expressions = ThisAction.FindPythonExpressions(text); foreach (Expression expression in expressions) { int find = rtb.Find(expression.Template); rtb.Select(find, expression.Template.Length); rtb.SelectionColor = Color.Blue; } rtb.Select(oldPos, 0); rtb.SelectionColor = Color.Black; }
public IActionResult Leave(int activityId) { if (HttpContext.Session.GetString("id") == null) { return(RedirectToAction("Index")); } User currentUser = dbContext.Users.SingleOrDefault(user => user.UserId == HttpContext.Session.GetInt32("id")); ThisActivity currentActivity = dbContext.Activities. Include(a => a.Participants) .ThenInclude(p => p.User) .SingleOrDefault(a => a.ThisActivityId == activityId); ThisAction currentAction = dbContext.Actions.FirstOrDefault(a => a.UserId == HttpContext.Session.GetInt32("id") && a.ThisActivityId == activityId); currentActivity.Participants.Remove(currentAction); dbContext.SaveChanges(); return(RedirectToAction("Dashboard")); }
private void PopulateComboBox() { ICentipedeCore core = ThisAction.GetCurrentCore(); lock (core.Job) { var actionIter = from Action a in core.Job.Actions where a != ThisAction select new { Text = String.Format("{0}: {1}", a.Name, a.Comment), Action = a }; _actionCombo.DataSource = actionIter.ToList(); } }
/// <summary> /// Populate Attribute table with controls for <see cref="ThisAction"/>'s arguments /// </summary> protected void GenerateArguments() { Type actionType = ThisAction.GetType(); var fieldArguments = from fi in actionType.GetMembers() where fi is FieldInfo || fi is PropertyInfo select(FieldAndPropertyWrapper) fi into wrapped let argattr = wrapped.GetArgumentAttribute() where argattr != null orderby argattr.DisplayOrder select wrapped; foreach (FieldAndPropertyWrapper arg in fieldArguments) { AttributeTable.Controls.AddRange(GenerateFieldControls(arg)); } }
public IActionResult Join(int activityId) { if (HttpContext.Session.GetString("id") == null) { return(RedirectToAction("Index")); } User currentUser = dbContext.Users.SingleOrDefault(user => user.UserId == HttpContext.Session.GetInt32("id")); ThisActivity currentActivity = dbContext.Activities. Include(a => a.Participants) .ThenInclude(p => p.User) .SingleOrDefault(a => a.ThisActivityId == activityId); ThisAction newAction = new ThisAction { UserId = currentUser.UserId, User = currentUser, ThisActivityId = currentActivity.ThisActivityId, ThisActivity = currentActivity }; currentActivity.Participants.Add(newAction); dbContext.SaveChanges(); return(RedirectToAction("Dashboard")); }
public static ThisAction <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> ThisAndArguments <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>( ThisAction <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> del) { return(del); }
public static ThisAction <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ThisAndArguments <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(ThisAction <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> del) { return(del); }
public static ThisAction <T1, T2, T3, T4, T5, T6> ThisAndArguments <T1, T2, T3, T4, T5, T6>( ThisAction <T1, T2, T3, T4, T5, T6> del) { return(del); }
public static ThisAction <T1, T2, T3> ThisAndArguments <T1, T2, T3>(ThisAction <T1, T2, T3> del) { return(del); }
public static ThisAction <T1> ThisAndArguments <T1>(ThisAction <T1> del) { return(del); }
public static ThisAction ThisAndArguments(ThisAction del) { return(del); }
public TypeProjector Initializer(ThisAction initializer) { _prototype.Initializer = initializer; return(this); }