/// <summary> /// メディアの表示 /// </summary> /// <param name="suffix">メディア番号</param> private void SelectMedia(int suffix) { if (this.Media.Count <= suffix) { return; } var mainWindow = CommonMethods.MainWindow; if (mainWindow != null) { //動画を表示 if (this.Media[suffix].Type == StatusMediaType.Video) { using (var showMovie = new Views.ShowDialogs.ShowMovie(this.Media[suffix].Url, false)) { LightBox.ShowDialog(mainWindow, showMovie); } } //画像を表示 else { using (var showImage = new Views.ShowDialogs.ShowImage(this.Media.Select(x => x.Image).ToList(), suffix)) { LightBox.ShowDialog(mainWindow, showImage); } } } }
private void Button_Click(object sender, RoutedEventArgs e) { var image = new Image(); image.Source = new BitmapImage(new Uri("Images/1.jpg", UriKind.Relative)); LightBox.Show(this, image); }
/// <summary> /// マイク設定ダイアログ表示 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_deviceSetting_Click(object sender, RoutedEventArgs e) { MicrophoneDeviceSetingWindow mdsw = new MicrophoneDeviceSetingWindow(); if (setting.Device != null) { mdsw.Device = setting.Device; } logger.Debug("------------- Microphone device setting window show dialog -------------"); LightBox.ShowDialog(this, mdsw); if (mdsw.DialogResult) { setting.SubscriptionKey = setting.SubscriptionKey; setting.Region = setting.Region; setting.Location = setting.Location; setting.PROXY_Host = setting.PROXY_Host; setting.PROXY_Port = setting.PROXY_Port; setting.Device = mdsw.Device; setting2xml(); logger.Info("Save Microphone Device settings."); } else { logger.Debug("------------- Cancel Save Microphone Device settings -------------"); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { foreach (LBMsg lBMsg in lBModel.ListLBMsg) { LightBox light = new LightBox(lBMsg); lightBoxes.Add(light); canvasBoxContainer.Children.Add(light); Canvas.SetLeft(light, 86 * (lBMsg.Column - 1) + lBMsg.Column * 1); Canvas.SetTop(light, 42 * (lBMsg.Row1 - 1) + lBMsg.Row1 * 7); light.rightClickEvent += Light_rightClickEvent; light.clickEvent += Light_clickEvent; } double width = BaseConfig.ins.Columns * (86 + 2) + 10; Console.WriteLine("width:" + width); canvasBoxContainer.Width = width; canvasBoxContainer.Height = BaseConfig.ins.Rows * (42 + 2) + 100; List <double> listWaitTime = LightBoxHelper.SelectedModel.getListWaitTime(); for (int i = 0; i < listWaitTime.Count; i++) { double time = listWaitTime[i]; Color color = GetRandomColor(); foreach (LightBox box in lightBoxes) { if (box.lBMsg.WaitTime == time) { box.setBackGroundColor(color); } } } }
public void NewGame() { SetLayout(); Random rd = new Random(); int xCoord = 0; int yCoord = 0; int activeCount = 0; for (int i = 0; i < (gridSize * gridSize); i++) { bool lightActive = rd.Next(0, 10) > 8;//checking greater than 8 to lower chances of initially starting with too many lightboxes if (lightActive) { activeCount++; } if (activeCount == 0 && xCoord == (gridSize - 1) && yCoord == (gridSize - 1))//if no lights have been turned on, turn last lightbox on { lightActive = true; } LightBox lightBox = new LightBox(lightActive, new LightBox.Coordinates(xCoord, yCoord)); lightBox.Light.Click += delegate(object sender, EventArgs e) { lightBoxClick(sender, e, lightBox.Location); }; lightBoxes.Add(lightBox); panelLayout.Controls.Add(lightBox.Light); xCoord++; if (xCoord > (gridSize - 1)) { xCoord = 0; yCoord++; } } LightBoxHelper.SetLightBoxNeighbours(lightBoxes); }
private void OnClickShowInGrid(object sender, RoutedEventArgs e) { var image = new Image(); image.Source = new BitmapImage(new Uri("Images/1.jpg", UriKind.Relative)); LightBox.Show(this.subGrid, image); }
protected void lightBoxClick(object sender, EventArgs e, LightBox.Coordinates coordinates) { LightBox clickedLightBox = LightBoxHelper.GetLightBoxByCoordinates(lightBoxes, coordinates); clickedLightBox.Active = !clickedLightBox.Active; foreach (LightBox neighbours in clickedLightBox.Neighbours) { neighbours.Active = !neighbours.Active; } bool win = LightBoxHelper.CheckWin(lightBoxes, gridSize); if (win) { DialogResult dialogResult = MessageBox.Show("Would you like to try again?", "Well Done", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { NewGame(); } else if (dialogResult == DialogResult.No) { Application.Exit(); } } }
private void Button_versionInformation_Click(object sender, RoutedEventArgs e) { System.Diagnostics.FileVersionInfo ver = System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location); VersionInfomationWindow VersionWindow = new VersionInfomationWindow("Recode_To_Text_Ver:" + ver.FileVersion, "Speech_To_Text_DLL_Ver:" + stt.Version); logger.Debug("------------- VersionWindow show dialog -------------"); LightBox.ShowDialog(this, VersionWindow); }
private void Light_clickEvent(object sender, EventArgs e) { LightBox boxSrc = sender as LightBox; List <LightBox> listSelectedBox = new List <LightBox>(); listSelectedBox.Add(boxSrc); setListBox(listSelectedBox); }
/// <summary> /// Show Thumnail /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ModImage_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { // show FrameworkElement. var image = new Image { Source = ModImage.Source }; LightBox.Show(this, image); }
private void WaitForFrameToDisplay() { //_currentWindow = Driver.CurrentWindowHandle; this.CurrentWindowHandle = Driver.CurrentWindowHandle; Report.Write("The current window is: '" + this.CurrentWindowHandle + "'."); LightBox.WaitUntilExists(3); IFrame.WaitUntilExists(3); //Driver.SwitchTo().Frame(IFrame.Element); DriverCommands.WaitToSwitchFrame(IFrame, 3); }
/// <summary> /// ユーザーをリストに追加する /// </summary> private void AddToList() { var mainWindow = CommonMethods.MainWindow; if (mainWindow != null) { using (var showAddToList = new Views.ShowDialogs.ShowAddToList(this.TimelineModel.TokenSuffix, this)) { LightBox.ShowDialog(mainWindow, showAddToList); } } }
private void Light_rightClickEvent(object sender, EventArgs e) { LightBox boxSrc = sender as LightBox; foreach (LightBox box in lightBoxes) { if (box.lBMsg.WaitTime == boxSrc.lBMsg.WaitTime) { box.setSelected(); } } }
/// <summary> /// コピーボタンを押したとき /// </summary> public void Copy() { var mainWindow = CommonMethods.MainWindow; if (mainWindow != null) { using (var showCopiableText = new Views.ShowDialogs.ShowCopiableText(this.FullText)) { LightBox.ShowDialog(mainWindow, showCopiableText); } } }
private async void button_Click(object sender, RoutedEventArgs e) { LightBox.Show(this, new SampleDialog()); await Task.Delay(1000); LightBox.Show(this, new SampleDialog()); await Task.Delay(1000); LightBox.Show(this, new SampleDialog()); }
/// <summary> /// リプライ先ツイートをクリックしたとき /// </summary> public void Select() { var mainWindow = CommonMethods.MainWindow; if (mainWindow != null && this.Id != null) { using (var status = new Views.ShowDialogs.ShowStatus(this.TimelineModel, (long)this.Id)) { LightBox.ShowDialog(mainWindow, status); } } }
private async void button_Click(object sender, RoutedEventArgs e) { // 時間差で複数のダイアログ表示を続けて行う。 LightBox.Show(this, new SimpleDialog()); await Task.Delay(1000); LightBox.Show(this, new SimpleDialog()); await Task.Delay(1000); LightBox.Show(this, new SimpleDialog()); }
public static LightBox GetLightBoxByCoordinates(List <LightBox> lightBoxes, LightBox.Coordinates coordinates) { LightBox lightBoxMatch = null; foreach (LightBox lightBox in lightBoxes) { if (lightBox.Location == coordinates) { lightBoxMatch = lightBox; } } return(lightBoxMatch); }
/// <summary> /// 共有ボタンを押したとき /// </summary> public void Share() { var mainWindow = CommonMethods.MainWindow; if (mainWindow != null) { string link = "https://twitter.com/" + this.User.ScreenName + "/status/" + this.Id; using (var showCopiableText = new Views.ShowDialogs.ShowCopiableText(link)) { LightBox.ShowDialog(mainWindow, showCopiableText); } } }
public static bool IsNeighbour(LightBox lightBox, LightBox compareLightBox) { if (lightBox.Location.Column == compareLightBox.Location.Column && (lightBox.Location.Row == compareLightBox.Location.Row + 1 || lightBox.Location.Row == compareLightBox.Location.Row - 1)) { return(true); } else if (lightBox.Location.Row == compareLightBox.Location.Row && (lightBox.Location.Column == compareLightBox.Location.Column + 1 || lightBox.Location.Column == compareLightBox.Location.Column - 1)) { return(true); } else { return(false); } }
private void WaitForFrameToDisplay() { if ((this.PageNames == PageNames.TestItemStandardPopup) || (this.PageNames == PageNames.CreateNewItem) || (this.PageNames == PageNames.EditTestItem) || (this.PageNames == PageNames.EditTask) || (this.PageNames == PageNames.EditQuestion) || (this.PageNames == PageNames.EditRubric)) { //switch to window DriverCommands.WaitToSwitchWindow(_currentWindow, 5); LightBox.WaitUntilExists(3); IFrame.WaitUntilExists(3); //Driver.SwitchTo().Frame(IFrame.Element); DriverCommands.WaitToSwitchFrame(IFrame, 3); } }
/// <summary> /// 引用ツイートをクリックしたとき /// </summary> public void SelectQuotationStatus() { var suffix = 0; if (suffix > this.QuotationIds.Count - 1) { return; } var mainWindow = CommonMethods.MainWindow; if (mainWindow != null) { using (var status = new Views.ShowDialogs.ShowStatus(this.TimelineModel, this.QuotationIds[suffix])) { LightBox.ShowDialog(mainWindow, status); } } }
/// <summary> /// Azure設定ダイアログ表示 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_azureSetting_Click(object sender, RoutedEventArgs e) { AzureSettingWindow asw = new AzureSettingWindow(); if (setting.SubscriptionKey != null) { asw.SubscriptionKey = setting.SubscriptionKey; } if (setting.Region != null) { asw.Region = setting.Region; } if (setting.Location != null) { asw.Location = setting.Location; } if (setting.PROXY_Host != null) { asw.PROXY_Host = setting.PROXY_Host; } if (setting.PROXY_Port != null) { asw.PROXY_Port = setting.PROXY_Port; } LightBox.ShowDialog(this, asw); if (asw.DialogResult) { setting.SubscriptionKey = asw.SubscriptionKey; setting.Region = asw.Region; setting.Location = asw.Location; setting.PROXY_Host = asw.PROXY_Host; setting.PROXY_Port = asw.PROXY_Port; setting.Device = setting.Device; logger.Info("Save Azure settings."); setting2xml(); } else { logger.Debug("------------- Cancel save Azure settings -------------"); } }
private void OnItemDoubleClicked(object sender, MouseEventArgs e) { var helper = new System.Windows.Interop.WindowInteropHelper(App.Current.MainWindow); var screen = System.Windows.Forms.Screen.FromHandle(helper.Handle); var height = screen.Bounds.Height; var path = this.lstPhoto.SelectedItem as Uri; var bmp = new BitmapImage(); bmp.BeginInit(); bmp.UriSource = path; bmp.DecodePixelHeight = height; bmp.EndInit(); var image = new Image() { Source = bmp }; LightBox.Show(this, image); }
private void OnClickShowUserControl(object sender, RoutedEventArgs e) { LightBox.Show(this, new SampleDialog()); }
public LightBoxFactory() { _pluginResourceDescriptor = new LightBoxResourceDescriptor(); _plugin = new LightBox(new LightBoxSettings(PluginResourceDescriptor.PluginResourcePath)); }
private void OnClickShowDialogButton(object sender, RoutedEventArgs e) { LightBox.ShowDialog(this, new SampleDialog()); MessageBox.Show("Hello."); }
private async void OnClickShowAsyncButton(object sender, RoutedEventArgs e) { await LightBox.ShowAsync(this, new SampleDialog()); MessageBox.Show("Hello."); }