public Models.ShapeSheetWriter GetWriterForPage(TargetPage targetpage) { targetpage = targetpage.Resolve(this._client); var writer = new Models.ShapeSheetWriter(this._client, targetpage.Page); return(writer); }
public List <VA.DocumentAnalysis.ConnectorEdge> GetDirectedEdgesOnPage(TargetPage targetpage, VA.DocumentAnalysis.ConnectionAnalyzerOptions flag) { targetpage = targetpage.ResolveToPage(this._client); var directed_edges = VA.DocumentAnalysis.ConnectionAnalyzer.GetDirectedEdges(targetpage.Page, flag); return(directed_edges); }
public List <IVisio.Shape> GetShapesOnPage(TargetPage targetpage) { targetpage = targetpage.ResolveToPage(this._client); var shapes = targetpage.Page.Shapes.ToList(); return(shapes); }
private void SetCurTargetPage() { if (curTarget == null) { curTarget = new TargetPage(); } int texNums = textures.Count; float floor = Mathf.Floor(curPageNumber); float frac = curPageNumber - floor; curTarget.pageAngle = frac; System.Func <int, int, int> mod = ( (x, c) => { while (x < 0) { x += c; } return(x % c); } ); curTarget.baseTex = textures [mod((int)floor + 0, texNums)]; curTarget.nextTex = textures [mod((int)floor + 1, texNums)]; }
public IVisio.Layer FindLayersOnPageByName(TargetPage targetpage, string name) { targetpage = targetpage.Resolve(this._client); if (name == null) { throw new System.ArgumentNullException(nameof(name)); } if (name.Length < 1) { throw new System.ArgumentException("Layer name cannot be empty", nameof(name)); } IVisio.Layer layer = null; try { this._client.Output.WriteVerbose("Trying to find layer named \"{0}\"", name); var layers = targetpage.Page.Layers; layer = layers.ItemU[name]; } catch (System.Runtime.InteropServices.COMException) { string msg = string.Format("No layer with name \"{0}\"", name); throw new VisioAutomation.Exceptions.VisioOperationException(msg); } return(layer); }
public Models.ShapeSheetReader GetReaderForPage(TargetPage targetpage) { targetpage = targetpage.ResolveToPage(this._client); var reader = new Models.ShapeSheetReader(this._client, targetpage.Page); return(reader); }
public IVisio.Shape DropMaster(TargetPage targetpage, IVisio.Master master, VisioAutomation.Geometry.Point p) { targetpage = targetpage.ResolveToPage(this._client); var shape = targetpage.Page.Drop(master, p.X, p.Y); return(shape); }
public static void Main(string[] args) { //FirefoxProfile profile = new FirefoxProfile(); //profile.AddExtension(@"..\..\Extensions\adblock_firefox.xpi"); //FirefoxDriver driver = new FirefoxDriver(profile); ChromeOptions options = new ChromeOptions(); options.AddExtension(@"..\..\Extensions\adblock_chrome.crx"); ChromeDriver driver = new ChromeDriver(options); driver.Manage().Window.Maximize(); driver.Url = @"http://www.findazip.com/"; NavigationPage nav = new NavigationPage(driver); nav.citiesWithV.Click(); TargetPage target = new TargetPage(driver); var cities = target.Cities; ContentPage content = new ContentPage(driver); var citiesURLs = new List <string>(); for (int i = 0; i < 3; i++) { citiesURLs.Add(cities[i].GetAttribute("href")); } var citiesForClick = new List <CityInfo>(); foreach (var citiesUrL in citiesURLs) { driver.Url = citiesUrL; citiesForClick.Add(new CityInfo(content.Name.Text, content.State.Text, content.Zip.Text, content.Longitude.Text, content.Latidude.Text)); } driver.Url = @"https://www.google.bg/maps/"; GooglePage google = new GooglePage(driver); foreach (var cityInfo in citiesForClick) { //google.Search.Clear(); //google.Search.SendKeys($"{cityInfo.Latitude}, {cityInfo.Longitude}"); //google.Search.SendKeys(Keys.Enter); driver.Url = $"https://www.google.bg/maps/@{cityInfo.Latitude},{cityInfo.Longitude},15z"; Thread.Sleep(5000); var screenshot = ((ITakesScreenshot)driver).GetScreenshot(); screenshot.SaveAsFile($"{cityInfo.Name}-{cityInfo.State}-{cityInfo.Zip}.jpg", ScreenshotImageFormat.Jpeg); } }
private void OnClick(object sender, EventArgs e) { var page = new TargetPage(); //page.SliderValueChanged += OnSliderValueChanged; MessagingCenter.Subscribe <TargetPage, double>(this, Events.SliderValueChanged, OnSliderValueChanged); Navigation.PushAsync(page); MessagingCenter.Unsubscribe <MainPage>(this, Events.SliderValueChanged); }
public void SelectShapesByMaster(TargetPage targetpage, IVisio.Master master) { targetpage = targetpage.ResolveToPage(this._client); // Get a selection of connectors, by master: var selection = targetpage.Page.CreateSelection( IVisio.VisSelectionTypes.visSelTypeByMaster, IVisio.VisSelectMode.visSelModeSkipSub, master); }
public void ExportPageToImage(TargetPage targetpage, string filename) { if (filename == null) { throw new System.ArgumentNullException(nameof(filename)); } targetpage = targetpage.ResolveToPage(this._client); targetpage.Page.Export(filename); }
public IVisio.Shape DropContainerMaster(TargetPage targetpage, IVisio.Master master) { targetpage = targetpage.ResolveToPage(this._client); var page = targetpage.Page; var app = page.Application; var window = app.ActiveWindow; var selection = window.Selection; var shape = page.DropContainer(master, selection); return(shape); }
public PayPalAd(TargetPage placement) { string dimensionsConfigName = string.Format("PayPal.Ads.{0}PageDimensions", placement); string displayConfigName = string.Format("PayPal.Ads.ShowOn{0}Page", placement); string dimensionsConfig = AppLogic.AppConfig(dimensionsConfigName); string publisherId = AppLogic.AppConfig("PayPal.Ads.PublisherId"); Show = AppLogic.AppConfigBool(displayConfigName) && AppLogic.AppConfigBool("PayPal.Ads.TermsAndConditionsAgreement"); ImageDimensions = String.IsNullOrEmpty(dimensionsConfig) ? string.Empty : dimensionsConfig; ImageScript = !String.IsNullOrEmpty(dimensionsConfig) && ImageDimensions.Length > 0 ? GetAdScript(ImageDimensions, publisherId, dimensionsConfig) : string.Empty; }
public List <IVisio.Shape> GetShapesOnPageByID(TargetPage targetpage, int[] shapeids) { targetpage = targetpage.ResolveToPage(this._client); var shapes = targetpage.Page.Shapes; var shapes_list = new List <IVisio.Shape>(shapeids.Length); foreach (int id in shapeids) { var shape = shapes.ItemFromID[id]; shapes_list.Add(shape); } return(shapes_list); }
public void NavigateToPage(TargetPage page) { switch (page) { case TargetPage.Home: _frame.Navigate(typeof(HomePage)); break; case TargetPage.RecentlyAdded: _frame.Navigate(typeof(RecentlyAddedPage)); break; case TargetPage.MyPhotos: _frame.Navigate(typeof(MyPhotosPage)); break; } }
public void SetPageSize(TargetPage targetpage, double?width, double?height) { if (!width.HasValue && !height.HasValue) { // nothing to do return; } var page = this._client.Page.GetActivePage(); var targetpages = new VisioScripting.TargetPages(page); var old_size = this.GetPageSize(targetpages); var w = width.GetValueOrDefault(old_size.Width); var h = height.GetValueOrDefault(old_size.Height); var new_size = new VisioAutomation.Geometry.Size(w, h); this.SetPageSize(new TargetPages(targetpage.Page), new_size); }
public List <IVisio.Shape> GetShapesOnPageByName(TargetPage targetpage, string[] names) { targetpage = targetpage.ResolveToPage(this._client); var cached_shapes_list = targetpage.Page.Shapes.ToList(); if (names.Contains("*")) { // if any of the shape names contains a simple wildcard then return all the shapes return(cached_shapes_list); } // otherwise we start checking for each name var shapes_list = VisioScripting.Helpers.WildcardHelper.FilterObjectsByNames(cached_shapes_list, names, s => s.Name, true, VisioScripting.Helpers.WildcardHelper.FilterAction.Include).ToList(); return(shapes_list); }
public void SetPageSize(TargetPage targetpage, double?width, double?height) { if (!width.HasValue && !height.HasValue) { // nothing to do return; } targetpage = targetpage.ResolveToPage(this._client); var old_size = VisioAutomation.Pages.PageHelper.GetSize(targetpage.Page); var w = width.GetValueOrDefault(old_size.Width); var h = height.GetValueOrDefault(old_size.Height); var new_size = new VisioAutomation.Geometry.Size(w, h); this.SetPageSize(new TargetPages(targetpage.Page), new_size); }
public IVisio.Page DuplicatePage(TargetPage targetpage) { targetpage = targetpage.ResolveToPage(this._client); using (var undoscope = this._client.Undo.NewUndoScope(nameof(DuplicatePage))) { var src_page = targetpage.Page; var doc = src_page.Document; var pages = doc.Pages; var new_page = pages.Add(); var app = doc.Application; var win = app.ActiveWindow; win.Page = src_page; VisioAutomation.Pages.PageHelper.Duplicate(src_page, new_page); win.Page = new_page; return(new_page); } }
public IVisio.Shape DropContainer(TargetPage targetpage, string master) { targetpage = targetpage.ResolveToPage(this._client); var page = targetpage.Page; var app = page.Application; var window = app.ActiveWindow; var selection = window.Selection; var docs = app.Documents; var stencil_type = IVisio.VisBuiltInStencilTypes.visBuiltInStencilContainers; var measurement_system = IVisio.VisMeasurementSystem.visMSUS; var containers_file = app.GetBuiltInStencilFile(stencil_type, measurement_system); var containers_doc = docs.OpenStencil(containers_file); var masters = containers_doc.Masters; var container_master = masters.ItemU[master]; var shape = page.DropContainer(container_master, selection); return(shape); }
private void SetCurTargetPage() { if (curTarget == null) curTarget = new TargetPage(); int texNums = textures.Count; float floor = Mathf.Floor (curPageNumber); float frac = curPageNumber - floor; curTarget.pageAngle = frac; System.Func<int,int,int> mod = ( (x, c) => { while (x < 0) x+= c; return x % c; } ); curTarget.baseTex = textures [mod ((int)floor + 0, texNums)]; curTarget.nextTex = textures [mod ((int)floor + 1, texNums)]; }
public List <IVisio.Shape> GetShapesByName(TargetPage targetpage, string[] shapenames, bool ignore_bad_names) { targetpage = targetpage.Resolve(this._client); var shapes = targetpage.Page.Shapes; var cached_shapes_list = new List <IVisio.Shape>(shapes.Count); cached_shapes_list.AddRange(shapes.ToEnumerable()); if (shapenames.Contains("*")) { // if any of the shape names contains a simple wildcard then return all the shapes return(cached_shapes_list); } // otherwise we start checking for each name var shapes_list = VisioScripting.Helpers.WildcardHelper.FilterObjectsByNames(cached_shapes_list, shapenames, s => s.Name, true, VisioScripting.Helpers.WildcardHelper.FilterAction.Include).ToList(); return(shapes_list); }
public IVisio.Page DuplicatePageToDocument(TargetPage targetpage, IVisio.Document dest_doc) { targetpage = targetpage.ResolveToPage(this._client); if (dest_doc == null) { throw new System.ArgumentNullException(nameof(dest_doc)); } if (targetpage.Page.Document == dest_doc) { throw new VisioAutomation.Exceptions.VisioOperationException("dest doc is same as pages src doc"); } var dest_pages = dest_doc.Pages; var dest_page = dest_pages.Add(); VisioAutomation.Pages.PageHelper.Duplicate(targetpage.Page, dest_page); return(dest_page); }
public short[] DropMasters( TargetPage targetpage, IList <IVisio.Master> masters, IList <VisioAutomation.Geometry.Point> points) { targetpage = targetpage.ResolveToPage(this._client); if (masters == null) { throw new System.ArgumentNullException(nameof(points)); } if (points == null) { throw new System.ArgumentNullException(nameof(points)); } var page = targetpage.Page; var shapeids = page.DropManyU(masters, points); return(shapeids); }
public void SelectShapesByLayer(TargetPage targetpage, string layername) { if (layername == null) { throw new System.ArgumentNullException(nameof(layername), "Layer name cannot be null"); } if (layername.Length < 1) { throw new System.ArgumentOutOfRangeException(nameof(layername), "Layer name cannot be empty"); } targetpage = targetpage.ResolveToPage(this._client); var layer = this._client.Layer.FindLayersOnPageByName(targetpage, layername); // Get a selection of connectors, by layer: var selection = targetpage.Page.CreateSelection( IVisio.VisSelectionTypes.visSelTypeByLayer, IVisio.VisSelectMode.visSelModeSkipSub, layer); }
public PayPalAd(TargetPage placement) { var displayConfigName = string.Format("PayPal.Ads.ShowOn{0}Page", placement); var enabled = AppLogic.AppConfigBool(displayConfigName) && AppLogic.AppConfigBool("PayPal.Ads.TermsAndConditionsAgreement"); if (!enabled) { return; } var dimensionsConfigName = string.Format("PayPal.Ads.{0}PageDimensions", placement); var dimensionsConfig = AppLogic.AppConfig(dimensionsConfigName); var publisherId = AppLogic.AppConfig("PayPal.Ads.PublisherId"); var clientScriptRegistry = DependencyResolver.Current.GetService <IClientScriptRegistry>(); ImageDimensions = string.IsNullOrEmpty(dimensionsConfig) ? string.Empty : dimensionsConfig; ImageMarkup = !string.IsNullOrEmpty(dimensionsConfig) && ImageDimensions.Length > 0 ? GetAdMarkup(clientScriptRegistry, ImageDimensions, publisherId, dimensionsConfig) : string.Empty; }
private void OnSliderValueChanged(TargetPage source, double newValue) { label.Text = newValue.ToString(); }
public List <IVisio.Shape> GetShapesByName(TargetPage targetpage, string[] shapenames) { targetpage = targetpage.Resolve(this._client); return(this.GetShapesByName(targetpage, shapenames, false)); }
public Models.PageOrientation GetPageOrientation(TargetPage targetpage) { targetpage = targetpage.ResolveToPage(this._client); return(PageCommands._get_page_orientation(targetpage.Page)); }
public MenuItemClickedEventArgs(TargetPage targetPage) { TargetPage = targetPage; }
public List <IVisio.Layer> GetLayersOnPage(TargetPage targetpage) { targetpage = targetpage.Resolve(this._client); return(targetpage.Page.Layers.ToList()); }