Example #1
0
        private void QueueValidate(IDataRecord record)
        {
            var node = record as IDiagramNode;

            if (node != null)
            {
                ItemsToValidate.Add(node); ShouldRevalidate = true;
            }
            else
            {
                var nodeItem = record as IDiagramNodeItem;
                if (nodeItem != null)
                {
                    ShouldRevalidate = true;
                    node             = nodeItem.Node;
                    if (node != null)
                    {
                        ItemsToValidate.Add(node);
                    }
                }
            }
        }
Example #2
0
        public void CommandExecuted(ICommand command)
        {
            if (command is SaveCommand)
            {
                Signal <ITaskHandler>(_ => _.BeginBackgroundTask(ValidateGraph()));
                return;
            }
            if (!ConstantValidation)
            {
                return;
            }
            if (command is SaveAndCompileCommand)
            {
                return;
            }
            if (ShouldRevalidate)
            {
                Signal <ITaskHandler>(_ => _.BeginBackgroundTask(ValidateGraph()));
            }

            ItemsToValidate.Clear();
            ShouldRevalidate = false;
        }