Exemple #1
0
        public static DataTriggerCondition Register(FrameworkElement element, IExpressionProvider expressionProvider, object value)
        {
            DataTriggerCondition condition = new DataTriggerCondition(element, expressionProvider, value);

            condition.Register();
            return(condition);
        }
        public OvDialog(SQLRepository repository, ObjectVariable objectVariable)
        {
            InitializeComponent();

            this.objectVariable = objectVariable;
            this.repository     = repository;

            DialogClosed = false;

            if (objectVariable is TGGObjectVariable || objectVariable is TGGCorrespondence)
            {
                this.ovBindingProvider = new TggOvExpressionProvider(objectVariable as TGGObjectVariable, repository);
            }
            else
            {
                this.ovBindingProvider = new OvExpressionProvider(objectVariable, repository);
            }



            //try to load ObjectVariable data from moca tree.
            this.objectVariable.loadTreeFromTaggedValue();

            this.ovPropertiesControl.initializeUserControl(repository, objectVariable, this);
            this.bindingControl.initializeInformation(ovBindingProvider, ovBindingProvider.getProviderExpression(), repository);

            this.StartPosition = FormStartPosition.CenterScreen;

            this.ovPropertiesControl.checkBoxBound.Checked = !this.ovPropertiesControl.checkBoxBound.Checked;
            this.ovPropertiesControl.checkBoxBound.Checked = !this.ovPropertiesControl.checkBoxBound.Checked;
        }
Exemple #3
0
 public FilterProvider(
     IFilterParser <TEntity> filterParser,
     IExpressionProvider <TEntity> expressionProvider)
 {
     FilterParser       = filterParser;
     ExpressionProvider = expressionProvider;
 }
 public MapConfiguration(IExpressionProvider expressionProvider,
                         DynamicMapping dynamicMapping = DynamicMapping.NotAllowed,
                         bool preserveReferences       = false)
 {
     _expressionProvider = expressionProvider;
     _dynamicMapping     = dynamicMapping;
     _preserveReferences = preserveReferences;
 }
Exemple #5
0
        protected MapBuilderBase(Type inType, Type outType, IExpressionProvider expressionProvider)
        {
            InType             = inType;
            OutType            = outType;
            ExpressionProvider = expressionProvider;

            InMembers  = Helper.GetMapFields(InType).ToList();
            OutMembers = Helper.GetMapFields(OutType, true).ToList();
        }
Exemple #6
0
        public MapBuilder(IExpressionProvider expressionProvider)
        {
            _expressionProvider = expressionProvider;

            _inType     = typeof(TIn);
            _outType    = typeof(TOut);
            _inMembers  = Helper.GetMapFields(_inType).ToList();
            _outMembers = Helper.GetMapFields(_outType, true).ToList();
        }
Exemple #7
0
        public ExpressionReturnForm(IExpressionProvider provider, Expression underlyingExpression, SQLRepository repository)
        {
            InitializeComponent();

            this.underlyingExpression = underlyingExpression;
            this.provider             = provider;
            this.repository           = repository;
            StartPosition             = FormStartPosition.CenterScreen;

            initialize();
        }
Exemple #8
0
        private Expression VisitCallExpressionAttribute(IExpressionProvider expressionProvider, MemberInfo memberInfo, IEnumerable <Expression> arguments)
        {
            var expression = expressionProvider.GetExpression(memberInfo);

            if (expression == null)
            {
                throw new InvalidOperationException("Expression is not found.");
            }

            return(Visit(expression.Body.ReplaceParameters(expression.Parameters, arguments)) !);
        }
Exemple #9
0
        public void setVisualOutput(IExpressionProvider provider, Expression expression)
        {
            userChanged             = false;
            this.expressionProvider = provider;
            //get default data from provider

            ExpressionControlData data = GUIUtil.getExpressionStringRepresentation(provider, expression, repository);

            if (data.Expression != "")
            {
                if (this.cmbExpressions.Text != data.Expression)
                {
                    this.cmbExpressions.Text = data.Expression;
                }
                else
                {
                    this.cmbExpressions_SelectedIndexChanged(null, null);
                }
            }
            if (data.First != "")
            {
                if (this.cmbFirstObjects.Text != data.First)
                {
                    this.cmbFirstObjects.Text = data.First;
                }
                else
                {
                    this.cmbFirstObjects_SelectedIndexChanged(null, null);
                }
            }
            if (data.Second != "")
            {
                if (this.cmbSecondObjects.Text != data.Second)
                {
                    this.cmbSecondObjects.Text = data.Second;
                }
                else
                {
                    cmbSecondObjects_SelectedIndexChanged(null, null);
                }
            }
            if (expression != null)
            {
                provider.setExpression(expression);
            }
            updateTreeView();
            userChanged = true;
        }
