Thank you
@LaGir! You are right, I should have looked for "
FileSystem" into the webframe docs. Now I know what to look for.
I am trying to move all my code to CC so I can do a better debugging but even if my code worked "out of the box" in OwnCode, I run into some basic problems. I'm still having trouble understanding how the CC works.
What I have understood so far is that I have one main Program.cs that executes functions created in ActionGroup1,2,3 ... like this:
executionResult = ActionGroup1.Execute(instance, project);
And inside the ActionGroupX.cs files I have to create my functions using the
instance and
project as arguments:
using System;
using System.Data;
using System.Text;
using System.Linq;
using System.Drawing;
using System.Resources;
using System.ComponentModel;
using System.Collections.Generic;
using ZennoLab.CommandCenter;
using ZennoLab.InterfacesLibrary.ProjectModel;
using ZennoLab.InterfacesLibrary.ProjectModel.Enums;
using ZennoLab.Emulation;
namespace myProject
{
internal class ActionGroup1
{
public static int myCustomFunction(int myCustomVar, Instance instance, IZennoPosterProjectModel project)
{
Tab tab = instance.MainTab;
Document doc = tab.MainDocument;
HtmlElementCollection heCol = doc.FindElementsByAttribute("div", "class", "myClass", "text");
int count = heCol.Count;
return 0;
}
}
}
And run them like this
executionResult = ActionGroup1.myCustomFunction(10, instance, project);
The problem is that I cannot retrieve the html elements correctly, meaning that the
count variable returns 0 even if that div class element exists and previously returned the correct value. I also checked the
doc variable and has the right value (the current document html)
HtmlElement he = tab.FindElementByAttribute("div", "class", "myClass", "text", 0)
doesn't return anything also even if when I check the
tab I can see the correct html inside.
I think it has something to do with
instance and
project but don't know what should I do next.