/// <summary>
        /// Groups the model controller finished.
        /// </summary>
        /// <param name="sender">The sender.</param>
        public void GroupModelControllerFinished(UPGroupModelController sender)
        {
            if (this.Group?.Actions?.Count == 0)
            {
                this.Group.Actions.AddRange(this.GroupActions);
            }

            this.Delegate?.GroupModelControllerFinished(this);
        }
        /// <summary>
        /// Groups the model controller finished.
        /// </summary>
        /// <param name="sender">The sender.</param>
        public void GroupModelControllerFinished(UPGroupModelController sender)
        {
            UPInsightBoardItemGroupModelController itemController = (UPInsightBoardItemGroupModelController)sender;

            if (itemController.ControllerState == GroupModelControllerState.Finished)
            {
                UPMInsightBoardItem currentItem = (UPMInsightBoardItem)itemController.Group.Children[0];
                if (this.Group.Children.Count == 0)
                {
                    this.Group.AddChild(currentItem);
                }
                else
                {
                    bool inserted = false;
                    for (int i = 0; i < this.Group.Children.Count; i++)
                    {
                        UPMInsightBoardItem item = (UPMInsightBoardItem)this.Group.Children[i];
                        if (item.SortIndex == currentItem.SortIndex)
                        {
                            inserted = true;
                            break;
                        }
                        else if (item.SortIndex > currentItem.SortIndex)
                        {
                            this.Group.InsertChildAtIndex(currentItem, i);
                            inserted = true;
                            break;
                        }
                    }

                    if (!inserted)
                    {
                        this.Group.AddChild(currentItem);
                    }
                }

                this.pending--;
            }

            if (this.pending == 0)
            {
                bool waitTillFinishLoading = false; // ((NSNumber)NSUserDefaults.StandardUserDefaults().ObjectForKey("Dashboard.WaitTillFinishLoad")).BoolValue;
                var  dashboard             = this.Delegate as DashboardPageModelController;

                if (waitTillFinishLoading && dashboard != null)
                {
                    var viewController = dashboard.ModelControllerDelegate;
                    // viewController.PerformSelectorOnMainThreadWithObjectWaitUntilDone(@selector(hideSyncIndicator), null, false);
                }

                this.ControllerState = GroupModelControllerState.Finished;
                this.Delegate.GroupModelControllerFinished(this);
            }
        }
        private bool CreateParentControllerFromLinkReader(UPCRMLinkReader linkReader)
        {
            int tabIndex;
            UPConfigFieldControlField field = this.LinkFields[linkReader.DestinationPosition];
            string fieldGroupName           = field.InfoAreaId;

            tabIndex = 0;
            string fieldStyle = field.Attributes.FieldStyle;

            if (!string.IsNullOrEmpty(fieldStyle))
            {
                var parts = fieldStyle.Split('_');
                if (parts.Length > 1)
                {
                    tabIndex       = Convert.ToInt32(parts[1]);
                    fieldGroupName = parts[0];
                }
                else
                {
                    fieldGroupName = fieldStyle;
                }
            }

            IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore;

            this.ParentFieldControl = configStore.FieldControlByNameFromGroup("Details", fieldGroupName);
            if (this.ParentFieldControl == null && fieldGroupName == field.InfoAreaId)
            {
                this.ParentFieldControl = configStore.FieldControlByNameFromGroup("Details", field.InfoAreaId);
            }

            if (this.ParentFieldControl == null)
            {
                return(false);
            }

            if (tabIndex >= this.ParentFieldControl.NumberOfTabs)
            {
                tabIndex = 0;
            }

            this.ParentController = UPGroupModelController.DetailsGroupModelController(this.ParentFieldControl, tabIndex, this);
            this.ParentController.ExplicitLabel = this.TabLabel;
            return(true);
        }
Exemple #4
0
        /// <summary>
        /// Applies the context.
        /// </summary>
        /// <param name="contextDictionary">The context dictionary.</param>
        /// <returns></returns>
        public override UPMGroup ApplyContext(Dictionary <string, object> contextDictionary)
        {
            base.ApplyContext(contextDictionary);
            UPMMultilineGroup multiLineGroup = new UPMMultilineGroup(this.ExplicitTabIdentifier);
            var    stringParts = this.TabLabel.Split(';');
            string labelText;
            string fieldText;

            if (stringParts.Length > 1)
            {
                labelText = stringParts[0];
                fieldText = stringParts[1];
            }
            else
            {
                UPGroupModelController root = this.RootGroupModelController;
                if (root != null)
                {
                    fieldText = this.TabLabel;
                    labelText = root.TabLabel;
                }
                else
                {
                    labelText = this.TabLabel;
                    fieldText = null;
                }
            }

            UPMStringField field = new UPMStringField(this.ExplicitTabIdentifier);

            multiLineGroup.LabelText            = labelText;
            multiLineGroup.MultilineStringField = field;
            field.StringValue    = fieldText;
            this.Group           = multiLineGroup;
            this.ControllerState = GroupModelControllerState.Finished;
            return(multiLineGroup);
        }
 /// <summary>
 /// Groups the model controller finished.
 /// </summary>
 /// <param name="sender">The sender.</param>
 public void GroupModelControllerFinished(UPGroupModelController sender)
 {
     this.Delegate.GroupModelControllerFinished(this);
 }