Exemple #10
0
        public void initializeInformation(IExpressionProvider expressionProvider, Expression expression, SQLRepository repository)
        {
            this.expressionProvider = expressionProvider;
            this.repository         = repository;

            userChanged = false;
            this.cmbExpressions.Items.Clear();
            this.cmbExpressions.Items.AddRange(expressionProvider.getExpressionStringList().ToArray());
            if (cmbExpressions.Items.Count > 0)
            {
                this.cmbExpressions.SelectedIndex = 0;
            }


            setVisualOutput(expressionProvider, expression);

            userChanged = true;
        }
Exemple #11
0
        public StopNodeForm(StopNode stopNode, SQLRepository repository)
        {
            InitializeComponent();

            stopNode.loadTreeFromTaggedValue();

            this.provider = new StopNodeExpressionProvider(stopNode, repository);
            this.expressionControl1.initializeInformation(provider, stopNode.ReturnValue, repository);

            if (stopNode.ReturnValue == null)
            {
                expressionControl1.cmbExpressions.SelectedIndex = 0;
            }

            this.stopNode      = stopNode;
            this.repository    = repository;
            this.StartPosition = FormStartPosition.CenterScreen;

            ShowDialog();
        }
Exemple #12
0
        public void initializeUserControl(ref ObjectVariable objectVariable, SQLRepository repository, IExpressionProvider parentProvider)
        {
            this.repository                   = repository;
            this.objectVariable               = objectVariable;
            this.leftAttributes               = new List <SQLAttribute>();
            this.assignmentsAndConstraints    = new ArrayList();
            this.OvExpressionProvider         = parentProvider;
            this.ConstraintExpressionProvider = new AttributeConstraintExpressionProvider(null, objectVariable, repository, this.OvExpressionProvider);

            this.expressionControl.initializeInformation(this.ConstraintExpressionProvider, null, repository);

            addAssignmentsAndConstraintsToListboxNew();
            addLeftAttributes();
            this.radioSet.Checked = true;

            if (listboxEntries.Items.Count > 0)
            {
                listboxEntries.SelectedIndex = 0;
            }
        }
        private void SetValue(DependencyProperty dependencyProperty, DependencyPropertyKey dependencyPropertyKey, object value, bool setCurrentValue = false, BaseValueSource source = BaseValueSource.Unknown)
        {
            VerifyReadOnlyProperty(dependencyProperty, dependencyPropertyKey);

            IExpressionProvider newExpressionProvider = value as IExpressionProvider;

            if (newExpressionProvider == null && !dependencyProperty.IsValidValue(value))
            {
                return; // invalid value
            }

            IDependencyPropertyValueEntry entry = GetInitializedValueEntry(dependencyProperty);

            IExpression oldExpression = setCurrentValue ?
                                        entry.GetBaseValue(false) as IExpression : // current value may be set in the top priority expression
                                        entry.GetBaseValue((int)source, false) as IExpression;

            if (newExpressionProvider != null)
            {
                value = newExpressionProvider.CreateExpression(this, dependencyProperty);
            }
            else if (oldExpression != null && oldExpression.SetValue(value))
            {
                return; // value (current or not) was set in the existing expression, nothing else to do
            }

            if (setCurrentValue)
            {
                entry.SetCurrentValue(value);
                return; // base value isn't changed
            }

            if (oldExpression is IDisposable) // expression is being replaced
            {
                ((IDisposable)oldExpression).Dispose();
            }

            entry.SetBaseValue((int)source, value);
            entry.ClearCurrentValue();
        }
 public ExpressionMathSolver(ExpressionTreeProviderBase expressionTreeProvider)
 {
     this.expressionTreeProvider = expressionTreeProvider;
 }
Exemple #15
0
 private Expression VisitCallAttribute(MemberExpression node, IExpressionProvider expressionProvider)
 {
     return(VisitCallExpressionAttribute(expressionProvider, node.Member, new[] { node.Expression }));
 }
Exemple #16
0
 private Expression VisitCallAttribute(MethodCallExpression node, IExpressionProvider expressionProvider)
 {
     return(VisitCallExpressionAttribute(expressionProvider, node.Method, node.Arguments.Prepend(node.Object)));
 }
