public static VisitErrorCode TryExecute(object container, PropertyPath propertyPath, int propertyPathIndex, int count, ref ChangeTracker changeTracker) { var action = new SetCountCallback(container, propertyPath, propertyPathIndex, count, ref changeTracker); PropertyBagResolver.Resolve(container.GetType()).Cast(ref action); changeTracker = action.m_ChangeTracker; return(action.m_ErrorCode); }
private void SetCount() { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (this.textBoxInfo.InvokeRequired) { SetCountCallback d = new SetCountCallback(SetCount); this.Invoke(d, new object[] { }); } else { int count_temp = Int32.Parse(status_countPrinted.Text) + 1; this.status_countPrinted.Text = count_temp.ToString(); } }
static VisitErrorCode TrySetCountImpl <TContainer>(ref TContainer container, PropertyPath propertyPath, int propertyPathIndex, int count, ref ChangeTracker changeTracker) { var action = new SetCountAtPathAction <TContainer>(propertyPath, propertyPathIndex, count); if (PropertyBagResolver.Resolve <TContainer>() .FindProperty(propertyPath[propertyPathIndex].Name, ref container, ref changeTracker, ref action)) { return(action.ErrorCode); } if (typeof(TContainer) != container.GetType()) { return(SetCountCallback.TryExecute(container, propertyPath, propertyPathIndex, count, ref changeTracker)); } return(VisitErrorCode.InvalidPath); }