当前位置: 首页>>代码示例>>C#>>正文


C# Form.Update方法代码示例

本文整理汇总了C#中Form.Update方法的典型用法代码示例。如果您正苦于以下问题:C# Form.Update方法的具体用法?C# Form.Update怎么用?C# Form.Update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Form的用法示例。


在下文中一共展示了Form.Update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EditShowInfo


//.........这里部分代码省略.........
                    {
                        //throw new Exception("Error Parsing Date");
                        movieDate = movieYear + "-01-01";
                    }
                    else
                    {
                        string date = response.Substring(startindex, endindex - startindex);
                        string[] dateParts = date.Split(' ');
                        string month = "January";
                        string day = "01";
                        if (dateParts.Length == 2)
                        {
                            // Only Year
                            movieDate = movieYear;
                        }
                        else if (dateParts.Length == 3)
                        {
                            // Month and Year
                            month = dateParts[0].Trim();
                        }
                        else if (dateParts.Length == 4)
                        {
                            // Day Month Year
                            // Adjust length of day
                            if (dateParts[0].Trim().Length == 1)
                                day = "0" + dateParts[0].Trim();
                            month = dateParts[1].Trim();
                        }
                        else
                        {
                            throw new Exception("Error Forming Date");
                        }
                        movieDate = movieYear;
                        // Lookup Month
                        if (month.Equals("January"))
                            movieDate = movieDate + "-01-" + day;
                        else if (month.Equals("February"))
                            movieDate = movieDate + "-02-" + day;
                        else if (month.Equals("March"))
                            movieDate = movieDate + "-03-" + day;
                        else if (month.Equals("April"))
                            movieDate = movieDate + "-04-" + day;
                        else if (month.Equals("May"))
                            movieDate = movieDate + "-05-" + day;
                        else if (month.Equals("June"))
                            movieDate = movieDate + "-06-" + day;
                        else if (month.Equals("July"))
                            movieDate = movieDate + "-07-" + day;
                        else if (month.Equals("August"))
                            movieDate = movieDate + "-08-" + day;
                        else if (month.Equals("September"))
                            movieDate = movieDate + "-09-" + day;
                        else if (month.Equals("October"))
                            movieDate = movieDate + "-10-" + day;
                        else if (month.Equals("November"))
                            movieDate = movieDate + "-11-" + day;
                        else if (month.Equals("December"))
                            movieDate = movieDate + "-12-" + day;
                        else
                            throw new Exception("Error Forming Date");
                    }

                    // Set title as Movies for now.  This needs to be fixed so DisplayTitle gets set
                    // to "Movies" and Title get set to the movie name.
                    row["Title"] = "Movies";

                    // Set Episode Name as the movie
                    if (movieTitle.IndexOf("The") == 0)
                        movieTitle = movieTitle.Substring(4).Trim() + ", The";
                    if (movieTitle.IndexOf("A ") == 0)
                        movieTitle = movieTitle.Substring(2).Trim() + ", A";
                    if (movieTitle.IndexOf("An ") == 0)
                        movieTitle = movieTitle.Substring(3).Trim() + ", An";
                    row["EpisodeTitle"] = movieTitle;

                    // Set the Description
                    row["EpisodeDescription"] = moviePlot;

                    // Set the Genre
                    row["Genre"] = movieGenre;

                    // Set the Actors
                    row["Actors"] = movieActors;

                    // Set the Date
                    //string firstAired = "2099-01-01";
                    row["ActualStart"] = movieDate;
                    row["OriginalAirDate"] = movieDate.Replace("-", "");
                    row["MovieYear"] = movieYear;

                    updatedRowCount++;
                    count++;
                    Thread.Sleep(500);
                    progressForm.Update();
                }

                progressForm.Close();

                return (updatedRowCount > 0);
            }
开发者ID:tmar89,项目名称:tmar89snapstreamdev,代码行数:101,代码来源:PluginMovieTagger.cs

示例2: EditShowInfo


