private string FindDefaultWebPage(adlcp_rootv1p2.imscp.manifestType root) { if (root.Hasorganizations()) { adlcp_rootv1p2.imscp.organizationsType orgs = root.Getorganizations(); if (orgs.Hasorganization()) // its possible but fatal to have a blank "organizations" node { string org_default = ""; if (orgs.Hasdefault2()) { org_default = orgs.default2.ToString(); var org = FindDefaultOrg(org_default, orgs); string identifier1 = ""; if (org.Hasidentifier()) { identifier1 = org.Getidentifier().ToString(); } if (org.Hastitle()) { title = org.Gettitle().ToString(); } if (org.Hasitem()) { int i = org.GetitemCount(); if (i > 0) { adlcp_itemType item = org.GetitemAt(0); adlcp_rootv1p2.imscp.identifierrefType2 item_identifier = item.identifierref; // // find the resource for this item // adlcp_rootv1p2.imscp.resourceType resource = FindDefaultResource(item_identifier, root.resources); if (resource.Hashref()) { href = resource.href.ToString(); return(href); } } } } } } // end of "organizations" object return(""); }
private adlcp_rootv1p2.imscp.resourceType FindDefaultResource(identifierrefType2 item_identifier, adlcp_rootv1p2.imscp.resourcesType resources) { adlcp_rootv1p2.imscp.resourceType rs_empty = new adlcp_rootv1p2.imscp.resourceType(); for (int ii = 0; ii < resources.resourceCount; ii++) { adlcp_rootv1p2.imscp.resourceType rs = resources.GetresourceAt(ii); string identifier = ""; if (rs.Hasidentifier()) { identifier = rs.identifier.ToString(); } if (identifier == item_identifier.ToString()) { return(rs); } } return(rs_empty); }
public hrefEnumerator(resourceType par) { parent = par; nIndex = -1; }
public metadataEnumerator(resourceType par) { parent = par; nIndex = -1; }
public base2Enumerator(resourceType par) { parent = par; nIndex = -1; }
public identifierEnumerator(resourceType par) { parent = par; nIndex = -1; }
public dependencyEnumerator(resourceType par) { parent = par; nIndex = -1; }
public void ReplaceresourceAt(resourceType newValue, int index) { ReplaceDomElementAt("http://www.imsproject.org/xsd/imscp_rootv1p1p2", "resource", index, newValue); }
public void Addresource(resourceType newValue) { AppendDomElement("http://www.imsproject.org/xsd/imscp_rootv1p1p2", "resource", newValue); }