Esempio n. 1
0
        private void GetVectorComponents()
        {
            //Получаем целые числа в интервале от 1 до p^m-2
            for (var i = 1; i <= (int)Math.Pow(Basis, _m) - 1; i++)
            {
                InitialList.Add(i);
            }

            //Оставляем только те, у которых НОД(2^m-1) = 1
            foreach (var number in InitialList)
            {
                if (MathHelpers.GetNod((int)Math.Pow(Basis, _m) - 1, number) == 1)
                {
                    FilteredList.Add(number);
                }
            }

            //Выполняем прореживание по p-сопряженным элементам
            Vector = PConjugateThinning(FilteredList);

            //Переводим все значения r в p-ичную запись
            PBasisVector = GetPBasisList(Vector, Basis);

            //Применяем функцию g(r) ко всем компонентам вектора
            GofRVector = GetGofRVector(PBasisVector);
        }
        async Task SearchCommandExecute()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try {
                FilteredList.Clear();
                var tempRecords = students.Where(s => s.ToString().ToUpper().Contains(SearchedText.ToUpper()));
                foreach (var item in tempRecords)
                {
                    FilteredList.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
Esempio n. 3
0
 private void Filter()
 {
     itemList.Clear();
     if (selectedName == null || selectedName.Equals("Alle"))
     {
         foreach (Item i in itemListWithoutDeleted)
         {
             itemList.Add(i);
         }
     }
     else
     {
         foreach (Item i in itemListWithoutDeleted)
         {
             if (i.Group.Name.Equals(selectedName))
             {
                 FilteredList.Add(i);
             }
         }
         itemList.Clear();
         foreach (Item it in FilteredList)
         {
             itemList.Add(it);
         }
         filteredList.Clear();
     }
 }
Esempio n. 4
0
 public ColorableClass Add(ColorableClass node)
 {
     if (!NodesToNotify.Contains(node))
     {
         NodesToNotify.Add(node);
     }
     return(node);
 }
Esempio n. 5
0
        //  public ConnectionPoint{}



        public GraphConnection AddConection(GraphConnection connection)
        {
            if (connection != null)
            {
                Connections.Add(connection);
            }
            return(connection);
        }
Esempio n. 6
0
        public OutPoint AddOutConnection()
        {
            var outConn = new OutPoint(this);

            Output.Add(outConn);
            outConn.Name = Name + " Outpoint" + Output.Count.ToString(CultureInfo.InvariantCulture);
            return(outConn);
        }
        /// <summary>
        /// This method applies the filter value.
        /// </summary>
        protected void OnFilterInput()
        {
            //start with a new list
            if (FilteredList == null)
            {
                FilteredList = new List <T>();
            }
            else
            {
                FilteredList?.Clear();
            }

            //used when there are more than one filter values
            List <T> removeList = new List <T>();

            bool firstFilter = false;

            //for each filter input
            foreach (KeyValuePair <string, string> entry in FilterDictionary)
            {
                if (!string.IsNullOrWhiteSpace(entry.Value))
                {
                    if (!firstFilter)   //get all the matches for the first filter value
                    {
                        foreach (T item in OriginalList)
                        {
                            string columnValue = typeof(T).GetProperty(entry.Key)?.GetValue(item).AsString().Trim();
                            if (columnValue.Contains(entry.Value, StringComparison.CurrentCultureIgnoreCase))
                            {
                                FilteredList.Add(item);
                            }
                        }
                        firstFilter = FilteredList.Count > 0;
                    }
                    else
                    {
                        foreach (T item in FilteredList)    //for subsequent filter value build a list of items that do not match
                        {
                            string columnValue = typeof(T).GetProperty(entry.Key)?.GetValue(item).AsString().Trim();
                            if (!columnValue.Contains(entry.Value, StringComparison.CurrentCultureIgnoreCase))
                            {
                                removeList.Add(item);
                            }
                        }
                    }
                }
            }

            //remove the items that do not match the filters
            FilteredList = FilteredList.Except(removeList).ToList();

            //set the FilterActive flag
            FilterActive = FilteredList.Count > 0;

            SetPageCount(FilteredList);

            GetPage("first");
        }
Esempio n. 8
0
 public InPoint AddInConnection(InPoint inConn = null)
 {
     if (inConn == null)
     {
         inConn = new InPoint(this);
     }
     Input.Add(inConn);
     return(inConn);
 }
Esempio n. 9
0
 private void DeleteData(StockEntryViewModel selection)
 {
     FilteredSaleitems.Remove(selection);
     Saleitems.Remove(selection);
     FilteredList.Clear();
     FilteredList.Add(showAll);
     foreach (var item in Saleitems)
     {
         FilteredList.Add(item.Name);
     }
 }
Esempio n. 10
0
 private void Search()
 {
     foreach (Item i in itemListWithoutDeleted)
     {
         if (i.Name.Contains(searchText))
         {
             FilteredList.Add(i);
         }
     }
     itemList.Clear();
     foreach (Item it in FilteredList)
     {
         itemList.Add(it);
     }
     filteredList.Clear();
 }
Esempio n. 11
0
        public void BrowseForSource()
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.InitialDirectory = Source;
            dialog.Title            = "Please select your osu! executable.";
            dialog.Filter           = "osu! launcher (osu!.exe)|osu!.exe";
            DialogResult result = dialog.ShowDialog();

            if (result.ToString() == "OK")
            {
                Source   = dialog.FileName.Replace("osu!.exe", "");
                FileList = OsuSong.ParseAll(Source);
                FilteredList.Clear();
                foreach (OsuSong file in FileList)
                {
                    FilteredList.Add(file);
                }
                StreamWriter sw = new StreamWriter("path.dat", false, Encoding.Unicode);
                sw.Write(Source + "?" + Destination);
                sw.Close();
            }
        }
Esempio n. 12
0
        private void DoFilterStdList()
        {
            if (this.PreFilteredList.Count > 0)
            {
                this.PreFilteredList.Clear();
            }
            if (this.Slist.Count > 0)
            {
                switch (this.FilterCategory)
                {
                case "none":
                    this.PreFilteredList = this.Slist;
                    break;

                case "male":
                    var stdlst = from std in this.Slist
                                 where std.Sex == "M"
                                 select std;
                    foreach (Student item in stdlst)
                    {
                        this.PreFilteredList.Add(item);
                    }
                    break;

                case "female":
                    var stdlst2 = from std in this.Slist
                                  where std.Sex == "F"
                                  select std;
                    foreach (Student item in stdlst2)
                    {
                        this.PreFilteredList.Add(item);
                    }
                    break;

                default:
                    break;
                }

                if ((SchoolClasses[ClsIndex] == "XI" || SchoolClasses[ClsIndex] == "XII") && HsSubIndex != -1)
                {
                    if (this.FilteredList.Count > 0)
                    {
                        this.FilteredList.Clear();
                    }
                    if (PreFilteredList.Count > 0)
                    {
                        var stdList3 = from std in PreFilteredList
                                       where std.HsSub1 == HsActiveSubs[HsSubIndex] || std.HsSub2 == HsActiveSubs[HsSubIndex] || std.HsSub3 == HsActiveSubs[HsSubIndex] || std.HsAdlSub == HsActiveSubs[HsSubIndex]
                                       select std;

                        FilteredList.Clear();
                        foreach (Student item in stdList3)
                        {
                            FilteredList.Add(item);
                        }
                    }
                }
                else
                {
                    if (this.FilteredList.Count > 0)
                    {
                        this.FilteredList.Clear();
                    }
                    if (PreFilteredList.Count > 0)
                    {
                        foreach (var item in PreFilteredList)
                        {
                            FilteredList.Add(item);
                        }
                    }
                }
            }
        }