예제 #1
0
        protected void bttnRightAll_Click(object sender, EventArgs e)
        {
            try
            {
                SelectedList.AddRange(UnSelectedList);
                UnSelectedList.Clear();

                bindData();
            }
            catch (Exception ex)
            {
                Messages.ShowError("当前操作出错!<br />详细信息:" + ex.Message);
            }
        }
예제 #2
0
        public IEnumerator SelectAll()
        {
            IEnumerator iterator;

            foreach (var payload in UnSelectedList)
            {
                payload.VisualData.Bound.ClearBounds();

                iterator = SelectedState.Transmit(payload);
                while (iterator.MoveNext())
                {
                    yield return(null);
                }
            }

            SelectedList.AddRange(UnSelectedList);
            UnSelectedList.Clear();

            iterator = TransmitMultiStates();
            while (iterator.MoveNext())
            {
                yield return(null);
            }
        }
        protected override void SelectGroups(List <MutableObject> entry)
        {
            SelectedList.Clear();
            UnSelectedList.Clear();

            var maintainCountAtEdges = MaintainCountAtEdgesField.GetLastKeyValue(entry.Last());

            var entries      = EntryField.GetEntries(entry);
            var entriesCount = entries.Count();

            if (entriesCount == 0)
            {
                Debug.LogError("What?  Empty entries?");
            }

            var beforeWidth = SelectBeforeCount.GetLastKeyValue(entry.Last());
            var afterWidth  = SelectAfterCount.GetLastKeyValue(entry.Last());

            var lowerBound = maintainCountAtEdges?Mathf.Min(beforeWidth, entriesCount - 1):0;
            var upperBound = maintainCountAtEdges ? Mathf.Max(entriesCount - afterWidth - 1, 0) : entriesCount - 1;

            if (lowerBound >= upperBound)
            {
                // use the lower of the two values for both bounds to avoid overlap
                lowerBound = Mathf.Min(lowerBound, upperBound);
                upperBound = Mathf.Min(lowerBound, upperBound);
            }

            var index = Mathf.Clamp(CenterIndex.GetLastKeyValue(entry.Last()),
                                    lowerBound, upperBound);

            var minIndex = Mathf.Max(index - beforeWidth, 0);
            var maxIndex = Mathf.Min(index + afterWidth, entriesCount - 1);

            //var i = 0;
            //foreach ( var entry in entries )
            //{
            //    if ( i < minIndex )
            //    UnSelectedList.
            //}

            bool selectedListOnly = SelectedListOnly.GetValue(entry);

            int currentIndex = 0;

            if (selectedListOnly)
            {
                foreach (var subEntry in EntryField.GetEntries(entry))
                {
                    if (currentIndex > maxIndex)
                    {
                        break;
                    }
                    if (currentIndex >= minIndex)
                    {
                        SelectedList.Add(subEntry.Last());
                    }
                    currentIndex++;
                }
            }
            else
            {
                foreach (var subEntry in EntryField.GetEntries(entry))
                {
                    if (currentIndex < minIndex || currentIndex > maxIndex)
                    {
                        UnSelectedList.Add(subEntry.Last());
                    }
                    else
                    {
                        SelectedList.Add(subEntry.Last());
                    }

                    currentIndex++;
                }
            }
        }