示例#1
0
        protected virtual void OnSelectedItemChange(UISubPageReferenceList list)
        {
            var handler = SelectedItemChange;

            if (handler != null)
            {
                handler(list);
            }
        }
示例#2
0
        protected virtual void OnIsMovingChange(UISubPageReferenceList list, bool ismoving)
        {
            var handler = IsMovingChange;

            if (handler != null)
            {
                handler(list, ismoving);
            }
        }
示例#3
0
 /// <summary>
 /// The default Constructor.
 /// </summary>
 protected UIActionSheet(UIControllerWithSmartObjects uiController, UIViewController view,
                         SmartObject subPageReferenceListOfButtons, UILabel titleLabel, UILabel subtitleLabel)
 {
     _uiController            = uiController;
     _view                    = view;
     _titleLabel              = titleLabel;
     _subtitleLabel           = subtitleLabel;
     _buttonList              = new UIActionSheetButtonList(uiController, subPageReferenceListOfButtons);
     _view.VisibilityChanged += ViewOnVisibilityChanged;
     CancelButtonMode         = UIActionSheetButtonMode.Red;
 }
示例#4
0
        /// <summary>
        /// Creates a base class for subpage reference list items
        /// </summary>
        /// <param name="list">The subpage list</param>
        /// <param name="index">The index of the item</param>
        protected UISubPageReferenceListItem(UISubPageReferenceList list, uint index)
            : base(list.SmartObject)
        {
            try
            {
                _list  = list;
                _index = index;

                VisibleJoin = list.SmartObject.BooleanInput[string.Format("Item {0} Visible", index)];
                EnableJoin  = list.SmartObject.BooleanInput[string.Format("Item {0} Enable", index)];

                if (list.DigitalJoinIncrement > 0)
                {
                    uint count      = 0;
                    var  inputSigs  = new Dictionary <uint, BoolInputSig>();
                    var  outputSigs = new Dictionary <uint, BoolOutputSig>();
                    for (var i = index * list.DigitalJoinIncrement - (list.DigitalJoinIncrement - 1);
                         i <= index * list.DigitalJoinIncrement;
                         i++)
                    {
                        count++;
                        inputSigs[count]  = list.SmartObject.BooleanInput[string.Format("fb{0}", i)];
                        outputSigs[count] = list.SmartObject.BooleanOutput[string.Format("press{0}", i)];
                    }
                    _boolInputSigs  = new ReadOnlyDictionary <uint, BoolInputSig>(inputSigs);
                    _boolOutputSigs = new ReadOnlyDictionary <uint, BoolOutputSig>(outputSigs);
                }

                if (list.AnalogJoinIncrement > 0)
                {
                    uint count      = 0;
                    var  inputSigs  = new Dictionary <uint, UShortInputSig>();
                    var  outputSigs = new Dictionary <uint, UShortOutputSig>();
                    for (var i = index * list.AnalogJoinIncrement - (list.AnalogJoinIncrement - 1);
                         i <= index * list.AnalogJoinIncrement;
                         i++)
                    {
                        count++;
                        inputSigs[count]  = list.SmartObject.UShortInput[string.Format("an_fb{0}", i)];
                        outputSigs[count] = list.SmartObject.UShortOutput[string.Format("an_act{0}", i)];
                    }
                    _uShortInputSigs  = new ReadOnlyDictionary <uint, UShortInputSig>(inputSigs);
                    _uShortOutputSigs = new ReadOnlyDictionary <uint, UShortOutputSig>(outputSigs);
                }

                if (list.SerialJoinIncrement > 0)
                {
                    uint count      = 0;
                    var  inputSigs  = new Dictionary <uint, StringInputSig>();
                    var  outputSigs = new Dictionary <uint, StringOutputSig>();
                    for (var i = index * list.SerialJoinIncrement - (list.SerialJoinIncrement - 1);
                         i <= index * list.SerialJoinIncrement;
                         i++)
                    {
                        count++;
                        inputSigs[count]  = list.SmartObject.StringInput[string.Format("text-o{0}", i)];
                        outputSigs[count] = list.SmartObject.StringOutput[string.Format("text-i{0}", i)];
                    }
                    _stringInputSigs  = new ReadOnlyDictionary <uint, StringInputSig>(inputSigs);
                    _stringOutputSigs = new ReadOnlyDictionary <uint, StringOutputSig>(outputSigs);
                }

                _button = new UIButton(list.SmartObject, BoolOutputSigs[1].Name, BoolInputSigs[1].Name,
                                       StringInputSigs[1].Name);
            }
            catch (Exception e)
            {
                CloudLog.Exception(e);
            }
        }