mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Improved the support for dragging and dropping images from a website, now also parsing HTML img src information, to be able to download that image. For this we need the HtmlAgilityPack.dll (#294)
Removed a lot of dead code, and remove the old OCR code as we don't even know if it still works.
This commit is contained in:
parent
90cab1e8a3
commit
26fe579d31
151 changed files with 1138 additions and 8174 deletions
|
@ -91,35 +91,7 @@ namespace GreenshotPlugin.Core {
|
|||
}
|
||||
}
|
||||
|
||||
public void ActivateIETab(string tabCaptionToActivate) {
|
||||
foreach (Accessible accessor in Children) {
|
||||
foreach (var child in accessor.Children) {
|
||||
foreach (var tab in child.Children) {
|
||||
if (tab.Name == tabCaptionToActivate) {
|
||||
tab.Activate();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void CloseIETab(string tabCaptionToClose) {
|
||||
foreach (Accessible accessor in Children) {
|
||||
foreach (var child in accessor.Children) {
|
||||
foreach (var tab in child.Children) {
|
||||
if (tab.Name == tabCaptionToClose) {
|
||||
foreach (var CloseTab in tab.Children) {
|
||||
CloseTab.Activate();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ActivateIETab(int tabIndexToActivate) {
|
||||
public void ActivateIETab(int tabIndexToActivate) {
|
||||
var index = 0;
|
||||
foreach (Accessible accessor in Children) {
|
||||
foreach (var child in accessor.Children) {
|
||||
|
@ -138,50 +110,7 @@ namespace GreenshotPlugin.Core {
|
|||
}
|
||||
}
|
||||
|
||||
public string IEActiveTabUrl {
|
||||
get {
|
||||
foreach (Accessible accessor in Children) {
|
||||
foreach (var child in accessor.Children) {
|
||||
foreach (var tab in child.Children) {
|
||||
object tabIndex = tab.accessible.get_accState(CHILDID_SELF);
|
||||
|
||||
if ((int)tabIndex == IE_ACTIVE_TAB) {
|
||||
var description = tab.accessible.get_accDescription(CHILDID_SELF);
|
||||
|
||||
if (!string.IsNullOrEmpty(description)) {
|
||||
if (description.Contains(Environment.NewLine)) {
|
||||
var url = description.Substring(description.IndexOf(Environment.NewLine)).Trim();
|
||||
return url;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public int IEActiveTabIndex {
|
||||
get {
|
||||
var index = 0;
|
||||
foreach (Accessible accessor in Children) {
|
||||
foreach (var child in accessor.Children) {
|
||||
foreach (var tab in child.Children) {
|
||||
object tabIndex = tab.accessible.get_accState(0);
|
||||
|
||||
if ((int)tabIndex == IE_ACTIVE_TAB) {
|
||||
return index;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public string IEActiveTabCaption {
|
||||
public string IEActiveTabCaption {
|
||||
get {
|
||||
foreach (Accessible accessor in Children) {
|
||||
foreach (var child in accessor.Children) {
|
||||
|
@ -238,21 +167,8 @@ namespace GreenshotPlugin.Core {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int IETabCount {
|
||||
get {
|
||||
foreach (Accessible accessor in Children) {
|
||||
foreach (var child in accessor.Children) {
|
||||
foreach (var tab in child.Children) {
|
||||
return child.ChildCount - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
private Accessible(IAccessible acc) {
|
||||
private Accessible(IAccessible acc) {
|
||||
accessible = acc ?? throw new Exception();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue