Пример #1
0
        public void PerformSearch(DownloadSearchCriteria crit)
        {
            this.Cursor         = Cursors.Wait;
            TorrentSearchStatus = string.Format("Searching...");

            try
            {
                CurrentSearchCriteria = crit;
                this.IsEnabled        = false;

                if (crit.SearchType != DownloadSearchType.Manual)
                {
                    string desc = "";
                    foreach (string parm in crit.GetParms())
                    {
                        if (!string.IsNullOrEmpty(desc))
                        {
                            desc += " ";
                        }
                        desc += parm;
                    }
                    txtSearch.Text = desc;
                }

                SubGroups.Clear();
                TorrentLinks.Clear();
                ViewTorrentLinks.Refresh();

                searchWorker.RunWorkerAsync(crit);
            }
            catch (Exception ex)
            {
                Utils.ShowErrorMessage(ex);
            }
        }
Пример #2
0
        private void ShowSubGroupSuggestions(List <GroupVideoQualityVM> vidQualList)
        {
            SubGroups.Clear();
            Dictionary <string, GroupVideoQualityVM> vidQuals = new Dictionary <string, GroupVideoQualityVM>();

            foreach (GroupVideoQualityVM vidQual in vidQualList)
            {
                vidQuals[vidQual.GroupNameShort] = vidQual;
            }

            foreach (GroupVideoQualityVM vidq in vidQuals.Values)
            {
                if (vidq.GroupNameShort != "NO GROUP INFO")
                {
                    SubGroupSimple sub = new SubGroupSimple();
                    sub.GroupName      = vidq.GroupName;
                    sub.GroupNameShort = vidq.GroupNameShort;
                    SubGroups.Add(sub);
                }
            }
        }
Пример #3
0
        public override bool TryParse()
        {
            if (!base.TryParse())
            {
                return(false);
            }

            // sub-groups, flows, branches, bcs
            SubGroups.Clear();
            Flows.Clear();
            Branches.Clear();
            BusinessComponents.Clear();
            RecoverySteps.Clear();
            GeneralSteps.Clear();

            ReportNodeType[] childNodes = Node.ReportNode;
            if (childNodes != null)
            {
                foreach (ReportNodeType node in childNodes)
                {
                    // business component
                    BusinessComponentReport bc = BusinessComponents.TryParseAndAdd(node, this.Node);
                    if (bc != null)
                    {
                        AllBCsEnumerator.Add(bc);
                        continue;
                    }

                    // sub-group
                    GroupReport group = SubGroups.TryParseAndAdd(node, this.Node);
                    if (group != null)
                    {
                        AllBCsEnumerator.Merge(group.AllBCsEnumerator);
                        continue;
                    }

                    // flow
                    FlowReport flow = Flows.TryParseAndAdd(node, this.Node);
                    if (flow != null)
                    {
                        AllBCsEnumerator.Merge(flow.AllBCsEnumerator);
                        continue;
                    }

                    // branch
                    BranchReport branch = Branches.TryParseAndAdd(node, this.Node);
                    if (branch != null)
                    {
                        AllBCsEnumerator.Merge(branch.AllBCsEnumerator);
                        continue;
                    }

                    // recovery step
                    RecoveryStepReport recovery = RecoverySteps.TryParseAndAdd(node, this.Node);
                    if (recovery != null)
                    {
                        AllBCsEnumerator.Merge(recovery.AllBCsEnumerator);
                        continue;
                    }

                    // general step
                    GeneralStepReport generalStep = GeneralSteps.TryParseAndAdd(node, this.Node);
                    if (generalStep != null)
                    {
                        AllBCsEnumerator.Merge(generalStep.AllBCsEnumerator);
                        continue;
                    }
                }
            }

            return(true);
        }