Exemple #17
0
 private DataTriggerCondition(FrameworkElement element, IExpressionProvider expressionProvider, object value)
 {
     this.element            = element;
     this.expressionProvider = expressionProvider;
     this.value = value;
 }
Exemple #18
0
        public static ExpressionControlData getExpressionStringRepresentation(IExpressionProvider provider, Expression expression, SQLRepository repository)
        {
            ExpressionControlData data = new ExpressionControlData();
            Expression            providerExpression = expression;

            if (providerExpression == null)
            {
                providerExpression = provider.getProviderExpression();
            }

            if (providerExpression != null)
            {
                data.Expression = providerExpression.GetType().Name;
                if (data.Expression == "AttributeValueExpression")
                {
                    AttributeValueExpression attributeValueExpression = providerExpression as AttributeValueExpression;
                    data.First  = attributeValueExpression.ObjectVariableName;
                    data.Second = attributeValueExpression.AttributeName;
                }
                else if (data.Expression == "MethodCallExpression")
                {
                    MethodCallExpression methodCallExpression = providerExpression as MethodCallExpression;
                    if (methodCallExpression.Target is ObjectVariableExpression)
                    {
                        ObjectVariableExpression ovExp = methodCallExpression.Target as ObjectVariableExpression;
                        data.First = ovExp.ObjectVariableName;
                    }
                    else if (methodCallExpression.Target is ParameterExpression)
                    {
                        ParameterExpression pExp = methodCallExpression.Target as ParameterExpression;
                        data.First = pExp.ParameterName;
                    }
                    data.Second = EditorMethodCallExpression.getOperationName(repository, methodCallExpression);
                    foreach (ParameterBinding parameterBinding in methodCallExpression.OwnedParameterBinding)
                    {
                        data.Parameters.Add((parameterBinding.ValueExpression.ToString()));
                    }
                }

                else if (data.Expression == "ParameterExpression")
                {
                    ParameterExpression parameterExpression = providerExpression as ParameterExpression;
                    data.First = parameterExpression.ParameterName;
                }
                else if (data.Expression == "LiteralExpression")
                {
                    LiteralExpression literalExpression = providerExpression as LiteralExpression;
                    data.Parameters.Add(literalExpression.Value);
                }
                else if (data.Expression == "ObjectVariableExpression")
                {
                    ObjectVariableExpression objectVariableExpression = providerExpression as ObjectVariableExpression;
                    data.First = objectVariableExpression.ObjectVariableName;
                }
                else if (data.Expression == "TextualExpression")
                {
                    TextualExpression textualExpression = providerExpression as TextualExpression;
                    data.Expression = "LiteralExpression";
                    data.Parameters.Add(textualExpression.ExpressionText);
                }
            }
            return(data);
        }
Exemple #19
0
 private DataTriggerCondition(FrameworkElement element, IExpressionProvider expressionProvider, object value)
 {
     this.element = element;
     this.expressionProvider = expressionProvider;
     this.value = value;
 }
Exemple #20
0
 public static DataTriggerCondition Register(FrameworkElement element, IExpressionProvider expressionProvider, object value)
 {
     DataTriggerCondition condition = new DataTriggerCondition(element, expressionProvider, value);
     condition.Register();
     return condition;
 }
Exemple #21
0
            public DataTriggerHandler(FrameworkElement element, IExpressionProvider expressionProvider, object value, IEnumerable<ITriggerAction> actions, BaseValueSource valueSource)
            {
                this.element = element;
                this.value = value;
                this.actions = actions;
                this.valueSource = valueSource;

                SetInheritanceParent(element);

                SetValue(ValueProperty, expressionProvider);
            }
Exemple #22
0
 public void initializeStatementTab()
 {
     this.provider = new StatementNodeExpressionProvider(this.ActivityNode as StatementNode, repository);
     this.statementExpressionControl.initializeInformation(provider, provider.getProviderExpression(), repository);
 }
Exemple #23
0
 public AttributeConstraintExpressionProvider(Object constraint, ObjectVariable ov, SQLRepository repository, IExpressionProvider parentOvExpressionProvider) : base(repository)
 {
     this.ov                  = ov;
     this.parentProvider      = parentOvExpressionProvider;
     this.attributeConstraint = constraint;
 }
Exemple #24
0
 public MapBuilder(IExpressionProvider expressionProvider) : base(typeof(TIn), typeof(TOut), expressionProvider)
 {
 }