private Umbraco6xItem(string sID, Umbraco6xAPI umbracoAPI, ConverterOptions Options) { _umbracoAPI = umbracoAPI; _Options = Options; // XmlNode node = umbracoAPI._umbracoWebService.GetDocumentValidate(0, umbracoAPI._credentials.UserName, umbracoAPI._credentials.Password); // node = umbracoAPI._umbracoWebService.GetDocument(0, ""); int iID = 0; if (!string.IsNullOrEmpty(sID)) { iID = Util.StringGuid2Int(sID); } // Special handling of root item if (iID == 0) { documentCarrier[] docCarrierList = _umbracoAPI._umbracoDocumentApi.readList(iID, umbracoAPI._credentials.UserName, umbracoAPI._credentials.Password); iID = docCarrierList[0].Id; } _docCarrier = _umbracoAPI._umbracoDocumentApi.read(iID, umbracoAPI._credentials.UserName, umbracoAPI._credentials.Password); _Fields = new Umbraco6xField[_docCarrier.DocumentProperties.Length]; int t = 0; foreach (documentProperty docprop in _docCarrier.DocumentProperties) { string sDocProp = docprop.PropertyValue as string; if (sDocProp != null) { sDocProp.Split(','); } else { int iDocProp = (docprop.PropertyValue as Nullable <int>).GetValueOrDefault(-1); // _umbracoAPI._umbracoWebService.Credentials = new NetworkCredential(umbracoAPI._credentials.UserName, umbracoAPI._credentials.Password); // XmlNode node = _umbracoAPI._umbracoWebService.GetDocument(iDocProp, ""); // documentCarrier fieldCarrier = _umbracoAPI._umbracoDocumentApi.read(iDocProp, umbracoAPI._credentials.UserName, umbracoAPI._credentials.Password); } _Fields[t++] = new Umbraco6xField(docprop.Key, docprop.PropertyValue.ToString()); } _iID = _docCarrier.Id; _sName = _docCarrier.Name; }
public static Umbraco6xItem GetRoot(Umbraco6xAPI umbracoAPI, ConverterOptions Options) { return(new Umbraco6xItem(null, umbracoAPI, Options)); }