Esempio n. 1
0
        /// <summary>
        /// </summary>
        private void lnkbtnAddCamlExample_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (ddlCamlExamples.SelectedItem == null || GenUtil.IsNull(ddlCamlExamples.SelectedItem))
            {
                return;
            }

            txtQuery.Text = CamlExamples.GetCamlExamples(formChooser.appMode != Chooser.AppMode.UseSOM)[ddlCamlExamples.SelectedItem.ToString()].ToString();
            txtQuery.Refresh();
        }
Esempio n. 2
0
        /// <summary>
        /// </summary>
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            if ((rbUseWSCustCreds.Checked || rbUseWSOffice365.Checked) &&
                (GenUtil.IsNull(txtUsername.Text) || GenUtil.IsNull(txtPassword.Text)))
            {
                MessageBox.Show("Username and Password are required.", "ERROR");
                return;
            }

            if (rbUseSOM.Checked)
            {
                appMode = AppMode.UseWSCreds;
            }
            else if (rbUseWSCustCreds.Checked)
            {
                appMode = AppMode.UseWSCreds;
            }
            else if (rbUseWSImpers.Checked)
            {
                appMode = AppMode.UseWSDef;
            }
            else if (rbUseWSOffice365.Checked)
            {
                appMode = AppMode.UseWSOffice365;
            }

            credUsername = GenUtil.SafeTrim(txtUsername.Text);
            credPassword = GenUtil.SafeTrim(txtPassword.Text);
            credDomain   = GenUtil.SafeTrim(txtDomain.Text);

            if (form1 == null)
            {
                form1 = new Form1();
                form1.StartPosition = FormStartPosition.CenterScreen;
                form1.formChooser   = this;
            }

            form1.ShowHideListViews(rbUseSOM.Checked);

            this.Hide();
            form1.Show();
            form1.Activate();
        }
Esempio n. 3
0
        /// <summary>
        /// </summary>
        private void Form1_Load(object sender, EventArgs e)
        {
            picLogoWait.Visible = false;
            picLogoWait.Refresh();

            UseRecentSessionInfo();

            {
                // init ddls
                ddlCamlExamples.Items.Clear();

                foreach (object key in CamlExamples.GetCamlExamples(formChooser.appMode != Chooser.AppMode.UseSOM).Keys)
                {
                    ddlCamlExamples.Items.Add(key.ToString());
                }
            }

            {
                // init textboxes
                lblListName.Text = "";

                toolStripStatusLabel1.Text = "";

                txtSiteUrl.Text = GenUtil.IsNull(txtSiteUrl.Text) ? "http://localhost" : txtSiteUrl.Text;

                txtQuery.Text = GenUtil.IsNull(txtQuery.Text)
                                    ? CamlExamples.GetCamlExamples(formChooser.appMode != Chooser.AppMode.UseSOM)["Replace with: Simple Where 4"].ToString()
                                    : txtQuery.Text;

                txtViewFields.Text = GenUtil.IsNull(txtViewFields.Text)
                                         ? @"<FieldRef Name=""Title"" />"
                                         : txtViewFields.Text;

                txtViewAttributes.Text = GenUtil.IsNull(txtViewAttributes.Text)
                                             ? "Scope=\"Recursive\""
                                             : txtViewAttributes.Text;
            }

            {
                // init mouse hover tips
                tvLists.MouseHover       += new EventHandler(tvLists_MouseHover);
                tvFields.MouseHover      += new EventHandler(tvFields_MouseHover);
                btnExportCode.MouseHover += new EventHandler(btnExportXML_MouseHover);
                txtSiteUrl.MouseHover    += new EventHandler(txtSiteUrl_MouseHover);
                txtQuery.MouseHover      += new EventHandler(txtQuery_MouseHover);
                gvFields.MouseHover      += new EventHandler(gvFields_MouseHover);
            }

            {
                lnkToggleFieldsName.Text       = text_show_internalnames;
                tvLists.NodeMouseDoubleClick  += new TreeNodeMouseClickEventHandler(tvLists_NodeMouseDoubleClick);
                tvFields.NodeMouseDoubleClick += new TreeNodeMouseClickEventHandler(tvFields_NodeMouseDoubleClick);
            }

            {
                txtSiteUrl.KeyPress += new KeyPressEventHandler(txtSiteUrl_KeyPress);
            }

            {
                // init drag drop events
                tvFields.ItemDrag += new ItemDragEventHandler(tvFields_ItemDrag);

                txtViewFields.AllowDrop  = true;
                txtViewFields.DragEnter += new DragEventHandler(txtViewFields_DragEnter);
                txtViewFields.DragDrop  += new DragEventHandler(txtViewFields_DragDrop);

                txtQuery.AllowDrop  = true;
                txtQuery.DragEnter += new DragEventHandler(txtQuery_DragEnter);
                txtQuery.DragDrop  += new DragEventHandler(txtQuery_DragDrop);
            }

            {
                gvFields.CellDoubleClick += new DataGridViewCellEventHandler(gvFields_CellDoubleClick);
            }

            {
                picLogoNormal.Click += new EventHandler(pictureBox1_Click);
            }

            btnOpenListDetails.Visible = false;
        }