本文整理汇总了C#中DynValue.IsNotNil方法的典型用法代码示例。如果您正苦于以下问题:C# DynValue.IsNotNil方法的具体用法?C# DynValue.IsNotNil怎么用?C# DynValue.IsNotNil使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynValue
的用法示例。
在下文中一共展示了DynValue.IsNotNil方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateEntry
public cZipArchiveEntry CreateEntry(string name, DynValue compression)
{
if (compression.IsNotNil())
return new cZipArchiveEntry(zip.CreateEntry(name, compression.ToObject<CompressionLevel>()));
else
return new cZipArchiveEntry(zip.CreateEntry(name));
}
示例2: GetDownloadUrls
public cVideoInfo[] GetDownloadUrls(string url, DynValue _decrypt)
{
IEnumerable<VideoInfo> col = DownloadUrlResolver.GetDownloadUrls(url, (_decrypt.IsNotNil()) ? _decrypt.Boolean : true);
List<cVideoInfo> ncol = new List<cVideoInfo>();
for (int i = 0; i < col.Count(); i++)
ncol.Add(new cVideoInfo(col.ElementAt(i)));
return ncol.ToArray();
}
示例3: ParseConstraint
public static Constraint ParseConstraint(DynValue findBy, DynValue _s1, DynValue _s2)
{
string s1 = _s1.String;
string s2 = (_s2.IsNotNil()) ? _s2.String : "";
switch (findBy.ToObject<FindBy>())
{
case FindBy.AltText:
return Find.ByAlt(s1);
case FindBy.Any:
return Find.Any;
case FindBy.Attribute:
return Find.By(s1, s2);
case FindBy.Class:
return Find.ByClass(s1, false);
case FindBy.Default:
return Find.ByDefault(s1);
case FindBy.First:
return Find.First();
case FindBy.For:
return Find.ByFor(s1);
case FindBy.Id:
return Find.ById(s1);
case FindBy.Index:
return Find.ByIndex(Convert.ToInt32(s1));
case FindBy.Label:
return Find.ByLabelText(s1);
case FindBy.Name:
return Find.ByName(s1);
case FindBy.Near:
return Find.Near(s1);
case FindBy.Selector:
return Find.BySelector(s1);
case FindBy.Source:
return Find.BySrc(s1);
case FindBy.Style:
return Find.ByStyle(s1, s2);
case FindBy.Text:
return Find.ByText(s1);
case FindBy.TextInColumn:
return Find.ByTextInColumn(s1, Convert.ToInt32(s2));
case FindBy.Title:
return Find.ByTitle(s1);
case FindBy.Url:
return Find.ByUrl(s1);
case FindBy.Value:
return Find.ByValue(s1);
}
return Find.None;
}
示例4: FindTextField
public virtual cTextField FindTextField(DynValue findBy, DynValue s1, DynValue s2)
{
if (s1.IsNotNil())
return new cTextField(obj.TextField(Helpers.ParseConstraint(findBy, s1, s2)));
else
return new cTextField(obj.TextField(findBy.String));
}
示例5: DownloadVideo
public void DownloadVideo(string filepath, DynValue callback)
{
Decrypt();
VideoDownloader downloader = new VideoDownloader(obj, filepath);
if (callback.IsNotNil())
downloader.DownloadFinished += (sender, args) => Program.Call(callback, obj);
downloader.Execute();
}
示例6: FindTableCell
public virtual cTableCell FindTableCell(DynValue findBy, DynValue s1, DynValue s2)
{
if (s1.IsNotNil())
{
if ((findBy.Type == DataType.String) && (s1.Type == DataType.Number))
return new cTableCell(obj.TableCell(Find.ById(findBy.String) && Find.ByIndex(Convert.ToInt32(s1.Number))));
else
return new cTableCell(obj.TableCell(Helpers.ParseConstraint(findBy, s1, s2)));
}
else
return new cTableCell(obj.TableCell(findBy.String));
}
示例7: FindTableRow
public virtual cTableRow FindTableRow(DynValue findBy, DynValue s1, DynValue s2)
{
if (s1.IsNotNil())
return new cTableRow(obj.TableRow(Helpers.ParseConstraint(findBy, s1, s2)));
else
return new cTableRow(obj.TableRow(findBy.String));
}
示例8: FindParagraph
public virtual cPara FindParagraph(DynValue findBy, DynValue s1, DynValue s2)
{
if (s1.IsNotNil())
return new cPara(obj.Para(Helpers.ParseConstraint(findBy, s1, s2)));
else
return new cPara(obj.Para(findBy.String));
}
示例9: FindSpan
public virtual cSpan FindSpan(DynValue findBy, DynValue s1, DynValue s2)
{
if (s1.IsNotNil())
return new cSpan(obj.Span(Helpers.ParseConstraint(findBy, s1, s2)));
else
return new cSpan(obj.Span(findBy.String));
}
示例10: FindImage
public virtual cImage FindImage(DynValue findBy, DynValue s1, DynValue s2)
{
if (s1.IsNotNil())
return new cImage(obj.Image(Helpers.ParseConstraint(findBy, s1, s2)));
else
return new cImage(obj.Image(findBy.String));
}
示例11: FindListItem
public virtual cListItem FindListItem(DynValue findBy, DynValue s1, DynValue s2)
{
if (s1.IsNotNil())
return new cListItem(obj.ListItem(Helpers.ParseConstraint(findBy, s1, s2)));
else
return new cListItem(obj.ListItem(findBy.String));
}
示例12: FindFileUpload
public virtual cFileUpload FindFileUpload(DynValue findBy, DynValue s1, DynValue s2)
{
if (s1.IsNotNil())
return new cFileUpload(obj.FileUpload(Helpers.ParseConstraint(findBy, s1, s2)));
else
return new cFileUpload(obj.FileUpload(findBy.String));
}
示例13: FindElement
public virtual DynValue FindElement(DynValue findBy, DynValue s1, DynValue s2)
{
if (s1.IsNotNil())
return Helpers.ParseElement(obj.Element(Helpers.ParseConstraint(findBy, s1, s2)));
else
return Helpers.ParseElement(obj.Element(findBy.String));
}
示例14: FindDiv
public virtual cDiv FindDiv(DynValue findBy, DynValue s1, DynValue s2)
{
if (s1.IsNotNil())
return new cDiv(obj.Div(Helpers.ParseConstraint(findBy, s1, s2)));
else
return new cDiv(obj.Div(findBy.String));
}
示例15: FindCheckBox
public virtual cCheckBox FindCheckBox(DynValue findBy, DynValue s1, DynValue s2)
{
if (s1.IsNotNil())
return new cCheckBox(obj.CheckBox(Helpers.ParseConstraint(findBy, s1, s2)));
else
return new cCheckBox(obj.CheckBox(findBy.String));
}