Example #1
0
 protected override void OnActivated() {
     base.OnActivated();
     Frame.TemplateChanged += new EventHandler(Frame_TemplateChanged);
     IHintProvider hintProvider = HintsRepository.Instance.FindHintProvider(View);
     if(hintProvider == null && View is ObjectView) {
         hintProvider = ((ObjectView)View).ObjectTypeInfo.FindAttribute<HintAttribute>();
     }
     calculator = new HintCalculator(hintProvider);
     if(View is DetailView) {
         calculator.CurrentViewType = ViewType.DetailView;
     }
     if(View is ListView) {
         calculator.CurrentViewType = ViewType.ListView;
     }
     calculator.HintChanged += new EventHandler<EventArgs>(calculator_HintChanged);
     View.CurrentObjectChanged += new EventHandler(View_CurrentObjectChanged);
     calculator.CurrentObject = View.CurrentObject;
     SetText();
 }
Example #2
0
        protected override void OnActivated()
        {
            base.OnActivated();
            Frame.TemplateChanged += new EventHandler(Frame_TemplateChanged);
            IHintProvider hintProvider = HintsRepository.Instance.FindHintProvider(View);

            if (hintProvider == null && View is ObjectView)
            {
                hintProvider = ((ObjectView)View).ObjectTypeInfo.FindAttribute <HintAttribute>();
            }
            calculator = new HintCalculator(hintProvider);
            if (View is DetailView)
            {
                calculator.CurrentViewType = ViewType.DetailView;
            }
            if (View is ListView)
            {
                calculator.CurrentViewType = ViewType.ListView;
            }
            calculator.HintChanged    += new EventHandler <EventArgs>(calculator_HintChanged);
            View.CurrentObjectChanged += new EventHandler(View_CurrentObjectChanged);
            calculator.CurrentObject   = View.CurrentObject;
            SetText();
        }