public WinFrameControlDecorator(View view, FrameControl frameControl, IAdditionalViewControlsRule controlsRule)
     : base(view, frameControl, controlsRule)
 {
     _frameControl = frameControl;
     frameControl.Disposed += hintPanel_Disposed;
     UpdateText();
 }
 protected AdditionalViewControlsProviderDecorator(View view,object control, IAdditionalViewControlsRule controlsRule)
 {
     this.control = control;
     calculator = new AdditionalViewControlsProviderCalculator(controlsRule,view.ObjectTypeInfo.Type);
     calculator.HintChanged += calculator_HintChanged;
     calculator.CurrentObject = view.CurrentObject;
 }
Example #3
0
 public WebHintPanelDecorator(View view, HintPanelBase hintPanelBase, IAdditionalViewControlsRule controlsRule)
     : base(view, hintPanelBase, controlsRule) {
     _hintPanelBase = hintPanelBase;
     hintPanelBase.Unload += hintPanel_Unload;
     hintPanelBase.Disposed += hintPanel_Disposed;
     UpdateText();
 }
 public static Type Get_DecoratorType(IAdditionalViewControlsRule additionalViewControlsRule)
 {
     ITypeInfo decoratorType =
         ModelAdditionalViewControlsRuleDomainLogic.GetDecorators().Where(info => info.Type.GetCustomAttributes(typeof(TypeDecorator), true).OfType<TypeDecorator>().Where(
             decorator => decorator.IsDefaultDecorator).Count() > 0).FirstOrDefault();
     return decoratorType != null ? decoratorType.Type : typeof(NotAvaliableInThisPlatform);
 }
Example #5
0
 public WebHintPanelDecorator(View view, HintPanel hintPanel, IAdditionalViewControlsRule controlsRule)
     : base(view, hintPanel, controlsRule) {
     this.hintPanel = hintPanel;
     hintPanel.Unload += hintPanel_Unload;
     hintPanel.Disposed += hintPanel_Disposed;
     UpdateText();
     count++;
 }
 public AdditionalViewControlsPermission(IAdditionalViewControlsRule logicRule)
     : base(OperationName, logicRule) {
     ControlType=logicRule.ControlType;
     DecoratorType = logicRule.DecoratorType;
     Message = logicRule.Message;
     Position=logicRule.Position;
     BackColor=logicRule.BackColor;
     ForeColor=logicRule.ForeColor;
     FontStyle=logicRule.FontStyle;
     Height=logicRule.Height;
     FontSize=logicRule.FontSize;
 }
        protected AdditionalViewControlsProviderDecorator(View view,object control, IAdditionalViewControlsRule controlsRule)
        {
            this.control = control;
            calculator = new AdditionalViewControlsProviderCalculator(controlsRule,view.ObjectTypeInfo.Type);
//            if (view is DetailView)
//                calculator.CurrentViewType = ViewType.DetailView;
//            if (view is ListView)
//                calculator.CurrentViewType = ViewType.ListView;
            calculator.HintChanged += calculator_HintChanged;
//            view.CurrentObjectChanged += View_CurrentObjectChanged;
            calculator.CurrentObject = view.CurrentObject;
        }
 public AdditionalViewControlsRule(IAdditionalViewControlsRule additionalViewControlsRule)
     : base(additionalViewControlsRule) {
         Message = additionalViewControlsRule.Message;
         ControlType = additionalViewControlsRule.ControlType;
         DecoratorType = additionalViewControlsRule.DecoratorType;
         MessageProperty = additionalViewControlsRule.MessageProperty;
         Position = additionalViewControlsRule.Position;
         BackColor = additionalViewControlsRule.BackColor;
         ForeColor = additionalViewControlsRule.ForeColor;
         FontStyle = additionalViewControlsRule.FontStyle;
         Height = additionalViewControlsRule.Height;
         FontSize=additionalViewControlsRule.FontSize;
 }
 protected override void InitializeControl(object control, IAdditionalViewControlsRule rule,
                                      AdditionalViewControlsProviderCalculator additionalViewControlsProviderCalculator,
                                      ExecutionContext executionContext) {
     base.InitializeControl(control, rule, additionalViewControlsProviderCalculator, executionContext);
     var value = (Control)control;
     if (rule.Position != Position.DetailViewItem) {
         if (rule.Position == Position.Bottom)
             value.Dock = DockStyle.Bottom;
         else if (rule.Position == Position.Top)
             value.Dock = DockStyle.Top;
     } else {
         value.Dock = DockStyle.Fill;
     }
 }
 public AdditionalViewControlsProviderCalculator(IAdditionalViewControlsRule controlsRule,Type objectType) {
     _controlsRule = controlsRule;
     _objectType = objectType;
 }
