Пример #1
0
        private void btnEditImage_Click(object sender, EventArgs e)
        {
            var diag = new ImageDialog(this, _edSvc.CurrentConnection, _sym, _image);

            diag.ShowDialog(this);
            OnResourceChanged();
        }
Пример #2
0
 private void imageSelectButton_Click(object sender, EventArgs e)
 {
     if (ImageDialog.ShowDialog() == DialogResult.OK)
     {
         imagePath          = ImageDialog.FileName;
         imagePathText.Text = imagePath;
     }
 }
Пример #3
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            Image image = ImageDialog.OpenImage();

            if (image != null)
            {
                pictureBox1.Image = image;
            }
        }
Пример #4
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            Image nueva = ImageDialog.OpenImage();

            if (nueva != null)
            {
                pictureBox1.Image = nueva;
            }
        }
Пример #5
0
        /// <summary>
        /// The <see cref="Control.Click"/> event handler for the
        /// <see cref="Button"/> <see cref="btnImage"/>.
        /// Shows a <see cref="ImageDialog"/> to define an umage stimulus
        /// that is added to all imported slides.
        /// </summary>
        /// <param name="sender">Source of the event.</param>
        /// <param name="e">An empty <see cref="EventArgs"/></param>
        private void btnImage_Click(object sender, EventArgs e)
        {
            ImageDialog dlg = new ImageDialog();

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                VGImage image = dlg.NewImage;
                image.Canvas = Document.ActiveDocument.PresentationSize;
                this.cbbDesignedItem.Items.Add(image);
                this.cbbDesignedItem.SelectedItem = image;
            }
        }
Пример #6
0
 private async void DetailWebView_ScriptNotify(object sender, NotifyEventArgs e)
 {
     try
     {
         var data = JsonConvert.DeserializeObject <WebNotify>(e.Value);
         // 图片点击事件,弹出图片对话框
         if (data.Key == "ImageClick" && !string.IsNullOrEmpty(data.Value))
         {
             var imageDialog = new ImageDialog(data.Value);
             await imageDialog.ShowAsync();
         }
         // 文本选中事件,弹出对应菜单
         else if (data.Key == "SelectText" && !string.IsNullOrEmpty(data.Value))
         {
             var pos = new Point();
             if (_latestPoint == null)
             {
                 pos = Window.Current.CoreWindow.PointerPosition;
             }
             else
             {
                 pos = _latestPoint.Position;
             }
             double x = pos.X - Window.Current.Bounds.X;
             double y = pos.Y - Window.Current.Bounds.Y;
             _selectText = data.Value;
             SelectTextFlyout.ShowAt(MainPage.Current.RootGrid, new Point(x, y));
         }
         else if (data.Key == "LinkClick" && !string.IsNullOrEmpty(data.Value))
         {
             try
             {
                 await Launcher.LaunchUriAsync(new Uri(data.Value));
             }
             catch (Exception)
             {
                 new PopupToast(AppTools.GetReswLanguage("Tip_LaunchUriError")).ShowPopup();
             }
         }
         else if (data.Key == "Back")
         {
             CheckBack();
         }
     }
     catch (Exception)
     {
         return;
     }
 }
