Example #1
0
 private void AddPopupTip(RegistryKey key, PopupTip tip)
 {
     if (key.GetValue(tip.ToString()) != null)
     {
         PopupTipList.IgnorePopupTip(tip);
     }
 }
Example #2
0
 private void playBtn_Click(object sender, RoutedEventArgs e)
 {
     //Button btn = (Button)sender;
     //SearchSongResultById dsr = await BaiduMusicOp.GetMusicUrl(btn.Tag.ToString());
     //System.Diagnostics.Process.Start(AppDomain.CurrentDomain.BaseDirectory+"//Player.exe",dsr.Bitrate[0].file_link);
     PopupTip.ShowPopUp("暂时不提供……");
 }
        protected PopupTip GetPopupTipWindow()
        {
            if (popup != null)
            {
                return(popup);
            }

            foreach (var item in Plotter.Children)
            {
                if (item is ViewportUIContainer)
                {
                    ViewportUIContainer container = (ViewportUIContainer)item;
                    if (container.Content is PopupTip)
                    {
                        return(popup = (PopupTip)container.Content);
                    }
                }
            }

            popup                 = new PopupTip();
            popup.Placement       = PlacementMode.Relative;
            popup.PlacementTarget = plotter.CentralGrid;
            Plotter.Children.Add(popup);
            return(popup);
        }
 private async void bgBtn_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         DownLoadFileInfo dl = dlIngList.SelectedItem as DownLoadFileInfo;
         if (dl == null || !await PopupTip.CheckNetWork())
         {
             return;
         }
         System.Windows.Controls.Button btn = sender as System.Windows.Controls.Button;
         string content = btn.Content.ToString();
         if (content == "开始" || content == "继续")
         {
             StartSelections();
         }
         else if (content == "播放")
         {
             System.Diagnostics.Process.Start(MainWindow.DownloadFolder + dl.FileName);
         }
         else
         {
             Pause();
         }
     }
     catch (Exception ex) { Console.WriteLine(ex.ToString()); }
 }
Example #5
0
        /// <summary>
        /// 开始异步下载
        /// </summary>
        /// <param name="ArtistName"></param>
        public async static void BeginDownload(string Savepath, string ArtistName)
        {
            string dir = Savepath + ArtistName + "\\";

            if (System.IO.Directory.Exists(dir))
            {
                CompletedNoticeEventHandler(
                    new MyEventAgr
                {
                    SName = ArtistName, WC = null
                }
                    );
                return;
            }
            if (!await PopupTip.CheckNetWork())
            {
                Console.WriteLine("error:网络未连接,无法下载歌手图片");
                return;
            }
            List <string> urlList = await GetPicsURL(ArtistName);

            foreach (string picUrl in urlList)
            {
                WebClient webClient = new WebClient();
                webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(webClient_DownloadFileCompleted);
                webClient.Credentials            = CredentialCache.DefaultCredentials;
                System.IO.Directory.CreateDirectory(dir);
                webClient.DownloadFileAsync(new Uri(picUrl), dir + ArtistName + "_" + urlList.IndexOf(picUrl) + picUrl.Substring(picUrl.LastIndexOf('.')), new MyEventAgr {
                    SName = ArtistName, WC = webClient
                });
            }
        }
Example #6
0
 private async void searchBtn_Click(object sender, RoutedEventArgs e)
 {
     searchStr = SearchText.Text;
     if (searchStr == "" || !await PopupTip.CheckNetWork())
     {
         return;
     }
     Tip.Visibility      = Visibility.Collapsed;
     this.dd.ItemsSource = null;
     searchBtn.IsEnabled = false;
     TaskAsyncHelper.RunAsync(new Action(() => startAsyncSearch(0)), TaskCompleted);
 }
Example #7
0
        public FormPopupTip(PopupTip tip)
        {
            InitializeComponent();

            Tip = tip;

            txtTip.Text = PopupTips.GetMessage(_tip);

            if (!Prefs.Preferences.PopupTipList.IsIgnorePopupTip(tip))
            {
                ShowDialog();
            }
        }
Example #8
0
    public static void PopupTip(int strIden)
    {
        PopupTip tip    = WsWindow.OpenMul <PopupTip>(WsWindow.PopupTip);
        LangBase langIt = GameData.langMng.GetRowByIdx((int)strIden) as LangBase;
        string   str    = "";

        if (Lang == (int)LanguageType.Ch && langIt != null)
        {
            str = langIt.Ch;
        }
        if (Lang == (int)LanguageType.En && langIt != null)
        {
            str = langIt.En;
        }
        tip.Popup(str);
    }
Example #9
0
        public async static void SearchLrc(Song song)
        {
            bool isExist = false;

            lyric.Clear();
            string fileName = Common.getTitleFromPath(song.FileUrl);

            try
            {
                if (lrcWindowStatue)
                {
                    lrcWindow.Init(fileName);
                }
                foreach (string str in LrcTypes)
                {
                    FileInfo[] files = new DirectoryInfo(song.FileUrl).Parent.GetFiles(str, SearchOption.TopDirectoryOnly);
                    if (files != null)
                    {
                        foreach (FileInfo info2 in files)
                        {
                            string fullName = info2.FullName;
                            if (Regex.IsMatch(fullName, fileName))
                            {
                                lyric   = new Lrc(fullName);
                                isExist = true;
                                break;
                            }
                        }
                    }
                }
                if (!isExist && await PopupTip.CheckNetWork())
                {
                    string lrcPath = await DownLrc.DownloadLrcAsync(song);

                    if (string.IsNullOrEmpty(lrcPath))
                    {
                        lrcPath = await DownLrc.DownloadLrcAsyncFromQian(song);
                    }
                    if (!string.IsNullOrEmpty(lrcPath) && lrcWindowStatue)
                    {
                        lyric = new Lrc(lrcPath);
                    }
                }
            }
            catch (Exception ex) { Console.WriteLine(ex.ToString()); }
        }
Example #10
0
        public static string GetMessage(PopupTip tip)
        {
            switch (tip)
            {
            case PopupTip.FilterResultsBrowserUsingMetricSet:
                return("Now that you have some results, did you know that you can " +
                       "restrict the results you see to specific metrics using a Metric Set? " +
                       "Create a Metric Set, and select it from the dropdown list on the toolbar, " +
                       "then refresh your results again.");

            case PopupTip.ResultsBrowserAfterParse:
                return("Now that you have parsed your project, did you know that you can " +
                       "view the results in the main Krakatau EPM window by right-clicking on your " +
                       "project and selecting Results Browser (or by pushing F5 on the keyboard). " +
                       "You can sort the results by clicking on the column headings.");
            }

            return("Never show Popup Tips");
        }
		protected PopupTip GetPopupTipWindow()
		{
			if (popup != null)
				return popup;

			foreach (var item in Plotter.Children)
			{
				if (item is ViewportUIContainer)
				{
					ViewportUIContainer container = (ViewportUIContainer)item;
					if (container.Content is PopupTip)
						return popup = (PopupTip)container.Content;
				}
			}

			popup = new PopupTip();
			popup.Placement = PlacementMode.Relative;
			popup.PlacementTarget = plotter.CentralGrid;
			Plotter.Children.Add(popup);
			return popup;
		}
Example #12
0
    //点击下方的 物品,NPC按钮,弹出一个简单提示
    public static void PopupTip(string str)
    {
        PopupTip tip = WsWindow.OpenMul <PopupTip>(WsWindow.PopupTip);

        tip.Popup(str);
    }