Esempio n. 1
0
        public bool RemoveView(View view)
        {
            int index = ViewSupport.FindViewIndex(_childViews, view);

            if (index == -1)
            {
                return(false);
            }
            _childViews = ViewSupport.RemoveView(_childViews, index);
            view.Parent = null;
            return(true);
        }
Esempio n. 2
0
        /// <summary>
        /// Uses the standard SCOM personalization options to store user preferences
        /// </summary>
        protected override void ApplyPersonalization()
        {
            if (ColumnCollection != null && ColumnCollection.Count > 0)
            {
                ColumnCollection.Apply(Grid);
                return;
            }

            if (Configuration != null)
            {
                ColumnCollection = ViewSupport.XmlToColumnInfoCollection(Configuration.Presentation);
                ColumnCollection.Apply(Grid);
            }
        }
        protected override void ApplyPersonalization()
        {
            Dbg.Log($"Entering {MethodBase.GetCurrentMethod().Name}");

            if (ColumnCollection != null)
            {
                ColumnCollection.Apply(Grid);
            }
            else
            {
                if (Configuration == null)
                {
                    return;
                }
                ColumnCollection = ViewSupport.XmlToColumnInfoCollection(Configuration.Presentation);
                ColumnCollection.Apply(Grid);
            }
        }
Esempio n. 4
0
        // Properties of the view itself. I.e. when right-clicked at the view node in the navigation tree.
        protected override void OnViewPropertiesCommand(object sender, CommandEventArgs args)
        {
            ViewConfiguration viewConfiguration = ViewSupport.ViewEditDialog(Site, View, SystemView.State);

            Tag = viewConfiguration;
            if (viewConfiguration == null)
            {
                return;
            }
            Configuration.Configuration = viewConfiguration.Configuration;
            Personalization             = ViewSupport.XmlToColumnInfoCollection(Configuration.Presentation);
            SavePersonalization(this);
            if (QueryCache == null)
            {
                return;
            }
            QueryCache.SetCriteria(GetQueryCriteria());
            UpdateCache(UpdateReason.Refresh);
        }
Esempio n. 5
0
        public void Execute()
        {
            var dispatches = _lastResults.GetOrCreate();
            var events     = EventBeanUtility.FlattenList(dispatches);

            if (_isDebugEnabled)
            {
                ViewSupport.DumpUpdateParams(".execute", events);
            }

            if ((ThreadingOption.IsThreadingEnabledValue) && (_threadingService.IsOutboundThreading))
            {
                _threadingService.SubmitOutbound(new OutboundUnitRunnable(events, this).Run);
            }
            else
            {
                ProcessDispatch(events);
            }

            dispatches.Clear();
        }
Esempio n. 6
0
        public static void ApplyDelta(
            OneEventCollection newData,
            OneEventCollection oldData,
            InfraOnMergeViewFactory parent,
            NamedWindowRootViewInstance rootView,
            AgentInstanceContext agentInstanceContext,
            ViewSupport viewable)
        {
            if (!newData.IsEmpty() || oldData != null && !oldData.IsEmpty()) {
                var metricHandle = rootView.AgentInstanceContext.StatementContext.EpStatementHandle.MetricsHandle;
                if (metricHandle.IsEnabled && !newData.IsEmpty()) {
                    agentInstanceContext.MetricReportingService.AccountTime(
                        metricHandle,
                        default(PerformanceMetrics),
                        newData.ToArray().Length);
                }

                var statementResultService = agentInstanceContext.StatementResultService;

                // Events to delete are indicated via old data
                // The on-merge listeners receive the events deleted, but only if there is interest
                if (statementResultService.IsMakeNatural) {
                    var eventsPerStreamNaturalNew = newData.IsEmpty() ? null : newData.ToArray();
                    var eventsPerStreamNaturalOld = oldData == null || oldData.IsEmpty() ? null : oldData.ToArray();
                    rootView.Update(
                        EventBeanUtility.Denaturalize(eventsPerStreamNaturalNew),
                        EventBeanUtility.Denaturalize(eventsPerStreamNaturalOld));
                    viewable.Child.Update(eventsPerStreamNaturalNew, eventsPerStreamNaturalOld);
                }
                else {
                    var eventsPerStreamNew = newData.IsEmpty() ? null : newData.ToArray();
                    var eventsPerStreamOld = oldData == null || oldData.IsEmpty() ? null : oldData.ToArray();
                    rootView.Update(eventsPerStreamNew, eventsPerStreamOld);
                    if (statementResultService.IsMakeSynthetic) {
                        viewable.Child.Update(eventsPerStreamNew, eventsPerStreamOld);
                    }
                }
            }
        }
Esempio n. 7
0
 public View AddView(View view)
 {
     _childViews = ViewSupport.AddView(_childViews, view);
     view.Parent = this;
     return(view);
 }
 public void SetView(ViewSupport view)
 {
     _view = view;
 }