Exemple #1
0
        private void post_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.syncManager == null)
                    this.syncManager = new Synchronization();
                this.syncManager.SyncError += new Synchronization.EventHandler(syncManager_SyncError);
                this.syncManager.SyncComplete += new Synchronization.EventHandler(syncManager_SyncComplete);

                if (!this.txtAuthor.Text.Trim().Equals("") && !this.txtComment.Text.Trim().Equals(""))
                {
                    Dictionary<string, string> postParams = new Dictionary<string, string>();
                    postParams.Add("w", "" + this.wordID);
                    postParams.Add("author", this.txtAuthor.Text);
                    postParams.Add("comment", this.txtComment.Text);
                    this.syncManager.DoSendComment(postParams);
                }
                else
                    MessageBox.Show(AppResources.comment_Empty);
            }
            catch
            {
                MessageBox.Show(AppResources.generalError);
            }
        }
        public LoadingPopup()
        {
            InitializeComponent();

            if (this.syncManager == null)
                this.syncManager = new Synchronization();
            this.syncManager.SyncError += new Synchronization.EventHandler(syncManager_SyncError);
            this.syncManager.SyncComplete += new Synchronization.EventHandler(syncManager_SyncComplete);
        }
Exemple #3
0
        private void post_Click(object sender, EventArgs e)
        {
            string name = this.txtName.Text;
            string email = this.txtEmail.Text;
            string url = this.txtURL.Text;
            string word = this.txtWord.Text;
            string description = this.txtDescription.Text;
            string example = this.txtExample.Text;
            string ethimology = this.txtEthimology.Text;

            int nestId = ((Neolog.Database.Models.Nest)this.ddNests.SelectedItem).NestId;

            bool hasError = true;
            if (name.Trim().Equals(""))
                this.txtName.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0));
            else if (description.Trim().Equals(""))
                this.txtDescription.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0));
            else if (word.Trim().Equals(""))
                this.txtWord.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0));
            else if (example.Trim().Equals(""))
                this.txtExample.BorderBrush = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0));
            else
                hasError = false;

            if (hasError)
                MessageBox.Show(AppResources.missingFields);
            else
            {
                if (this.syncManager == null)
                    this.syncManager = new Synchronization();
                this.syncManager.SyncError += new Synchronization.EventHandler(syncManager_SyncError);
                this.syncManager.SyncComplete += new Synchronization.EventHandler(syncManager_SyncComplete);

                Dictionary<string, string> postParams = new Dictionary<string, string>();
                postParams.Add("added_by", name);
                postParams.Add("added_by_email", email);
                postParams.Add("added_by_url", url);
                postParams.Add("word", word);
                postParams.Add("nest", "" + nestId);
                postParams.Add("word_desc", description);
                postParams.Add("example", example);
                postParams.Add("ethimology", ethimology);
                this.syncManager.DoSendWord(postParams);

                AppSettings.ConfPDEmail = "";
                AppSettings.ConfPDName = "";
                AppSettings.ConfPDURL = "";
                if (AppSettings.ConfPrivateData)
                {
                    AppSettings.ConfPDEmail = email;
                    AppSettings.ConfPDName = name;
                    AppSettings.ConfPDURL = url;
                }
            }
        }
        public SplashScreen()
        {
            InitializeComponent();
            this.txtLoading.Text = AppResources.loading;
            this.LayoutRoot.Background = new SolidColorBrush(AppSettings.BackgroundColor);

            if (this.syncManager == null)
                this.syncManager = new Synchronization();
            this.syncManager.SyncError += new Synchronization.EventHandler(syncManager_SyncError);
            this.syncManager.SyncComplete += new Synchronization.EventHandler(syncManager_SyncComplete);
        }
Exemple #5
0
        public WordDetails()
        {
            InitializeComponent();
            this.LayoutRoot.Background = new SolidColorBrush(AppSettings.BackgroundColor);
            this.pageTitle.Text = AppResources.appName;
            this.Loaded += new RoutedEventHandler(WordDetails_Loaded);

            if (this.syncManager == null)
                this.syncManager = new Synchronization();
            this.syncManager.SyncComplete +=new Synchronization.EventHandler(syncManager_SyncComplete);
            this.syncManager.SyncError +=new Synchronization.EventHandler(syncManager_SyncError);
        }