private static bool Find(object[] parameters, Find findObject) { return (bool) findObject.GetType() .InvokeMember("Execute", BindingFlags.InvokeMethod, null, findObject, parameters); }
public DomFinder(string htmlText) { HtmlTreeBuilder treeBuilder = new HtmlTreeBuilder(); var domRoot = treeBuilder.BuildDomTree(htmlText, true); BindingFlags flags = BindingFlags.NonPublic | BindingFlags.Instance; _find = Activator.CreateInstance(typeof(Find), flags, null, new object[] { domRoot }, null) as Find; }
private static bool Execute(Find finder, ref int count) { try { var result = finder.Execute(Replace: WdReplace.wdReplaceOne); if (result) count++; return result; } catch (Exception ex) { // ¬ыводить пользователю или записывать в лог. Trace.WriteLine(ex.Message); return true; } }
public void TestDescendantsAndSelfQueryTree() { List<StringValue> values = new List<StringValue>() { new StringValue() { Data = "0" }, new StringValue() { Data = "1" }, new StringValue() { Data = "2" }, new StringValue() { Data = "3" } }; // Create a tree of values. We will want to flatten and find each value after. IDatabaseObject query = new Find() .Method( values[0] ) .Method( values[1] ) .Method( new Drop() .Field( values[2] .Method( new Save() .Field( values[3] ) ) ) ); List<StringValue> descendants = query.DescendantsAndSelf<StringValue>().ToList(); Assert.AreEqual(4, descendants.Count()); foreach (StringValue item in descendants) { Assert.IsTrue(values.Contains(item)); } }
public МоиЗаявкиПростоВОнлайнеPage(string url, Find find) : base(url, find) { }
public void HTMLDialogFindByTitle() { AssertHTMLDialog(Ie.HtmlDialog(Find.ByTitle("PopUpTest"))); }
public void HTMLDialogFindByUrl() { AssertHTMLDialog(Ie.HtmlDialog(Find.ByUrl(PopUpURI))); }
/// <summary> /// Initializes a new instance of the FeatherWidgetDesigner class. /// </summary> /// <param name="find">Find object for the current window.</param> public FeatherWidgetDesigner(Find find) : base(find) { }
public virtual uint GetCrittersSeeing(IList<Critter> critters, bool look_on_them, Find find_type, IList<Critter> critters_result) { if (critters == null) throw new ArgumentNullException ("critters"); return Map_GetCrittersSeeing(thisptr, critters, look_on_them, (int)find_type, critters_result); }
public ListOfCandidateCases1Page(string url, Find find) : base(url, find) { }
/// <summary> /// Initializes a new instance of the <see cref="MediaSelectorScreen" /> class. /// </summary> /// <param name="find">The find.</param> public MediaSelectorScreen(Find find) : base(find) { }
public CiscoSystemsIncPage(string url, Find find) : base(url, find) { }
public ZALOMUAComTrangMuaSắmPage(string url, Find find) : base(url, find) { }
private void FillAllRestaurantFieldsWith(Restaurant newRestaurant) { Find.Element(By.Id("Name")).SendKeys(newRestaurant.Name); Find.Element(By.Id("City")).SendKeys(newRestaurant.City); Find.Element(By.Id("Country")).SendKeys(newRestaurant.Country); }
public void AddRestaurant(Restaurant newRestaurant) { FillAllRestaurantFieldsWith(newRestaurant); Find.Element(By.Id("create_button")).Click(); }
/// <summary> /// Initializes a new instance of the <see cref="SocialShareWidgetEditScreen" /> class. /// </summary> /// <param name="find">The find.</param> public SocialShareWidgetEditScreen(Find find) : base(find) { }
public ПростоВОнлайнеPage(string url, Find find) : base(url, find) { }
public ТестСкорингаПоQIWI0Page(string url, Find find) : base(url, find) { }
public FramePegaGadget1Ifr0Frame(Find find) : base(find) { }
public PhụKiệnMáyTínhPage(string url, Find find) : base(url, find) { }
public ItemDetails0Page(string url, Find find) : base(url, find) { }
public LCDBenq17InchChínhHãngPage(string url, Find find) : base(url, find) { }
public FramePegaGadget0IfrFrame(Find find) : base(find) { }
public SảnPhẩmĐãChọnMuaPage(string url, Find find) : base(url, find) { }
/// <summary> /// Initializes a new instance of the <see cref="FormsMap" /> class. /// </summary> public FormsMap(Find find) { this.find = find; }
public ĐồngHồNamĐẹpPhongCáchPage(string url, Find find) : base(url, find) { }
public virtual uint GetCrittersHex(ushort hx, ushort hy, uint radius, Find find_type, IList<Critter> critters) { return Map_GetCritters(thisptr, hx, hy, radius, (int)find_type, critters); }
/// <summary> /// Initializes a new instance of the <see cref="NavigationWidgetEditScreen" /> class. /// </summary> /// <param name="find">The find.</param> public NavigationWidgetEditScreen(Find find) : base(find) { }
public FeedWidgetFrontend(Find find) : base(find) { }
/// <summary> /// Initializes a new instance of the <see cref="ContentBlockWidgetScreen" /> class. /// </summary> /// <param name="find">The find.</param> public ContentBlockWidgetScreen(Find find) : base(find) { }
public void HTMLDialogFindByTitleAndWithTimeout() { AssertHTMLDialog(Ie.HtmlDialog(Find.ByTitle("PopUpTest"), 10)); }
public AddReportDivFrame(Find find) : base(find) { }
public ĐồngHồThôngMinhPage(string url, Find find) : base(url, find) { }
public void HTMLDialogFindByUrlAndWithTimeout() { AssertHTMLDialog(Ie.HtmlDialog(Find.ByUrl(PopUpURI), 10)); }
/// <summary> /// Initializes a new instance of the <see cref="ContentBlockLinkSelectorScreen" /> class. /// </summary> /// <param name="find">The find.</param> public ContentBlockLinkSelectorScreen(Find find) : base(find) { }
public SảnPhẩmĐãĐặtMuaSauKhiPage(string url, Find find) : base(url, find) { }
public x1397736662531TextFrame(Find find) : base(find) { }
public BuildPricePage(string url, Find find) : base(url, find) { }
public ItemMiddleTableCellFrame(Find find) : base(find) { }
public static string DragDropScriptInitialization(ContentItem item) { return(string.Format(@"window.n2ddcp = new n2DragDrop({{ copy:'{0}/Resources/Js/copy.n2.ashx', move:'{0}/Resources/Js/move.n2.ashx', remove:'{0}/Resources/Js/remove.n2.ashx', create:'{0}/Resources/Js/create.n2.ashx', editsingle:'{0}/Content/EditSingle.aspx'}}, {{}},{{versionIndex:{1}, isMasterVersion:{2}, pagePath: '{3}'}});", Url.ResolveTokens("{ManagementUrl}"), item.VersionIndex, !item.VersionOf.HasValue ? "true" : "false", Find.ClosestPage(item).Path)); }
public PerformScheduleReporting0Page(string url, Find find) : base(url, find) { }
public void ElementParentReturningTypedParent() { var tableCell = Ie.TableCell(Find.ByText("Contains text in DIV")); Assert.IsInstanceOf(typeof(TableRow), tableCell.Parent); }
public WelcomeToPegaRULESPage(string url, Find find) : base(url, find) { }
public void ElementCollectionExistsShouldNeverThrowInvalidAttributeException() { ExecuteTest(browser => Assert.IsTrue(browser.Elements.Exists(Find.ByFor("Checkbox21")))); }
public Mycandidatereports4Page(string url, Find find) : base(url, find) { }
public void WhenIClickTheButton(string value) { WebBrowser.Current.Button(Find.ByValue(value)).Click(); }
public PegaDesignerStudio0Page(string url, Find find) : base(url, find) { this._ownerBrowser = find.AssociatedBrowser; }
public void GivenIHaveEnteredValueInTheIdTextbox(string value, string id) { WebBrowser.Current.TextField(Find.ById(id)).TypeText(value); }
/// <summary> /// Initializes a new instance of the <see cref="UsersListFrontend" /> class. /// </summary> /// <param name="find">The find.</param> public UsersListFrontend(Find find) : base(find) { }
protected override void OnInit(EventArgs e) { var selected = Selection.SelectedItem; if (IsPostBack && !string.IsNullOrEmpty(inputFile.PostedFile.FileName)) { string uploadFolder = Request["inputLocation"]; if (!IsAvailable(uploadFolder)) { throw new N2Exception("Cannot upload to " + Server.HtmlEncode(uploadFolder)); } string fileName = System.IO.Path.GetFileName(inputFile.PostedFile.FileName); string filePath = Url.Combine(uploadFolder, fileName); FS.WriteFile(filePath, inputFile.PostedFile.InputStream); ClientScript.RegisterStartupScript(typeof(Tree), "select", "updateOpenerWithUrlAndClose('" + ResolveUrl(filePath) + "');", true); } else if (Request["location"] == "files" || Request["location"] == "filesselection") { IHost host = Engine.Resolve <IHost>(); HierarchyNode <ContentItem> root = new HierarchyNode <ContentItem>(Engine.Persister.Get(host.DefaultSite.RootItemID)); var selectionTrail = new List <ContentItem>(); if (selected is AbstractNode) { selectionTrail = new List <ContentItem>(Find.EnumerateParents(selected, null, true)); } else { TrySelectingPrevious(ref selected, ref selectionTrail); } foreach (string uploadFolder in Engine.EditManager.UploadFolders) { var dd = FS.GetDirectory(uploadFolder); var dir = new Directory(dd, root.Current); dir.Set(FS); var node = CreateDirectoryNode(FS, dir, root, selectionTrail); root.Children.Add(node); } AddSiteFilesNodes(root, host.DefaultSite, selectionTrail); foreach (var site in host.Sites) { AddSiteFilesNodes(root, site, selectionTrail); } siteTreeView.Nodes = root; siteTreeView.SelectedItem = selected; } else { var filter = Engine.EditManager.GetEditorFilter(Page.User); siteTreeView.Filter = filter; siteTreeView.RootNode = Engine.Resolve <Navigator>().Navigate(Request["root"] ?? "/"); siteTreeView.SelectedItem = selected; } siteTreeView.DataBind(); base.OnInit(e); }
/// <summary> /// Initializes a new instance of the <see cref="EmailCampaignsMap" /> class. /// </summary> /// <param name="find">The find.</param> public EmailCampaignsMap(Find find) { this.find = find; }
public void IfControllerDoesNotInheritFromARSmartDispatcherController_ShouldStillGetValidationSummary() { ie.GoTo("http://localhost:88/MR296/edit.castle"); ie.Button(Find.ByValue("Save")).Click(); Assert.IsTrue(ie.ContainsText("HasValidationErrors")); }
public virtual uint GetCritters(ushort pid, Find find_type, IList<Critter> critters = null) { return Map_GetCrittersByPids(thisptr, pid, (int)find_type, critters); }
private void buttonFind_Click(object sender, System.EventArgs e) { listBoxSearchResult.Items.Clear(); listBoxSearchResult.Visible = false; Find find = null; Column searchColumn = _searchTable.TableInfo.Columns[comboBoxSearchColumn.SelectedItem.ToString()]; if (_refiningTable != null && _refiningTable.IsOpen) { if (comboBoxRefiningColumn.Items.Count > 0) { Column refiningColumn = _refiningTable.TableInfo.Columns[comboBoxRefiningColumn.SelectedItem.ToString()]; find = new Find(_searchTable, searchColumn, _refiningTable, refiningColumn); } else { MessageBox.Show(String.Format("No indexed columns in " + _refiningTable + ".")); return; } } else { find = new Find(_searchTable, searchColumn); } if (checkBoxUseCloseMatches.Checked) { find.UseCloseMatches = true; find.CloseMatchesMax = int.Parse(textBoxMaxCloseMatches.Text); } if (checkBoxAddressNumAfterStreet.Checked) { find.AddressNumberAfterStreet = true; } // Do the actual search. if (_refiningTable != null && _refiningTable.IsOpen) { if (_bSearchIntersection) { _result = find.SearchIntersection(textBoxSearchString.Text, textBoxIntersection.Text, textBoxRefiningString.Text); } else { _result = find.Search(textBoxSearchString.Text, textBoxRefiningString.Text); } } else { if (_bSearchIntersection) { _result = find.SearchIntersection(textBoxSearchString.Text, textBoxIntersection.Text); } else { _result = find.Search(textBoxSearchString.Text); } } // display label that tells us when multiple matches were found labelMultipleMatchesFound.Visible = _result.MultipleMatches; if (_result.ExactMatch && _result.NameResultCode.Equals(FindNameCode.ExactMatch) && _result.FoundPoint != null) { labelSearchResult.Text = "Exact Match"; showPointOnSearchTableMap(_result.FoundPoint.X, _result.FoundPoint.Y); } else if (_result.NameResultCode.Equals(FindNameCode.ExactMatch) && _result.AddressResultCode.Equals(FindAddressCode.AddressNumNotSpecified)) { labelSearchResult.Text = _result.AddressResultCode.ToString(); FindAddressRangeEnumerator _enum = _result.GetAddressRangeEnumerator(); FindAddressRange _findAddressRange; listBoxSearchResult.Visible = true; while (_enum.MoveNext()) { _findAddressRange = _enum.Current; listBoxSearchResult.Items.Add( String.Format("Address range: [{0} - {1}]", _findAddressRange.BeginRange, _findAddressRange.EndRange)); } } else if (_result.NameResultCode.Equals(FindNameCode.ExactMatch) && _result.MultipleMatches) { labelSearchResult.Text = _result.NameResultCode.ToString(); listBoxSearchResult.Visible = true; FindCloseMatchEnumerator enumerator = _result.GetCloseMatchEnumerator(); while (enumerator.MoveNext()) { listBoxSearchResult.Items.Add(enumerator.Current.Name); } } else { labelSearchResult.Text = _result.NameResultCode.ToString(); if (find.UseCloseMatches) { listBoxSearchResult.Visible = true; FindCloseMatchEnumerator enumerator = _result.GetCloseMatchEnumerator(); while (enumerator.MoveNext()) { listBoxSearchResult.Items.Add(enumerator.Current.Name); } } } find.Dispose(); }
public virtual uint GetCrittersInPath(ushort from_hx, ushort from_hy, ushort to_hx, ushort to_hy, float angle, uint dist, Find find_type, IList<Critter> critters, out ushort pre_block_hx, out ushort pre_block_hy, out ushort block_hx, out ushort block_hy) { return Map_GetCrittersInPathBlock(thisptr, from_hx, from_hy, to_hx, to_hy, angle, dist, (int)find_type, critters, out pre_block_hx, out pre_block_hy, out block_hx, out block_hy); }
/// <summary> /// Selects the option. /// </summary> /// <param name="element">The element.</param> /// <param name="name">The name.</param> /// <param name="value">The value.</param> public static void SelectOption(this IElementContainer element, string name, string value) { element.SelectList(Find.ByName(name)).SelectByValue(value); }
public virtual uint GetCrittersWhoViewPath(ushort from_hx, ushort from_hy, ushort to_hx, ushort to_hy, float angle, uint dist, Find find_type, IList<Critter> critters) { return Map_GetCrittersWhoViewPath(thisptr, from_hx, from_hy, to_hx, to_hy, angle, dist, (int)find_type, critters); }
/// <summary> /// Sets the text. /// </summary> /// <param name="element">The element.</param> /// <param name="name">The name.</param> /// <param name="value">The value.</param> public static void SetText(this IElementContainer element, string name, string value) { element.TextField(Find.ByName(name)).Value = value; }
/// <summary> /// Initializes a new instance of the <see cref="CommentsAndReviewsMap" /> class. /// </summary> /// <param name="find">The find.</param> public CommentsAndReviewsMap(Find find) { this.find = find; }
public void HTMLDialogGettingWithNegativeTimeoutNotAllowed() { Ie.HtmlDialog(Find.ByUrl(PopUpURI), -1); }