Exemple #1
0
        public bool ValidateTrees()
        {
            if (Trees == null)
            {
                return(true);
            }
            var worker = new TreeValidationWorker(Trees);

            return(worker.ValidateTrees());
        }
Exemple #2
0
        /// <summary>
        /// performs validation on each tree view and returns ture if validation passes
        /// </summary>
        /// <param name="invalidViewIndex">index to first invalid view</param>
        /// <returns></returns>
        protected bool ValidateTreeViews(out ITreeView invalidView)
        {
            invalidView = null;
            bool validationPass = true;

            foreach (var view in View.Layouts.OfType <ITreeView>())
            {
                if (view.Trees != null)
                {
                    view.EndEdit();
                    var worker = new TreeValidationWorker(view.Trees);
                    if (!worker.ValidateTrees())
                    {
                        invalidView    = view;
                        validationPass = false;
                    }
                }
            }

            return(validationPass);
        }
 public bool ValidateTrees()
 {
     var worker = new TreeValidationWorker(Trees);
     return worker.ValidateTrees();
 }
 public bool ValidateTrees()
 {
     var worker = new TreeValidationWorker(this.NonPlotTrees);
     return worker.ValidateTrees();
 }
        /// <summary>
        /// performs validation on each tree view and returns ture if validation passes
        /// </summary>
        /// <param name="invalidViewIndex">index to first invalid view</param>
        /// <returns></returns>
        protected bool ValidateTreeViews(out int invalidViewIndex)
        {
            bool validationPass = true;
            invalidViewIndex = -1;
            for (int i = 0; i < this.View.Layouts.Count; i++)
            {
                ITreeView view = this.View.Layouts[i] as ITreeView;
                if (view != null && view.Trees != null)
                {
                    view.EndEdit();
                    var worker = new TreeValidationWorker(view.Trees);
                    if (!worker.ValidateTrees())
                    {
                        if (invalidViewIndex != -1)
                        {
                            invalidViewIndex = i;
                        }
                        validationPass = false;
                    }
                }
            }

            return validationPass;
        }