Some c# questions

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 184
Баллы
113
I have two questions:

1. Why there is needed if (tab.IsBusy) ? Because there is even not possible any other way, if tab is not busy then tab downloading does not happen anyway.
C#:
if (tab.IsBusy) tab.WaitDownloading();
2. When we have to use. Because in assembly in some snippets it is used but in similar are not.
C#:
instance.WaitFieldEmulationDelay();
Thanks
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
1) We wait whild red state of instance become green with this code
2) It's a call to timeout which is used in Browser - Emulation delay action
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 184
Баллы
113
1) We wait whild red state of instance become green with this code
2) It's a call to timeout which is used in Browser - Emulation delay action
Okay I will be more detailed.

1. Can you tell me difference of:

if (tab.IsBusy) tab.WaitDownloading(); and tab.WaitDownloading();

2. Is this used like this ?

C#:
// find element by attribute
    HtmlElement he = doc.FindElementByAttribute("input:checkbox", "fulltag", "input:checkbox", "text", 0);
    if (he.IsVoid) return -1;
    // set value
    he.SetValue("true", true);
instance.WaitFieldEmulationDelay();
And this will be that same as this code ?

C#:
// find element by attribute
    HtmlElement he = doc.FindElementByAttribute("input:checkbox", "fulltag", "input:checkbox", "text", 0);
    if (he.IsVoid) return -1;
    // set value
    he.SetValue("gagag", instance.EmulationLevel, true);
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
  • Спасибо
Реакции: lokiys

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 184
Баллы
113
@rostonix I just checked some things in code creator and I can see there:

C#:
// Emulation delay
            instance.WaitFieldEmulationDelay();
            // Call the event "click"
            he.RiseEvent("click", instance.EmulationLevel);
            // Wait for page loading
            if (tab.IsBusy) tab.WaitDownloading();
Is that mean it is right when you call instance.WaitFieldEmulationDelay(); before Rise, Get or Set ?
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
It's just fixed timeout. You can put it anywhere you want)
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 184
Баллы
113

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
  • Спасибо
Реакции: lokiys

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 184
Баллы
113

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)