private void FileManager_OperationAdded(object sender, FileOperationEventArgs e) { Application.Current.Dispatcher.BeginInvoke((Action)(() => { OperationList.Insert(0, new FileOperationViewmodel(e.Operation)); }) , null); }
private void FileManager_OperationAdded(object sender, FileOperationEventArgs e) { if (e.Operation == null) { return; } OnUiThread(() => { OperationList.Insert(0, new FileOperationViewmodel(e.Operation)); }); }
private void DoEvaluateUserInputExecute() { System.Windows.Input.Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait; try { CalculatorOutput = CalculatorHelper.GetInstance().Evaluate(UserInput); OperationList.Insert(0, new Operation() { Input = UserInput, Result = CalculatorOutput }); } catch (Exception ex) { System.Windows.MessageBox.Show("Exception found on DoEvaluateUserInputExecute :" + ex.Message); } System.Windows.Input.Mouse.OverrideCursor = System.Windows.Input.Cursors.Arrow; }
/// <exception cref="InvalidOperationException"> /// The type does not support the given kind of member. /// </exception> public void InsertMember(MemberType type, int index) { if (type == MemberType.Field) { if (index > FieldCount) { index = FieldCount; } } else { index -= FieldCount; if (index > OperationCount) { index = OperationCount; } } if (index < 0) { index = 0; } switch (type) { case MemberType.Field: Field field = AddField(); FieldList.RemoveAt(FieldCount - 1); FieldList.Insert(index, field); break; case MemberType.Method: Method method = AddMethod(); OperationList.RemoveAt(OperationCount - 1); OperationList.Insert(index, method); break; case MemberType.Constructor: Constructor constructor = AddConstructor(); OperationList.RemoveAt(OperationCount - 1); OperationList.Insert(index, constructor); break; case MemberType.Destructor: Destructor destructor = AddDestructor(); OperationList.RemoveAt(OperationCount - 1); OperationList.Insert(index, destructor); break; case MemberType.Property: Property property = AddProperty(); OperationList.RemoveAt(OperationCount - 1); OperationList.Insert(index, property); break; case MemberType.Event: Event _event = AddEvent(); OperationList.RemoveAt(OperationCount - 1); OperationList.Insert(index, _event); break; } }