Esempio n. 1
0
        public override void OnLoad(object sender, RoutedEventArgs e)
        {
            base.OnLoad(sender, e);

            if (DesignerProperties.GetIsInDesignMode(this))
            {
                return;
            }

            if (this.NotSet(EntityBase.EntityTemplateProperty) && this.NotSet(EntityBase.EntityTemplateSelectorProperty))
            {
                var type = Type;

                if (this is EntityCombo && !type.IsLite()) //Allways going to be lite
                {
                    type = Lite.Generate(type);
                }

                EntityTemplate = Navigator.FindDataTemplate(this, type);
            }

            if (this.NotSet(EntityBase.ImplementationsProperty) && CleanType.IsEntity() && !CleanType.IsAbstract)
            {
                Implementations = Signum.Entities.Implementations.By(CleanType);
            }

            if (this.NotSet(EntityBase.CreateProperty) && Create)
            {
                Create =
                    CleanType.IsEmbeddedEntity() ? Navigator.IsCreable(CleanType) :
                    Implementations.Value.IsByAll ? false:
                    Implementations.Value.Types.Any(t => Navigator.IsCreable(t, isSearch: false));
            }

            if (this.NotSet(EntityBase.ViewProperty) && View)
            {
                View = CleanType.IsEmbeddedEntity() ? Navigator.IsViewable(CleanType) :
                       Implementations.Value.IsByAll ? true :
                       Implementations.Value.Types.Any(t => Navigator.IsViewable(t));
            }

            if (this.NotSet(EntityBase.NavigateProperty) && Navigate)
            {
                Navigate = CleanType.IsEmbeddedEntity() ? Navigator.IsNavigable(CleanType, isSearch: false) :
                           Implementations.Value.IsByAll ? true :
                           Implementations.Value.Types.Any(t => Navigator.IsNavigable(t, isSearch: false));
            }

            if (this.NotSet(EntityBase.FindProperty) && Find)
            {
                Find = CleanType.IsEmbeddedEntity() ? false:
                       Implementations.Value.IsByAll ? false :
                       Implementations.Value.Types.Any(t => Finder.IsFindable(t));
            }

            if (this.NotSet(EntityBase.ViewOnCreateProperty) && ViewOnCreate && !View)
            {
                ViewOnCreate = false;
            }

            UpdateVisibility();
        }
Esempio n. 2
0
        public override void Execute()
        {
            EvaluateFunValues();

            Finder.Explore(Options);
        }