Example #1
0
        public virtual void Attach(IViewProfile viewProfile, ViewBag bag, ActionCall action)
        {
            // No duplicate views!
            var outputNode = action.ParentChain().Output;

            if (outputNode.HasView(viewProfile.ConditionType))
            {
                return;
            }

            var log = new ViewAttachmentLog(viewProfile);

            action.Trace(log);

            foreach (var filter in filters())
            {
                var viewTokens = filter.Apply(action, bag);
                var count      = viewTokens.Count();

                if (count > 0)
                {
                    log.FoundViews(filter, viewTokens.Select(x => x.Resolve()));
                }

                if (count != 1)
                {
                    continue;
                }

                var token = viewTokens.Single().Resolve();
                outputNode.AddView(token, viewProfile.ConditionType);

                break;
            }
        }
 public PlanePartsController(IPlanePartService service, IViewProfile viewProfile, IPlaneModelService planeModelService, IUserService userService)
 {
     _userService  = userService;
     _modelService = planeModelService;
     _mapper       = viewProfile.GetMapper();
     _service      = service;
 }
Example #3
0
        public void Init(IViewProfile view, bool IsPostback)
        {
            _view     = view;
            accountID = _webContext.AccountID;
            if (_userSession.LoggedIn)
            {
                viewerID = _userSession.CurrentUser.AccountID;
            }
            if (accountID == 0)
            {
                _view.DisplayAccountInfo(viewerID, viewerID);
                accountID = viewerID;
            }
            else
            {
                _view.DisplayAccountInfo(viewerID, accountID);

                //_view.loadProfileAttribute(_listProfileAttributeType, profile);
            }

            LoadProfile(IsPostback, accountID);
            profile                   = _profileService.LoadProfileByAccountID(accountID);
            _listPrivacyFlags         = _privacyService.GetListPrivacyFlag(profile.ProfileID);
            _listProfileAttributeType = _profileAttributeService.GetProfileAttributeType();
            _view.loadProfileAttribute(_listProfileAttributeType, profile);
            // }
        }
Example #4
0
        public virtual void Attach(IViewProfile viewProfile, ViewBag bag, ActionCall action)
        {
            // No duplicate views!
            var outputNode = action.ParentChain().Output;
            if (outputNode.HasView(viewProfile.ConditionType)) return;

            var log = new ViewAttachmentLog(viewProfile);
            action.Trace(log);

            foreach (var filter in _filters)
            {
                var viewTokens = filter.Apply(action, bag);
                var count = viewTokens.Count();

                if (count > 0)
                {
                    log.FoundViews(filter, viewTokens.Select(x => x.Resolve()));
                }

                if (count != 1) continue;

                var token = viewTokens.Single().Resolve();
                outputNode.AddView(token, viewProfile.ConditionType);

                break;
            }
        }
Example #5
0
        public void Attach(IViewProfile viewProfile, ViewBag bag, ActionCall action)
        {
            // No duplicate views!
            var outputNode = action.ParentChain().Output;

            if (outputNode.HasView(viewProfile.Condition))
            {
                return;
            }


            foreach (var filter in _policy.Filters())
            {
                var viewTokens = filter.Apply(action, bag);
                var count      = viewTokens.Count();

                if (count != 1)
                {
                    continue;
                }

                var token = viewTokens.Single().Resolve();

                _attached.Add(token);
                outputNode.AddView(token, viewProfile.Condition);

                break;
            }
        }
Example #6
0
 private void SetSetting <T>(string settingName, T value, [CallerMemberName] string propertyName = null)
 {
     _currentProfile = null;
     UserSettings.Default.ViewProfile  = ViewProfile.Custom.ToString();
     UserSettings.Default[settingName] = value;
     this.RaisePropertyChanged(propertyName);
     this.RaisePropertyChanged(nameof(IsAdvancedView));
     this.RaisePropertyChanged(nameof(IsSimpleView));
 }
Example #7
0
        public void Attach(IViewProfile viewProfile, ViewBag bag, ActionCall action)
        {
            // No duplicate views!
            var outputNode = action.ParentChain().Output;
            if (outputNode.HasView(viewProfile.Condition)) return;

            foreach (var filter in _policy.Filters())
            {
                var viewTokens = filter.Apply(action, bag);
                var count = viewTokens.Count();

                if (count != 1) continue;

                var token = viewTokens.Single().Resolve();

                _attached.Add(token);
                outputNode.AddView(token, viewProfile.Condition);

                break;
            }
        }
Example #8
0
 public ProfileViewBag(IViewProfile profile, BehaviorGraph graph)
 {
     Profile = profile;
     Views   = profile.Filter(graph.Settings.Get <ViewEngines>().Views);
 }
 public ViewAttachmentLog(IViewProfile profile)
 {
     _profile = profile;
 }
Example #10
0
 public ProfileViewBag(IViewProfile profile, BehaviorGraph graph)
 {
     Profile = profile;
     Views = profile.Filter(graph.Views);
 }
 public ViewAttachmentLog(IViewProfile profile)
 {
     _profile = profile;
 }
Example #12
0
 public UserController(IUserService service, IViewProfile viewProfile, IPlaneModelService planeModel)
 {
     _modelService = planeModel;
     _mapper       = viewProfile.GetMapper();
     _service      = service;
 }
Example #13
0
        public void Init(IViewProfile view, bool IsPostback)
        {
            _view = view;
            accountID = _webContext.AccountID;
                if (_userSession.LoggedIn)
                {
                    viewerID = _userSession.CurrentUser.AccountID;

                }
                if (accountID == 0)
                {
                    _view.DisplayAccountInfo(viewerID, viewerID);
                    accountID = viewerID;
                }
                else
                {
                    _view.DisplayAccountInfo(viewerID, accountID);

                    //_view.loadProfileAttribute(_listProfileAttributeType, profile);
                }

                LoadProfile(IsPostback,accountID);
                profile = _profileService.LoadProfileByAccountID(accountID);
                _listPrivacyFlags = _privacyService.GetListPrivacyFlag(profile.ProfileID);
                _listProfileAttributeType = _profileAttributeService.GetProfileAttributeType();
                _view.loadProfileAttribute(_listProfileAttributeType, profile);
               // }
        }
Example #14
0
 public ProfileViewBag(IViewProfile profile, BehaviorGraph graph)
 {
     Profile = profile;
     Views = profile.Filter(graph.Settings.Get<ViewBag>());
 }
Example #15
0
 public ProfileViewBag(IViewProfile profile, ViewBag views)
 {
     Profile = profile;
     Views   = profile.Filter(views);
 }
 public PlaneModelsController(IPlaneModelService service, IViewProfile viewProfile)
 {
     _mapper  = viewProfile.GetMapper();
     _service = service;
 }
Example #17
0
 public ViewCustomization()
 {
     _currentProfile = ViewProfileFactory.CreateProfile();
     _currentProfile?.Init();
 }