コード例 #1
0
ファイル: Umbraco6xItem.cs プロジェクト: Cabana/CMSConverter
        private Umbraco6xItem(Umbraco6xItem parent, 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 (parent != null)
                iID = int.Parse(parent.ID.ToString());

            documentCarrier[] docCarrierList = _umbracoAPI._umbracoDocumentApi.readList(iID, umbracoAPI._credentials.UserName, umbracoAPI._credentials.Password);
            documentCarrier docCarrier = _umbracoAPI._umbracoDocumentApi.read(1105, umbracoAPI._credentials.UserName, umbracoAPI._credentials.Password);
            _sName = docCarrier.Name;
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: Cabana/CMSConverter
        private void ConnectUmbraco6x(TreeView treeView, string sServerUrl, string sSiteType)
        {
            LoginForm login = new LoginForm();
            login.SiteUrl = sServerUrl;
            login.SiteType = sSiteType;
            login.Username = "******";
            if (login.ShowDialog(this) == DialogResult.Cancel)
                return;

            Credentials credentials = new Credentials();
            credentials.UserName = login.loginControl1.Username;
            credentials.Password = login.loginControl1.Password;

            Umbraco6xItem item = null;
            try
            {
                Umbraco6xAPI umbracoAPI = new Umbraco6xAPI(sServerUrl, credentials);
                item = Umbraco6xItem.GetRoot(umbracoAPI, new ConverterOptions());
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error logging into site, wrong username or password?\nError message: " + ex.Message);
                return;
            }
            item.Options.LoginName = credentials.UserName;
            item.Options.LoginPassword = credentials.Password;
            item.Options.HostName = sServerUrl;

            treeView.Nodes.Clear();
            TreeNode newNode = new TreeNode(item.Name);
            newNode.Tag = item;
            treeView.Nodes.Add(newNode);
            treeView.SelectedNode = newNode;
        }
コード例 #3
0
ファイル: Umbraco6xItem.cs プロジェクト: Cabana/CMSConverter
 public static Umbraco6xItem GetRoot(Umbraco6xAPI umbracoAPI, ConverterOptions Options)
 {
     return new Umbraco6xItem(null, umbracoAPI, Options);
 }