/// <summary>
        /// Handles the Selected Instance Changed event from Editors
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">SelectedInstanceChangedEventArgs.</param>
        private void HandleEditorsSelectedInstanceChanged(object sender, SelectedInstanceChangedEventArgs e)
        {
            // If flag is set, do nothing.
            if (IgnoreEditorsValueChangeEvent)
            {
                return;
            }

            // Check if the value has changed.
            List <Oid> lLastValue = LastValueListOids;
            List <Oid> lValue     = mEditor.Values;
            bool       lEquals    = UtilFunctions.OidListEquals(lLastValue, lValue);

            // If there is no change, do nothing.
            if (lEquals)
            {
                return;
            }

            // Assign the current value as last value
            LastValueListOids = lValue;

            // If the values are the different, raise the change event.
            OnValueChanged(new ValueChangedEventArgs(this, lLastValue, lValue, DependencyRulesAgentLogic.User));
        }
        /// <summary>
        /// Occurs when the selected instance changes.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">SelectedInstanceChangedEventArgs.</param>
        private void HandleMasterSelectedInstanceChanged(object sender, SelectedInstanceChangedEventArgs e)
        {
            // Update context
            UpdateContext();

            // Update details
            ExchangeInfoNavigation lInfoNav;

            foreach (IDetailController lDetail in Details)
            {
                ExchangeInfo lExchgInfo = lDetail.ExchangeInformation;
                lInfoNav = new ExchangeInfoNavigation(lExchgInfo as ExchangeInfoNavigation);
                if (lDetail.IsActiveDetail() && e.SelectedInstances != null && e.SelectedInstances.Count == 1)
                {
                    lInfoNav.SelectedOids = e.SelectedInstances;
                }
                else
                {
                    lInfoNav.SelectedOids = null;
                }
                lDetail.ExchangeInformation = lInfoNav;
                ClearLastOids(lDetail as IUQueryController);
                lDetail.UpdateData(true);
            }
        }
        /// <summary>
        /// Raises the Selected Instance Changed
        /// </summary>
        /// <param name="eventArgs"></param>
        protected virtual void OnSelectedInstanceChanged(SelectedInstanceChangedEventArgs eventArgs)
        {
            if (!RaiseSelectecInstanceChanged)
            {
                return;
            }

            EventHandler <SelectedInstanceChangedEventArgs> handler = SelectedInstanceChanged;

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }
        /// <summary>
        /// Actions related with the Selected instance changed from the DisplaySet.
        /// Do the standar and at the end, check the associated service and initialize it
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void ProcessDisplaySetSelectedInstanceChanged(object sender, SelectedInstanceChangedEventArgs e)
        {
            base.ProcessDisplaySetSelectedInstanceChanged(sender, e);

            // Initializes the associated service
            if (AssociatedServiceController != null &&
                Logic.Agent.IsActiveFacet(AssociatedServiceController.Agents))
            {
                SetInstanceToAssociatedService(e.SelectedInstances);
            }
        }
        /// <summary>
        /// Raises the Selected Instance Changed
        /// </summary>
        /// <param name="eventArgs"></param>
        protected virtual void OnSelectedInstanceChanged(SelectedInstanceChangedEventArgs eventArgs)
        {
            if (!RaiseSelectecInstanceChanged)
            {
                return;
            }

            EventHandler<SelectedInstanceChangedEventArgs> handler = SelectedInstanceChanged;

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }
        /// <summary>
        /// Handles the Selected Instance Changed event from Editors
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">SelectedInstanceChangedEventArgs.</param>
        private void HandleEditorsSelectedInstanceChanged(object sender, SelectedInstanceChangedEventArgs e)
        {
            // If flag is set, do nothing.
            if (IgnoreEditorsValueChangeEvent)
            {
                return;
            }

            // Check if the value has changed.
            List<Oid> lLastValue = LastValueListOids;
            List<Oid> lValue = mEditor.Values;
            bool lEquals = UtilFunctions.OidListEquals(lLastValue, lValue);

            // If there is no change, do nothing.
            if (lEquals)
            {
                return;
            }

            // Assign the current value as last value
            LastValueListOids = lValue;

            // If the values are the different, raise the change event.
            OnValueChanged(new ValueChangedEventArgs(this, lLastValue, lValue, DependencyRulesAgentLogic.User));
        }
        /// <summary>
        /// Occurs when the selected instance changes.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">SelectedInstanceChangedEventArgs.</param>
        private void HandleMasterSelectedInstanceChanged(object sender, SelectedInstanceChangedEventArgs e)
        {
            // Update context
            UpdateContext();

            // Update details
            ExchangeInfoNavigation lInfoNav;
            foreach (IDetailController lDetail in Details)
            {
                ExchangeInfo lExchgInfo = lDetail.ExchangeInformation;
                lInfoNav = new ExchangeInfoNavigation(lExchgInfo as ExchangeInfoNavigation);
                if (lDetail.IsActiveDetail() && e.SelectedInstances != null && e.SelectedInstances.Count == 1)
                {
                    lInfoNav.SelectedOids = e.SelectedInstances;
                }
                else
                {
                    lInfoNav.SelectedOids = null;
                }
                lDetail.ExchangeInformation = lInfoNav;
                ClearLastOids(lDetail as IUQueryController);
                lDetail.UpdateData(true);
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// Executes actions related to changing selection in the Master region.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void HandleInstanceMasterControllerSelectedInstanceChanged(object sender, SelectedInstanceChangedEventArgs e)
 {
     ProcessInstanceMasterControllerSelectedInstanceChanged(sender, e);
 }
Exemplo n.º 9
0
        /// <summary>
        /// Process the selection instance changes in the main Instance controller. Updates the information in the tree
        /// </summary>
        /// <param name="sender">The control that have raised the event.</param>
        /// <param name="e">Contains the necessary parameters involved in SelectedInstanceChanged event.</param>
        protected virtual void ProcessInstanceMasterControllerSelectedInstanceChanged(object sender, SelectedInstanceChangedEventArgs e)
        {
            // Selected instance in the master has been modified, refresh the first level nodes
            HideAllGroups();

            // If no instance selected in the Master, clear all nodes
            if (e.SelectedInstances == null || e.SelectedInstances.Count == 0)
            {
                Tree.Clear();
            }
            else
            {
                foreach (TreeNodeController treeNodeController in RootNodes)
                {
                    // If this node has to show instances
                    if (treeNodeController.QueryContext != null)
                    {
                        treeNodeController.QueryContext.ExchangeInformation.SelectedOids = e.SelectedInstances;
                        DataTable lData = GetNextDataBlock(treeNodeController.QueryContext, null);
                        Tree.ShowDataInRootNode(treeNodeController.NodeId, lData, treeNodeController.DisplaySetInfo, treeNodeController.LastBlock, treeNodeController.ShowGroupingNode);
                    }
                    else
                    {
                        Tree.ShowDataInRootNode(treeNodeController.NodeId, null, null, true, treeNodeController.ShowGroupingNode);
                    }
                }
            }

            // If no instance node selected, configure root context menus
            if (Tree.Values == null || Tree.Values.Count == 0)
            {
                foreach (TreeNodeController treeNodeController in RootNodes)
                {
                    treeNodeController.ConfigureMenu(null);
                }
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// Actions related with the Selected instance changed from the DisplaySet.
        /// Do the standar and at the end, check the associated service and initialize it
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void ProcessDisplaySetSelectedInstanceChanged(object sender, SelectedInstanceChangedEventArgs e)
        {
            base.ProcessDisplaySetSelectedInstanceChanged(sender, e);

            // Initializes the associated service
            if (AssociatedServiceController != null &&
                Logic.Agent.IsActiveFacet(AssociatedServiceController.Agents))
            {
                SetInstanceToAssociatedService(e.SelectedInstances);
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// Raises the SelectedInstanceChanged event
        /// </summary>
        /// <param name="eventArgs"></param>
        protected void OnSelectedInstanceChanged(SelectedInstanceChangedEventArgs eventArgs)
        {
            EventHandler<SelectedInstanceChangedEventArgs> handler = SelectedInstanceChanged;

            if (handler != null)
            {
                handler(this, eventArgs);
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// Executes the actions related to OnSelectedInstanceChanged event.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">SelectedInstanceChangedEventArgs.</param>
        private void HandleDisplaySetSelectedInstanceChanged(object sender, SelectedInstanceChangedEventArgs e)
        {
            if (mFlagIgnoreSelectionChange)
            {
                return;
            }

            ProcessDisplaySetSelectedInstanceChanged(sender, e);
        }
Exemplo n.º 13
0
        /// <summary>
        /// Actions related with the Selected instance changed from the DisplaySet
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected virtual void ProcessDisplaySetSelectedInstanceChanged(object sender, SelectedInstanceChangedEventArgs e)
        {
            if (!CheckPendingChanges(false, true))
            {
                DisplaySet.RaiseSelectecInstanceChanged = false;
                DisplaySet.Values = DisplaySet.PreviousValue;
                DisplaySet.RaiseSelectecInstanceChanged = true;
                return;
            }

            // Keep the previous value
            DisplaySet.PreviousValue = e.SelectedInstances;

            int lNumInstances = 0;
            if (e.SelectedInstances != null)
            {
                lNumInstances = e.SelectedInstances.Count;
            }

            #region Enable/disable navigations
            if (Navigation != null)
            {
                Navigation.EnableItemsBasedOnSelectedInstances(lNumInstances, e.EnabledNavigationsKeys);
            }
            #endregion Enable/disable navigations

            #region Enable/disable actions
            // Enable or disable the actions.
            if (Action != null)
            {
                Action.EnableItemsBasedOnSelectedInstances(lNumInstances, e.EnabledActionsKeys);
            }
            #endregion Enable/disable actions

            // Disable the Associated service.
            EnableAssociatedService(false);

            // Execute default instance change.
            OnSelectedInstanceChanged(e);
        }