//.........这里部分代码省略.........
                            for (int i = 0; i < dateMatches; i++)
                            {
                                comboBox.Items.Add("Season: " + seasonSearch[i] + ", Episode: " + episodeSearch[i] + ", " + episodeNameSearch[i]);
                            }
                            comboBox.SelectedIndex = 0;
                            multipleListingsForm = new Form();
                            multipleListingsForm.Text = "Select Episode";
                            multipleListingsForm.Size = new System.Drawing.Size(200, 140);
                            multipleListingsForm.Controls.Add(comboBox);
                            Button selectButton = new Button();
                            Button skipButton = new Button();
                            selectButton.Text = "Select";
                            selectButton.Click += new System.EventHandler(this.selectButton_Click);
                            selectButton.Location = new System.Drawing.Point(10, 70);
                            selectButton.Size = new System.Drawing.Size(80, 30);
                            skipButton.Text = "Skip";
                            skipButton.Click += new System.EventHandler(this.skipButton_Click);
                            skipButton.Location = new System.Drawing.Point(80, 70);
                            skipButton.Size = new System.Drawing.Size(80, 30);
                            Label label = new Label();
                            label.Text = row["Name"].ToString();
                            label.Location = new System.Drawing.Point(10, 10);
                            label.Size = new System.Drawing.Size(180, 30);
                            multipleListingsForm.Controls.Add(label);
                            multipleListingsForm.Controls.Add(selectButton);
                            multipleListingsForm.Controls.Add(skipButton);
                            multipleListingsForm.StartPosition = FormStartPosition.CenterScreen;
                            multipleListingsForm.ShowDialog();
                            multipleListingsForm.Dispose();
                            // Check if a series was selected or skipped
                            int episodeIndex = comboBox.SelectedIndex;
                            if (!isSkip)
                            {
                                // Set the series name to the selected item
                                tagger.seasonNumber = seasonSearch[episodeIndex];
                                tagger.episodeNumber = episodeSearch[episodeIndex];
                            }
                            else
                                // Skip search
                                continue;
                        }
                    }

                    // Get episode info from TheTVDB.com API
                    URLString = "http://www.thetvdb.com/api/8DB53EF83E7E8308/series/" +
                                seriesID + "/default/" + tagger.seasonNumber + "/" + tagger.episodeNumber + "/en.xml";
                    if (DEBUG)
                        MessageBox.Show("URL: " + URLString);
                    reader = new XmlTextReader(URLString);
                    doc = new XmlDocument();
                    try
                    {
                        doc.Load(reader);
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show("Bad URL: " + URLString + "\nSkipping.", row["Name"].ToString());
                        continue;
                    }
                    reader.Close();

                    // Set series name
                    row["Title"] = formalName;

                    // Set Episode Name
                    string episodeName = doc.GetElementsByTagName("EpisodeName").Item(0).InnerText;
                    row["EpisodeTitle"] = episodeName;
                    if (DEBUG)
                        MessageBox.Show("Episode Name: " + episodeName);

                    // Set Episode Date
                    string firstAired = doc.GetElementsByTagName("FirstAired").Item(0).InnerText;
                    row["ActualStart"] = firstAired;
                    row["OriginalAirDate"] = firstAired.Replace("-", "");
                    if (DEBUG)
                        MessageBox.Show("Episode Aired: " + firstAired);

                    // Set Episode Overview
                    string overview = doc.GetElementsByTagName("Overview").Item(0).InnerText;
                    if (DEBUG)
                        MessageBox.Show("Overview: " + overview);
                    // Append Series and Episode number to the beginning
                    if (tagger.seasonNumber.Length == 1 && tagger.episodeNumber.Length == 1)
                        overview = "S0" + tagger.seasonNumber + "E0" + tagger.episodeNumber + " - " + overview;
                    else if (tagger.seasonNumber.Length == 1 && tagger.episodeNumber.Length == 2)
                        overview = "S0" + tagger.seasonNumber + "E" + tagger.episodeNumber + " - " + overview;
                    else if (tagger.seasonNumber.Length == 2 && tagger.episodeNumber.Length == 1)
                        overview = "S" + tagger.seasonNumber + "E0" + tagger.episodeNumber + " - " + overview;
                    else
                        overview = "S" + tagger.seasonNumber + "E" + tagger.episodeNumber + " - " + overview;
                    row["EpisodeDescription"] = overview;

                    updatedRowCount++;
                    Thread.Sleep(500);
                    progressForm.Update();
                }
                progressForm.Close();

                return ( updatedRowCount > 0 );
            }
开发者ID:tmar89,项目名称:tmar89snapstreamdev,代码行数:101,代码来源:PluginTagFromTheTVDB.cs


注:本文中的Form.Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。