Exemplo n.º 1
0
        private void ConnectToWiki()
        {
            flatComboBoxVersion.Items.Clear();

            if (comboBoxItemWikiServer.ComboBox.SelectedIndex == -1)
            {
                if (comboBoxItemWikiServer.ComboBox.Text != "")
                {
                    currentWikiServer = comboBoxItemWikiServer.ComboBox.Text;
                }
                else
                {
                    currentWikiServer = comboBoxItemWikiServer.DefaultText;
                }
            }
            else
            {
                currentWikiServer = comboBoxItemWikiServer.ComboBox.SelectedItem.ToString();
            }

            try
            {
                editService = new EditService();
                editService.Url = (currentWikiServer.EndsWith("/") == false) ? currentWikiServer += "/EditService.asmx" : currentWikiServer += "EditService.asmx";
                // Assign the credentials of the logged in user or the user being impersonated.
                editService.Credentials = CredentialCache.DefaultCredentials;

                string credentials = editService.CanEdit();

                comboBoxAttribution.Items.Add(credentials);
                comboBoxAttribution.DefaultText = credentials;

                if (credentials != null)
                {
                    this.comboBoxAttribution.Items.Clear();
                    this.comboBoxAttribution.Items.Add(credentials);
                    this.comboBoxAttribution.DefaultText = credentials;
                    //this.comboBoxAttribution.DropDownStyle = ComboBoxStyle.DropDownList;
                }

                currentContentBase = editService.GetDefaultNamespace();

                LoadTopics(currentContentBase);
                LoadNamespaces();
            }
            catch (WebException ex)
            {
                MessageBox.Show(String.Format("There was a problem connecting to the FlexWiki server: {0}", ex.Message), "An error occured", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception ex)
            {
                MessageBox.Show(String.Format("There was a problem connecting to the FlexWiki server: {0}", ex.Message), "An error occured", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
        private void LoadTopics(ContentBase cb)
        {
            isLoading = true;

            currentContentBase = cb;

            listViewTopicNames.BeginUpdate();
            listViewTopicNames.Items.Clear();

            foreach(AbsoluteTopicName topicName in editService.GetAllTopics(cb))
            {
                ListViewItem lvi = new ListViewItem(topicName.Name);
                lvi.Tag = topicName;
                listViewTopicNames.Items.Add(lvi);
            }

            listViewTopicNames.EndUpdate();

            // clear the Preview and Text areas
            richTextBox1.Clear();
            htmlEditor1.LoadDocument("");
            flatComboBoxVersion.Items.Clear();

            isLoading = false;
        }
Exemplo n.º 3
0
        private void comboBoxContentBase_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (!isLoading)
            {
                isLoading = true;

                ContentBase cb = new ContentBase();
                cb.Namespace = comboBoxContentBase.SelectedValue.ToString();

                LoadTopics(cb);

                isLoading = false;
            }
        }
Exemplo n.º 4
0
 /// <remarks/>
 public void GetAllTopicsAsync(ContentBase cb, object userState) {
     if ((this.GetAllTopicsOperationCompleted == null)) {
         this.GetAllTopicsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetAllTopicsOperationCompleted);
     }
     this.InvokeAsync("GetAllTopics", new object[] {
                 cb}, this.GetAllTopicsOperationCompleted, userState);
 }
Exemplo n.º 5
0
 /// <remarks/>
 public void GetAllTopicsAsync(ContentBase cb) {
     this.GetAllTopicsAsync(cb, null);
 }
Exemplo n.º 6
0
 /// <remarks/>
 public System.IAsyncResult BeginGetAllTopics(ContentBase cb, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("GetAllTopics", new object[] {
                 cb}, callback, asyncState);
 }
Exemplo n.º 7
0
 public AbsoluteTopicName[] GetAllTopics(ContentBase cb) {
     object[] results = this.Invoke("GetAllTopics", new object[] {
                 cb});
     return ((AbsoluteTopicName[])(results[0]));
 }