public ScenarionBrowser(BrowserMode mode, ScenarioDepot scenario, IBranch initialSelection, IBranch formulaBeingEdited) { InitializeComponent(); Mode = mode; Text = mode == BrowserMode.SelectNode ? Resources.ScenarionBrowser_SelectNode : Resources.ScenarionBrowser_SelectBranch; Scenario = scenario; InitialSelection = initialSelection; FormulaBeingEdited = formulaBeingEdited; foreach (ScenarioNode root in Scenario) { LoadBranch(root, null); } var allNodes = treeScenario.Nodes.Cast<TreeNode>() .SelectMany(tn => tn.Flatten(n => n.Nodes.Cast<TreeNode>())); treeScenario.SelectedNode = allNodes.FirstOrDefault(n => n.Tag == initialSelection); tabControlBranchOptions.Visible = false; _emptySelectionTipRtb.Visible = true; splitContainer1.Panel2.Padding = new Padding(5, 5, 5, 5); ResyncOkAvailability(); }
/// <summary> /// Sets the UI controls visibility with respect to the given parameter mode. /// </summary> private void SetBrowserMode(BrowserMode mode) { if (mode == BrowserMode.Launch) { SetLaunchControlsVisibility(true); SetConnectControlsVisibility(false); } else if (mode == BrowserMode.Connect) { SetLaunchControlsVisibility(false); SetConnectControlsVisibility(true); } }
public void draw(BrowserMode _mode, DirectoryInfo startingPath,string[] _acceptedExtensions) { state = BrowserState.Processing; gameObject.SetActive(true); if (_mode == BrowserMode.FolderSelect) gameObject.transform.Find("Panel").Find("EnterName").gameObject.SetActive(true); else gameObject.transform.Find("Panel").Find("EnterName").gameObject.SetActive(false); mode = _mode; currentDirectory = startingPath; acceptedExtensions = _acceptedExtensions; fillList(); }
public void Open(Menu p_previousMenu, string p_startPath = "", string p_defaultSaveName = "", params string[] p_extensions) { Setup(); if (m_canvas == null) { Debug.LogError("This file browser has no canvas parent!"); return; } if (m_uiPrefab == null) { Debug.LogError("Please assign the UI prefab to this file browser!"); return; } if (p_previousMenu) { m_menu.m_previousMenu = p_previousMenu; } GameObject uiObject = Instantiate(m_uiPrefab, transform, false); m_ui = uiObject.GetComponent <FileBrowserUI>(); if (m_ui == null) { Debug.LogError("The UI Prefab does not have the FileBrowserUI component!"); Destroy(uiObject); return; } if (p_defaultSaveName.Length > 0) { m_mode = BrowserMode.SAVE; } else { m_mode = BrowserMode.LOAD; } m_extensions = p_extensions; m_ui.Setup(this, m_mode); SetupPath(p_startPath); LoadViewer(); if (m_mode == BrowserMode.SAVE) { m_ui.UpdateFileName(p_defaultSaveName + "." + m_extensions[0]); } MenuHandler.Instance.OpenMenu(m_menu); }
private static ChromeOptions GetChromeOptions(BrowserMode browserMode) { ChromeOptions options = new ChromeOptions(); options.AddArguments("--window-size=1920,1080"); options.AddArguments("disable-infobars"); options.AddArguments("--ignore-certificate-errors"); if (browserMode == BrowserMode.Headless) { options.AddArguments("--headless"); } return(options); }
public void draw(BrowserMode _mode, DirectoryInfo startingPath, string[] _acceptedExtensions) { state = BrowserState.Processing; gameObject.SetActive(true); if (_mode == BrowserMode.FolderSelect) { gameObject.transform.Find("Panel").Find("EnterName").gameObject.SetActive(true); } else { gameObject.transform.Find("Panel").Find("EnterName").gameObject.SetActive(false); } mode = _mode; currentDirectory = startingPath; acceptedExtensions = _acceptedExtensions; fillList(); }
public static void SetBrowserMode(BrowserMode mode) { InferenceEngine.DefaultEngine.Compiler.BrowserMode = mode; }
public void ParseDeviceInfo(NameValueCollection deviceInfo, NameValueCollection browserCaps) { m_rawDeviceInfo = deviceInfo; string text = deviceInfo["HTMLFragment"]; if (string.IsNullOrEmpty(text)) { text = deviceInfo["MHTMLFragment"]; } if (!string.IsNullOrEmpty(text)) { HTMLFragment = ParseBool(text, defaultValue: false); } object obj = browserCaps[BrowserDetectionUtility.TypeKey]; if (obj != null && ((string)obj).StartsWith("Netscape", StringComparison.OrdinalIgnoreCase)) { IsBrowserIE = false; } if (HTMLFragment) { string text2 = deviceInfo["PrefixId"]; if (!string.IsNullOrEmpty(text2)) { VerifySafeForJavascript(text2); HtmlPrefixId = text2; StylePrefixId = (JavascriptPrefixId = "A" + Guid.NewGuid().ToString().Replace("-", "")); } } text = deviceInfo["BookmarkId"]; if (!string.IsNullOrEmpty(text)) { BookmarkId = text; } text = deviceInfo["JavaScript"]; if (!string.IsNullOrEmpty(text)) { AllowScript = ParseBool(text, defaultValue: true); } if (AllowScript) { text = browserCaps[BrowserDetectionUtility.JavaScriptKey]; if (!string.IsNullOrEmpty(text)) { AllowScript = ParseBool(text, defaultValue: true); } if (AllowScript) { text = deviceInfo["ActionScript"]; if (!string.IsNullOrEmpty(text)) { VerifySafeForJavascript(text); ActionScript = text; HasActionScript = true; } } } string text3 = deviceInfo["UserAgent"]; if (text3 == null && browserCaps != null) { text3 = browserCaps["UserAgent"]; } if (text3 != null && text3.Contains("MSIE 6.0")) { IsBrowserIE6 = true; } if (text3 != null && text3.Contains("MSIE 7.0")) { IsBrowserIE7 = true; } IsBrowserGeckoEngine = BrowserDetectionUtility.IsGeckoBrowserEngine(text3); if (IsBrowserGeckoEngine) { IsBrowserIE = false; } else if (BrowserDetectionUtility.IsSafari(text3) || BrowserDetectionUtility.IsChrome(text3)) { IsBrowserSafari = true; IsBrowserIE = false; } text = deviceInfo["ExpandContent"]; if (!string.IsNullOrEmpty(text)) { ExpandContent = ParseBool(text, defaultValue: false); } text = deviceInfo["EnablePowerBIFeatures"]; if (!string.IsNullOrEmpty(text)) { EnablePowerBIFeatures = ParseBool(text, defaultValue: false); } text = deviceInfo["Section"]; if (!string.IsNullOrEmpty(text)) { Section = ParseInt(text, 0); } text = deviceInfo["FindString"]; if (!string.IsNullOrEmpty(text) && text.LastIndexOfAny(HTML4Renderer.m_standardLineBreak.ToCharArray()) < 0) { FindString = text.ToUpperInvariant(); } text = deviceInfo["LinkTarget"]; if (!string.IsNullOrEmpty(text)) { VerifySafeForJavascript(text); LinkTarget = text; } text = deviceInfo["OutlookCompat"]; if (!string.IsNullOrEmpty(text)) { OutlookCompat = ParseBool(text, defaultValue: false); } text = deviceInfo["AccessibleTablix"]; if (!string.IsNullOrEmpty(text)) { AccessibleTablix = ParseBool(text, defaultValue: false); } text = deviceInfo["StyleStream"]; if (!string.IsNullOrEmpty(text)) { StyleStream = ParseBool(text, defaultValue: false); } OnlyVisibleStyles = !StyleStream; text = deviceInfo["OnlyVisibleStyles"]; if (!string.IsNullOrEmpty(text)) { OnlyVisibleStyles = ParseBool(text, OnlyVisibleStyles); } text = deviceInfo["ResourceStreamRoot"]; if (!string.IsNullOrEmpty(text)) { VerifySafeForRoots(text); ResourceStreamRoot = text; } text = deviceInfo["StreamRoot"]; if (!string.IsNullOrEmpty(text)) { VerifySafeForRoots(text); } if (IsBrowserIE) { text = deviceInfo["Zoom"]; if (!string.IsNullOrEmpty(text)) { Zoom = ParseInt(text, 100); } } text = deviceInfo["ReplacementRoot"]; if (!string.IsNullOrEmpty(text)) { VerifySafeForRoots(text); ReplacementRoot = text; } text = deviceInfo["ImageConsolidation"]; if (!string.IsNullOrEmpty(text)) { ImageConsolidation = ParseBool(text, ImageConsolidation); } text = deviceInfo["BrowserMode"]; if (!string.IsNullOrEmpty(text)) { if (string.Compare(text, BrowserMode_Quirks, StringComparison.OrdinalIgnoreCase) == 0) { BrowserMode = BrowserMode.Quirks; } else if (string.Compare(text, BrowserMode_Standards, StringComparison.OrdinalIgnoreCase) == 0) { BrowserMode = BrowserMode.Standards; if (IsBrowserIE && text3 != null && (IsBrowserIE7 || IsBrowserIE6)) { IsBrowserIE6Or7StandardsMode = true; } } } if (IsBrowserIE && ImageConsolidation && string.IsNullOrEmpty(deviceInfo["ImageConsolidation"]) && IsBrowserIE6) { ImageConsolidation = false; } if (!AllowScript) { ImageConsolidation = false; } text = deviceInfo["DataVisualizationFitSizing"]; if (!string.IsNullOrEmpty(text) && string.Compare(text, "Approximate", StringComparison.OrdinalIgnoreCase) == 0) { DataVisualizationFitSizing = DataVisualizationFitSizing.Approximate; } }
public static RemoteWebDriver GetDriver(BrowserMode mode) { ChromeDriverService service = ChromeDriverService.CreateDefaultService(Settings.DriverPath); return(new ChromeDriver(service, GetChromeOptions(mode))); }
/// <summary> /// Initializes a new instance of the <see cref="BrowserModeAttribute"/> class. /// Note that the value passed to the PropertyAttribute base class must be a /// 1. string /// 2. int /// 3. double /// The base class can only support these PRIMITIVE types /// </summary> /// <param name="mode">The mode.</param> public BrowserModeAttribute(BrowserMode mode = BrowserMode.Reuse) : base(SeleniumCoreSettings.BrowserModeKey, mode.ToString()) { }
public ScenarionBrowser(BrowserMode mode, ScenarioDepot scenario, IBranch initialSelection) : this(mode, scenario, initialSelection, null) { }