Some c# questions

  • Автор темы Автор темы lokiys
  • Дата начала Дата начала

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 922
Реакции
1 206
Баллы
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
 
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
 
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);
 
1) if (tab.IsBusy) tab.WaitDownloading(); use less resources than tab.WaitDownloading();
2) Not the same
This method http://help.zennolab.com/en/v5/zenn...dCenter.Instance~WaitFieldEmulationDelay.html
stands for this timeout in Browser - Emulation delay action


32cd9-clip-26kb.png


EmulationLevel stands for speed of typing
 
  • Спасибо
Реакции: lokiys
@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 ?
 
It's just fixed timeout. You can put it anywhere you want)
 
  • Спасибо
Реакции: lokiys

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