/// <summary>
        /// </summary>
        private void Worker()
        {
            // configure view web service
            List <CustXMLView>  lstViews  = new List <CustXMLView>();
            List <CustXMLField> lstFields = new List <CustXMLField>();

            Exception retErr = null;

            try
            {
                SPWSViews.Views proxyViews = new SPCAMLQueryHelperOnline.SPWSViews.Views();

                if (parentForm.formChooser.appMode == Chooser.AppMode.UseWSDef)
                {
                    proxyViews.UseDefaultCredentials = true;
                }
                else if (parentForm.formChooser.appMode == Chooser.AppMode.UseWSCreds)
                {
                    proxyViews.UseDefaultCredentials = false;
                    proxyViews.Credentials           = new System.Net.NetworkCredential(parentForm.formChooser.credUsername, parentForm.formChooser.credPassword, parentForm.formChooser.credDomain);
                }
                else if (parentForm.formChooser.appMode == Chooser.AppMode.UseWSOffice365)
                {
                    proxyViews.CookieContainer = SharedStuff.GetAuthCookies(new Uri(url), parentForm.formChooser.credUsername, parentForm.formChooser.credPassword);
                }

                proxyViews.Url = GenUtil.CombineUrls(url, XMLConsts.AsmxSuffix_Views);

                // configure list web service
                SPWSLists.Lists proxyLists = new SPCAMLQueryHelperOnline.SPWSLists.Lists();

                if (parentForm.formChooser.appMode == Chooser.AppMode.UseWSDef)
                {
                    proxyLists.UseDefaultCredentials = true;
                }
                else if (parentForm.formChooser.appMode == Chooser.AppMode.UseWSCreds)
                {
                    proxyLists.UseDefaultCredentials = false;
                    proxyLists.Credentials           = new System.Net.NetworkCredential(parentForm.formChooser.credUsername, parentForm.formChooser.credPassword, parentForm.formChooser.credDomain);
                }
                else if (parentForm.formChooser.appMode == Chooser.AppMode.UseWSOffice365)
                {
                    proxyLists.CookieContainer = SharedStuff.GetAuthCookies(new Uri(url), parentForm.formChooser.credUsername, parentForm.formChooser.credPassword);
                }

                proxyLists.Url = GenUtil.CombineUrls(url, XMLConsts.AsmxSuffix_Lists);

                // get list views
                XElement xViews = proxyViews.GetViewCollection(listName).GetXElement();

                foreach (XElement xView in xViews.Elements(XMLConsts.s + "View"))
                {
                    lstViews.Add(new CustXMLView()
                    {
                        DefaultView = GenUtil.SafeToBool(GenUtil.GetXElemAttrAsString(xView, "DefaultView")),
                        DisplayName = GenUtil.GetXElemAttrAsString(xView, "DisplayName"),
                        Name        = GenUtil.GetXElemAttrAsString(xView, "Name"),
                        Url         = GenUtil.GetXElemAttrAsString(xView, "Url")
                    });
                }

                // get list fields
                XElement xList = proxyLists.GetList(listName).GetXElement();

                foreach (XElement xField in xList.Descendants(XMLConsts.s + "Field"))
                {
                    CustXMLField cXmlField = new CustXMLField();

                    cXmlField.DisplayName = GenUtil.GetXElemAttrAsString(xField, "DisplayName");
                    cXmlField.ID          = GenUtil.GetXElemAttrAsString(xField, "ID");
                    cXmlField.Name        = GenUtil.GetXElemAttrAsString(xField, "Name");
                    cXmlField.Required    = GenUtil.SafeToBool(GenUtil.GetXElemAttrAsString(xField, "Required"));
                    cXmlField.Type        = GenUtil.GetXElemAttrAsString(xField, "Type");

                    if (!GenUtil.IsNull(cXmlField.ID))
                    {
                        lstFields.Add(cXmlField);
                    }
                }
            }
            catch (Exception ex)
            {
                retErr = ex;
            }



            // update gui
            parentForm.Invoke(new MethodInvoker(() =>
            {
                ddlListViews.Items.Clear();
                tvFields.Nodes.Clear();
                btnOpenListDetails.Visible = false;


                if (retErr != null)
                {
                    GenUtil.LogIt(txtStatus, retErr.ToString());
                }
                else
                {
                    GenUtil.LogIt(txtStatus, "OK");


                    // render list views
                    ddlListViews.Items.Insert(0, "None");
                    ddlListViews.SelectedIndex = 0;

                    foreach (CustXMLView v in lstViews)
                    {
                        ddlListViews.Items.Add(v.DisplayName);
                    }


                    // render list fields
                    DataTable dt = new DataTable();

                    dt.Columns.Add("Id", typeof(string));
                    dt.Columns.Add("InternalName", typeof(string));
                    dt.Columns.Add("Required", typeof(string));
                    dt.Columns.Add("Title", typeof(string));
                    dt.Columns.Add("TypeAsString", typeof(string));

                    foreach (CustXMLField cXmlField in lstFields)
                    {
                        DataRow dr = dt.NewRow();

                        dr["Id"]           = cXmlField.ID;
                        dr["InternalName"] = cXmlField.Name;
                        dr["Required"]     = cXmlField.Required.ToString();
                        dr["Title"]        = cXmlField.DisplayName;
                        dr["TypeAsString"] = cXmlField.Type;

                        dt.Rows.Add(dr);


                        TreeNode tn = new TreeNode();

                        if (lnkToggleFieldsName.Text == text_show_internalnames)
                        {
                            tn.Text = string.Format("{0} [{1}]", cXmlField.DisplayName, cXmlField.Name);
                        }
                        else
                        {
                            tn.Text = string.Format("{0} [{1}]", cXmlField.Name, cXmlField.DisplayName);
                        }

                        tn.Name = cXmlField.Name;

                        tvFields.Nodes.Add(tn);
                    }


                    DataView dv         = new DataView(dt);
                    dv.Sort             = "Title";
                    gvFields.DataSource = dv;


                    if (tvFields.Nodes.Count > 0)
                    {
                        tvFields.Sort();
                        tvFields.SelectedNode = tvFields.Nodes[0];
                    }
                }

                btnOpenListDetails.Visible = true;

                // finish action
                toolStripStatusLabel1.Text = "";
                statusStrip1.Refresh();

                picLogoWait.Visible = false;
                picLogoWait.Refresh();
            }));
        }
        /// <summary>
        /// </summary>
        private void Worker()
        {
            selWebId    = Guid.NewGuid();
            selWebTitle = string.Empty;
            var       lst    = new List <CustXMLList>();
            Exception retErr = null;

            try
            {
                SPWSLists.Lists proxy = new SPCAMLQueryHelperOnline.SPWSLists.Lists();

                if (parentForm.formChooser.appMode == Chooser.AppMode.UseWSDef)
                {
                    proxy.UseDefaultCredentials = true;
                }
                else if (parentForm.formChooser.appMode == Chooser.AppMode.UseWSCreds)
                {
                    proxy.UseDefaultCredentials = false;
                    proxy.Credentials           = new System.Net.NetworkCredential(parentForm.formChooser.credUsername, parentForm.formChooser.credPassword, parentForm.formChooser.credDomain);
                }
                else if (parentForm.formChooser.appMode == Chooser.AppMode.UseWSOffice365)
                {
                    proxy.CookieContainer = SharedStuff.GetAuthCookies(new Uri(url), parentForm.formChooser.credUsername, parentForm.formChooser.credPassword);
                }

                proxy.Url = GenUtil.CombineUrls(url, XMLConsts.AsmxSuffix_Lists);

                XElement xLists = proxy.GetListCollection().GetXElement();

                foreach (XElement xList in xLists.Elements(XMLConsts.s + "List"))
                {
                    CustXMLList cXmlList = new CustXMLList()
                    {
                        DefaultViewUrl = GenUtil.GetXElemAttrAsString(xList, "DefaultViewUrl"),
                        ID             = GenUtil.GetXElemAttrAsString(xList, "ID"),
                        Hidden         = GenUtil.SafeToBool(GenUtil.GetXElemAttrAsString(xList, "Hidden")),
                        Name           = GenUtil.GetXElemAttrAsString(xList, "Name"),
                        Title          = GenUtil.GetXElemAttrAsString(xList, "Title"),
                        WebFullUrl     = GenUtil.GetXElemAttrAsString(xList, "WebFullUrl"),
                        WebId          = GenUtil.GetXElemAttrAsString(xList, "WebId")
                    };

                    if (!cXmlList.Hidden)
                    {
                        lst.Add(cXmlList);
                    }
                }
            }
            catch (Exception ex)
            {
                retErr = ex;
            }


            // update gui
            parentForm.Invoke(new MethodInvoker(() =>
            {
                tvLists.Nodes.Clear();

                if (retErr != null)
                {
                    GenUtil.LogIt(txtStatus, retErr.ToString());
                }
                else
                {
                    GenUtil.LogIt(txtStatus, "OK");

                    foreach (CustXMLList l in lst)
                    {
                        tvLists.Nodes.Add(l.ID, (l.Hidden ? l.Title + " [HIDDEN]" : l.Title));
                    }
                }

                // finish action
                btnLoad.Enabled = true;

                toolStripStatusLabel1.Text = "";
                statusStrip1.Refresh();

                picLogoWait.Visible = false;
                picLogoWait.Refresh();
            }));
        }
        /// <summary>
        /// </summary>
        private void Worker()
        {
            // configure view web service
            List <CustXMLView> lstCustXmlViews = new List <CustXMLView>();
            Exception          retErr          = null;

            try
            {
                SPWSViews.Views proxy = new SPCAMLQueryHelperOnline.SPWSViews.Views();

                if (parentForm.formChooser.appMode == Chooser.AppMode.UseWSDef)
                {
                    proxy.UseDefaultCredentials = true;
                }
                else if (parentForm.formChooser.appMode == Chooser.AppMode.UseWSCreds)
                {
                    proxy.UseDefaultCredentials = false;
                    proxy.Credentials           = new System.Net.NetworkCredential(parentForm.formChooser.credUsername, parentForm.formChooser.credPassword, parentForm.formChooser.credDomain);
                }
                else if (parentForm.formChooser.appMode == Chooser.AppMode.UseWSOffice365)
                {
                    proxy.CookieContainer = SharedStuff.GetAuthCookies(new Uri(siteUrl), parentForm.formChooser.credUsername, parentForm.formChooser.credPassword);
                }

                proxy.Url = GenUtil.CombineUrls(siteUrl, XMLConsts.AsmxSuffix_Views);

                XElement xViews = proxy.GetViewCollection(listName).GetXElement();

                foreach (XElement xView in xViews.Elements(XMLConsts.s + "View"))
                {
                    lstCustXmlViews.Add(new CustXMLView()
                    {
                        DefaultView = GenUtil.SafeToBool(GenUtil.GetXElemAttrAsString(xView, "DefaultView")),
                        DisplayName = GenUtil.GetXElemAttrAsString(xView, "DisplayName"),
                        Name        = GenUtil.GetXElemAttrAsString(xView, "Name"),
                        Url         = GenUtil.GetXElemAttrAsString(xView, "Url")
                    });
                }
            }
            catch (Exception ex)
            {
                retErr = ex;
            }



            // update gui
            parentForm.Invoke(new MethodInvoker(() =>
            {
                lstViews.Items.Clear();
                htViews.Clear();

                if (retErr != null)
                {
                }
                else
                {
                    foreach (CustXMLView cXmlView in lstCustXmlViews)
                    {
                        htViews.Add(cXmlView.DisplayName, cXmlView);
                        lstViews.Items.Add(cXmlView.DisplayName);
                    }
                }
            }));
        }