Пример #7
0
        private void buttonSlideBackground_Click(object sender, EventArgs e)
        {
            ImageDialog imd = new ImageDialog(ImgManager)
            {
                Background = Song.Parts[CurrentPartId].Slides[CurrentSlideId].Background
            };

            // Set "use background for all slides" checkbox to true if no or only one image used
            imd.UseForAll = Song.GetNumberOfBackgroundImages() <= 1;

            if (imd.ShowDialog(this) == DialogResult.OK)
            {
                if (imd.Background != null)
                {
                    if (imd.UseForAll)
                    {
                        foreach (SongPart t in Song.Parts)
                        {
                            foreach (SongSlide t1 in t.Slides)
                            {
                                t1.Background = imd.Background;
                            }
                        }
                    }
                    else
                    {
                        Song.Parts[CurrentPartId].Slides[CurrentSlideId].Background = imd.Background;
                    }
                }
                else
                {
                    if (imd.UseForAll)
                    {
                        foreach (SongPart t in Song.Parts)
                        {
                            foreach (SongSlide t1 in t.Slides)
                            {
                                t1.Background = TemplateMapper.GetDefaultBackground();
                            }
                        }
                    }
                    else
                    {
                        Song.Parts[CurrentPartId].Slides[CurrentSlideId].Background = TemplateMapper.GetDefaultBackground();
                    }
                }
                PreviewSlide();
            }
        }
        public VisorPrincipal()
        {
            InitializeComponent();

            this.buttonCancel.Enabled = false;

            m_ImageDialog = new ImageDialog();

            m_AddImageDelegate = new DelegateAddImage(this.AddImage);

            m_Controller = new ThumbnailController();
            m_Controller.OnStart += new ThumbnailControllerEventHandler(m_Controller_OnStart);
            m_Controller.OnAdd += new ThumbnailControllerEventHandler(m_Controller_OnAdd);
            m_Controller.OnEnd += new ThumbnailControllerEventHandler(m_Controller_OnEnd);
        }
Пример #9
0
        private void BtnBrowse_Click(object sender, EventArgs e)
        {
            string temp = Directory.GetCurrentDirectory();

            try
            {
                ImageDialog.ShowDialog();
                PicLogoImage.Image = Image.FromFile(ImageDialog.FileName);
            }
            catch
            {
                ImageDialog.FileName = "";
            }
            Directory.SetCurrentDirectory(temp);
        }
Пример #10
0
        private void tobMagnifyImage_Click(object sender, EventArgs e)
        {
            m_ActiveImageViewerCtrl.IsActive = true;

            //if (m_ImageDialog.IsDisposed)

            ArrayList oImageValues = new ArrayList();

            oImageValues.Add(m_ActiveImageViewerCtrl.ImageNumber);
            oImageValues.Add(m_ActiveImageViewerCtrl.ImageBytes);
            oImageValues.Add(m_ActiveImageViewerCtrl.TempImageLocation);

            m_ImageDialog = new ImageDialog(MaximizedImageSize(), oImageValues);
            if (!m_ImageDialog.Visible)
            {
                m_ImageDialog.Show();
            }

            m_ImageDialog.SetImage(m_ActiveImageViewerCtrl.ImageLocation);
        }
Пример #11
0
 public AnalyzePage()
 {
     _imageDialog = new ImageDialog();
     _identify    = new Identify();
     InitializeComponent();
 }
