public static bool Validate(SharepointList list, TemplateDataBase item)
 {
     if (IsValid != null)
     {
         var cancelArgs = new CancelSharepointItemEventArgs(item, list) { Cancel = false };
         IsValid(null, cancelArgs);
         return !cancelArgs.Cancel;
     }
     return true;
 }
Beispiel #2
0
 void SharepointEvents_IsValid(object sender, CancelSharepointItemEventArgs e)
 {
     ColumnBinder binder = weakReference.Target as ColumnBinder;
     if (binder == null)
     {
         SharepointEvents.IsValid -= new EventHandler<CancelSharepointItemEventArgs>(SharepointEvents_IsValid);
     }
     else
     {
         binder.SharepointEvents_IsValid(sender, e);
     }
 }
Beispiel #3
0
        void SharepointEvents_IsValid(object sender, CancelSharepointItemEventArgs e)
        {
            if (e.Item.ListName == this.Item.ListName
                && (e.Item.Id != null && (this.Item.Id == e.Item.Id)
                || e.Item.Data == this.Item.Data))
            {
                if (Binding != null)
                {
                    try
                    {
                        Binding.UpdateSource();
                    }
                    catch
                    {

                    }
                    e.Cancel = e.Cancel || Validation.GetHasError(AssociatedObject);
                }
            }
        }