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.organizationType FindDefaultOrg(string org_default, adlcp_rootv1p2.imscp.organizationsType orgs) { adlcp_rootv1p2.imscp.organizationType org_empty = new adlcp_rootv1p2.imscp.organizationType(); foreach (var org in orgs.Myorganizations) { if (org.identifier.ToString() == org_default) { return(org); } } return(org_empty); }
public organizationEnumerator(organizationsType par) { parent = par; nIndex = -1; }
public default2Enumerator(organizationsType par) { parent = par; nIndex = -1; }
public void ReplaceorganizationsAt(organizationsType newValue, int index) { ReplaceDomElementAt("http://www.imsproject.org/xsd/imscp_rootv1p1p2", "organizations", index, newValue); }
public void Addorganizations(organizationsType newValue) { AppendDomElement("http://www.imsproject.org/xsd/imscp_rootv1p1p2", "organizations", newValue); }