Пример #12
0
        public ShowAllStudentViewModel()
        {
            TabTitle = "Show Students";
            Application.Current.Dispatcher.InvokeAsync(() =>
            {
                UserControl = new ShowAllStudent()
                {
                    DataContext = this
                };
            });

            SchoolObjContext Context = new SchoolObjContext();

            AllStudents = new ObservableCollection <object>(Context.Students.Join(
                                                                Context.Standards,
                                                                s => s.StandardId,
                                                                std => std.StandardId,
                                                                (s, std) => new
            {
                Student      = s,
                StandardName = std.StandardName
            }
                                                                ).ToList());

            RemoveRecordCommand = new RelayCommand(x => RemoveRecord());
            EditStudentCommand  = new RelayCommand(x => EditStudent(x));
            ShowResultCommand   = new RelayCommand(x =>
            {
                var Student = Context.Students.Where(s => s.StudentId == (int)x).FirstOrDefault();
                if (Student == null)
                {
                    return;
                }
                var check = (from sheet in Context.AllMarks
                             where sheet.StudentId == Student.StudentId && sheet.StandardId == Student.StandardId
                             select sheet).FirstOrDefault();
                if (check == null)
                {
                    if (MessageBox.Show("Result not available yet, click 'Yes' to generate", "Result not available", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
                    {
                        MainViewModel.Tabs.Add(new ViewModels.ResultViewModel((int)CurrentItem.Student.StudentId, 0, true));
                        return;
                    }
                }
                else
                {
                    MainViewModel.Tabs.Add(new ViewModels.ResultViewModel((int)CurrentItem.Student.StudentId));
                }
            });
            ShowDocumentCommand = new RelayCommand(x =>
            {
                var stud = x as EntityDatabase.DomainClasses.Student;
                if (stud.DocType.Equals("photo", StringComparison.InvariantCultureIgnoreCase))
                {
                    ImageDialog imageDialog = new ImageDialog(stud);
                    imageDialog.ShowDialog();
                }
                else
                {
                    var Dialog = new SaveFileDialog()
                    {
                        Filter   = "PDF file (*.pdf)|*.pdf",
                        FileName = "Document.pdf"
                    };
                    if (Dialog.ShowDialog() == false)
                    {
                        return;
                    }

                    using (Stream file = File.OpenWrite(@Dialog.FileName))
                    {
                        file.Write(stud.Doc, 0, stud.Doc.Length);
                    }
                }
            });
        }
Пример #13
0
    private void OnGUI()
    {
        #region AlertDialog
        if (GUILayout.Button("AlertDialog"))
        {
            //加载一个AlertDialog
            AlertDialog aDialog = DialogBuilder.GetDialog(UiType.AlertDialog) as AlertDialog;
            //内容
            aDialog.SetTitle("test标题")
            .SetMessage("这是test的内容")
            .SetNegativeButton("取消", () =>
            {
                Debug.Log("Click Negative Button");
            })
            .SetPositiveButton("确定", () =>
            {
                Debug.Log("Click Positive Button");
            });
            //设置动画类型
            aDialog.SetAnimation(UiAnimationType.Zoom, 0.5f, UiAnimationType.Zoom, 0.5f);
            aDialog.Show();
        }
        #endregion

        #region InputDialog

        if (GUILayout.Button("InputDialog"))
        {
            InputDialog iDialog = DialogBuilder.GetDialog(UiType.InputDialog) as InputDialog;
            iDialog.SetTitle("请输入一个数字")
            .SetInputType(UnityEngine.UI.InputField.ContentType.IntegerNumber)
            .SetCloseButton(() =>
            {
                Debug.Log("关闭输入框");
            })
            .SetConfirmButton((string inputStr) =>
            {
                Debug.Log(string.Format("你输入了{0}", inputStr));
            });
            iDialog.Show();
        }

        #endregion

        #region MessageBox

        if (GUILayout.Button("MessageBox"))
        {
            MessageBox mbox = DialogBuilder.GetDialog(UiType.MessageBox) as MessageBox;
            mbox.SetMsg("这是一个小的小的小的消息框")
            .SetShowTime(1.5f)
            .SetCloseAction(() => { Debug.Log("MessageBox关闭了"); });
            mbox.Show();
        }

        #endregion

        #region ListChooseDialog

        if (GUILayout.Button("ListChooseDialog"))
        {
            ListChooseDialog lcDialog = DialogBuilder.GetDialog(UiType.ListChooseDialog) as ListChooseDialog;
            string[]         lsList   = { "香蕉", "苹果", "葡萄" };
            lcDialog.SetTitle("请选择你最喜欢的水果")
            .SetDropList(lsList)
            .SetConfirmAction((int x) =>
            {
                Debug.Log("你最喜欢的水果是:" + lsList[x]);
            });
            lcDialog.Show();
        }

        #endregion

        #region ProgressDialog

        if (GUILayout.Button("ProgressDialog"))
        {
            ProgressDialog pDialog = DialogBuilder.GetDialog(UiType.ProgressDialog) as ProgressDialog;
            pDialog.SetTitle("加载中,请稍等");
            pDialog.SetCompletedAction(() =>
            {
                Debug.Log("加载完成了");
                CancelInvoke("updatePrograssDialog");
            });
            pDialog.Show();
            float val = 0;
            DOTween.To(() => val, x => val = x, 1, 5).OnUpdate(() =>
            {
                pDialog.UpdateSlider(val);
            });
        }

        #endregion

        #region WaitBox

        if (GUILayout.Button("WaitBox"))
        {
            WaitBox wBox = DialogBuilder.GetDialog(UiType.WaitBox) as WaitBox;
            wBox.SetRotateSpeed(10)
            .SetWaitTime(5)
            .SetEndAction(() =>
            {
                Debug.Log("等待结束");
            });
            wBox.Show();
        }

        #endregion

        #region CountDownBox

        if (GUILayout.Button("CountDownBox"))
        {
            CountDownBox cdBox = DialogBuilder.GetDialog(UiType.CountDownBox) as CountDownBox;
            cdBox.SetCountShowTime(24, 0, 0)
            .SetCountWaitTime(20)
            .SetOverAction(() => { Debug.Log("计时结束"); });
            cdBox.Show();
        }

        #endregion

        #region ImageDialog

        if (GUILayout.Button("ImageDialog"))
        {
            //网络图片
            //List<ImageModel> images = new List<ImageModel>();
            //images.Add(new ImageModel("图片1", "http://www.bavlo.com/NewsImage/20120601205840_495.png"));
            //images.Add(new ImageModel("图片2", "http://img13.360buyimg.com/n0/jfs/t1978/18/1896890800/23165/d53299e/56812e0cNe1676e78.jpg"));
            //images.Add(new ImageModel("图片3", "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1516956451402&di=d836b57e165b8a09edf273136f398ce5&imgtype=0&src=http%3A%2F%2Fpic34.photophoto.cn%2F20150104%2F0005018399195651_b.jpg"));
            //本地图片
            List <ImageModel> images = new List <ImageModel>();
            images.Add(new ImageModel("unity800x300", Application.dataPath + "/Assets/imgs/unity800x300.png"));
            images.Add(new ImageModel("unity900x1200", Application.dataPath + "/Assets/imgs/unity900x1200.png"));
            images.Add(new ImageModel("unity1060x500", Application.dataPath + "/Assets/imgs/unity1060x500.png"));
            images.Add(new ImageModel("unity1070x800", Application.dataPath + "/Assets/imgs/unity1070x800.png"));
            images.Add(new ImageModel("unity2000x300", Application.dataPath + "/Assets/imgs/unity2000x300.png"));

            ImageDialog iDialog = DialogBuilder.GetDialog(UiType.ImageDialog) as ImageDialog;
            iDialog.SetTitle("图片")
            .SetCloseAction(() =>
            {
                Debug.Log("close image Dialog");
            })
            .SetImageList(images)
            .SetAnimation(UiAnimationType.Zoom, 1f, UiAnimationType.Zoom, 1f);
            iDialog.Show();
        }

        #endregion

        #region VideoDialog

        if (GUILayout.Button("VideoDialog"))
        {
            VideoDialog vDialog = DialogBuilder.GetDialog(UiType.VideoDialog) as VideoDialog;
            vDialog.SetAnimation(UiAnimationType.Zoom, 1, UiAnimationType.Zoom, 1);
            vDialog.Show();
        }

        #endregion
    }
        private void imageViewer_MouseClick(object sender, MouseEventArgs e)
        {
            if (m_ActiveImageViewer != null)
            {
                m_ActiveImageViewer.IsActive = false;
            }

            m_ActiveImageViewer = (ImageViewer)sender;
            m_ActiveImageViewer.IsActive = true;

            if (m_ImageDialog.IsDisposed) m_ImageDialog = new ImageDialog();
            if (!m_ImageDialog.Visible) m_ImageDialog.Show();

            m_ImageDialog.SetImage(m_ActiveImageViewer.ImageLocation);
        }