コード例 #1
0
ファイル: MetaSelectionSet.cs プロジェクト: voidALPHA/cgc_viz
        public IEnumerator SelectOnly(IEnumerable <VisualPayload> payloads)
        {
            IEnumerator iterator;

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

            foreach (var payload in payloads)
            {
                UnSelectedList.Remove(payload);
                SelectedList.Add(payload);

                payload.VisualData.Bound.ClearBounds();

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

            iterator = SendUnselected();
            while (iterator.MoveNext())
            {
                yield return(null);
            }

            iterator = TransmitMultiStates();
            while (iterator.MoveNext())
            {
                yield return(null);
            }
        }
コード例 #2
0
        private void SendTest_Click(object sender, RoutedEventArgs e)
        {
            String Author = AuthorTextBox.Text.Trim(' ');
            String Name   = TestNameTextBox.Text.Trim(' ');

            if (SelectedList.Count < 1 || Author == "" || Name == "")
            {
                System.Windows.Forms.MessageBox.Show("The test request is not complete yet, please verify");
                return;
            }
            if (testRequestNames.Contains(Name))
            {
                System.Windows.Forms.MessageBox.Show("A Request with the same name is already executed, please choose a unique name.");
                return;
            }
            TestStatusText.Text += "Copying files to send \n";
            GetFilesToSendingDirectory();


            List <String> dlls = new List <string>();

            foreach (var item in SelectedList)
            {
                dlls.Add(item.Name);
            }
            PostTestRequest(Name, Author, dlls);
            SelectedList.Clear();
            testRequestNames.Add(Name);
        }
コード例 #3
0
        protected void bttnLeftAll_Click(object sender, EventArgs e)
        {
            try
            {
                UnSelectedList.AddRange(SelectedList);
                SelectedList.Clear();

                bindData();
            }
            catch (Exception ex)
            {
                Messages.ShowError("当前操作出错!<br />详细信息:" + ex.Message);
            }
        }
コード例 #4
0
        public void DeSelectFile_Click(object sender, EventArgs e)
        {
            List <FileItem> temp = new List <FileItem>();

            foreach (FileItem item in SelectedList)
            {
                temp.Add(item);
            }
            foreach (FileItem item in SelectedFilesListBox.SelectedItems)
            {
                temp.Remove(item);
            }
            SelectedList.Clear();
            temp.ForEach((item) => { SelectedList.Add(item); });
        }
コード例 #5
0
ファイル: MetaSelectionSet.cs プロジェクト: voidALPHA/cgc_viz
        public IEnumerator DeselectAll()
        {
            IEnumerator iterator;

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

            iterator = SendNoneSelected();
            while (iterator.MoveNext())
            {
                yield return(null);
            }

            iterator = TransmitMultiStates();
            while (iterator.MoveNext())
            {
                yield return(null);
            }
        }
コード例 #6
0
        private void SendTest_Click(object sender, RoutedEventArgs e)
        {
            ResultPlaceHolder.Visibility = Visibility.Collapsed;
            ResultGrid.Visibility        = Visibility.Visible;
            String Author = AuthorTextBox.Text.Trim(' ');
            String Name   = TestNameTextBox.Text.Trim(' ');

            if (SelectedList.Count < 1 || Author == "" || Name == "")
            {
                System.Windows.Forms.MessageBox.Show("Please make sure you have filled all the details");
                return;
            }
            if (testRequestNames.Contains(Name))
            {
                System.Windows.Forms.MessageBox.Show("A Request with the same name is already executed, please choose a unique name.");
                return;
            }
            TabItem tabItem = new TabItem();

            tabItem.Header = Name;
            TestResult testResult = new TestResult("", "");

            ResultList.Add(Name, testResult);
            ResultsTabControl.Items.Add(tabItem);
            ResultsTabControl.SelectedItem = tabItem;
            testResult.Status = "\n\nProcessing\n\n";
            currentTestResult = testResult;
            CurrentStatus     = currentTestResult.Status;
            GetFilesToSendingDirectory();

            List <String> dlls = new List <string>();

            foreach (var item in SelectedList)
            {
                dlls.Add(item.Name);
            }
            PostTestRequest(Name, Author, dlls);
            SelectedList.Clear();
            testRequestNames.Add(Name);
        }
コード例 #7
0
        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++;
                }
            }
        }