Example #11
0
 public WinHintPanelDecorator(View view, object hintPanel, IAdditionalViewControlsRule controlsRule): this(view, hintPanel as HintPanel, controlsRule) {
 }
 protected virtual IAdditionalViewControl GetControl(Type controlType, IAdditionalViewControl additionalViewControl, IAdditionalViewControlsRule rule) {
     var control = additionalViewControl ?? controlType.CreateInstance() as IAdditionalViewControl;
     var manager = control as ISupportLayoutManager;
     if (manager != null) {
         if (rule.Position != Position.DetailViewItem)
             throw new ArgumentException("Rule with Id:" + rule.Id + " position should be set to " + Position.DetailViewItem);
         if (RuleToLayoutMap.ContainsKey(rule.Id))
             manager.LayoutItem = RuleToLayoutMap[rule.Id];
     }
     return control;
 }
 protected virtual void RemoveControl(IList controls, object firstOrDefault, IAdditionalViewControlsRule rule) {
     if (rule.Position != Position.DetailViewItem)
         controls.Remove(firstOrDefault);
 }
 IAdditionalViewControl FindControl(IAdditionalViewControlsRule rule, ICollection controls) {
     return controls.OfType<IAdditionalViewControl>().FirstOrDefault(o => o.Rule.Id == rule.Id);
 }
 protected object GetContainerControl(IViewSiteTemplate viewSiteTemplate, IAdditionalViewControlsRule rule) {
     if (rule.Position == Position.DetailViewItem && View is DetailView) {
         var modelAdditionalViewControlsItem = ((DetailView)View).Items.OfType<AdditionalViewControlsItem>().FirstOrDefault(item => item.Model.Rule.Id == rule.Id);
         return modelAdditionalViewControlsItem != null ? modelAdditionalViewControlsItem.Control : null;
     }
     return viewSiteTemplate.ViewSiteControl;
 }
 public static Type Get_ControlType(IAdditionalViewControlsRule additionalViewControlsRule)
 {
     TypeDecorator decorator = ModelAdditionalViewControlsRuleDomainLogic.GetTypeDecorator(additionalViewControlsRule.Position);
     return decorator != null ? decorator.DefaultType : typeof(NotAvaliableInThisPlatform);
 }
 protected virtual void InitializeControl(object control, IAdditionalViewControlsRule additionalViewControlsRule, AdditionalViewControlsProviderCalculator calculator, ExecutionContext context) {
     var appeareance = control as ISupportAppeareance;
     if (appeareance != null) {
         var supportAppeareance = appeareance;
         supportAppeareance.BackColor = additionalViewControlsRule.BackColor;
         supportAppeareance.Height = additionalViewControlsRule.Height;
         supportAppeareance.ForeColor = additionalViewControlsRule.ForeColor;
         supportAppeareance.FontStyle = additionalViewControlsRule.FontStyle;
         supportAppeareance.FontSize = additionalViewControlsRule.FontSize;
         supportAppeareance.ImageName = additionalViewControlsRule.ImageName;
     }
 }
 bool ViewContextIsCorrect(IAdditionalViewControlsRule rule) {
     return rule.Position != Position.DetailViewItem || !(View is ListView);
 }
 public AdditionalViewControlsRule(IAdditionalViewControlsRule additionalViewControlsRule)
     : base(additionalViewControlsRule) {
     _additionalViewControlsRule = additionalViewControlsRule;
 }