Inheritance: System.Windows.Controls.Control
        public AddinViewer()
        {
            Xceed.Wpf.Toolkit.MessageBox        ss = new Xceed.Wpf.Toolkit.MessageBox();
            Xceed.Wpf.Toolkit.AutoSelectTextBox at = new AutoSelectTextBox();
            // ColorZoneAssist.SetMode(new CheckBox(), ColorZoneMode.Accent);
            //Hue hue = new Hue("xyz", System.Windows.Media.Color.FromArgb(1, 2, 3, 4), System.Windows.Media.Color.FromArgb(1, 5, 6, 7));

            //Du.Setting.DuSWExPathManager.LoadMaterialDesignDll();
            //Du.Setting.DuSWExPathManager.LoadMaterialDesignDll();

            InitializeComponent();
            //判断是否以管理员权限运行
            //if (Du.Setting.DuSWExPathManager.IsAdministrator())
            //{
            //    viewmodel = new AddinViewerViewModel();

            //    DataContext = viewmodel;

            //    AdminInfo.Visibility = Visibility.Collapsed;

            //}
            //else
            //{
            //    AdminInfo.Visibility = Visibility.Visible;
            //}
        }
Beispiel #2
0
        private void OpenMenuItem_Click(object sender, RoutedEventArgs e)
        {
            var openDialog = new FolderBrowserDialog
            {
                BrowseFiles  = false,
                BrowseShares = true,
                Title        = "Select an ECMA XML documentation directory:"
            };

            if (openDialog.ShowDialog(this) == true)
            {
                var docsDir = Path.Combine(openDialog.SelectedPath, "en");
                if (Directory.Exists(docsDir) && File.Exists(Path.Combine(docsDir, "index.xml")))
                {
                    // save the last opened docs
                    Settings.Default.LastUsedPath = docsDir;
                    Settings.Default.Save();

                    OpenDirectory(docsDir);
                }
                else
                {
                    MessageBox.Show(
                        "The selected directory is not the toplevel directory for ECMA XML documentation. Those should contain a subdirectory 'en' and a file 'en\\index.xml'",
                        "Not an ECMA XML Documentation Directory",
                        MessageBoxButton.OK,
                        MessageBoxImage.Error);
                }
            }
        }
 private void tbEancode_LostFocus(object sender, RoutedEventArgs e)
 {
     if ((tbEancode.Text.Length > 13 || tbEancode.Text.Length < 13) && tbEancode.Text != "")
     {
         MessageBox.Show("Eancode moet altijd uit 13 characters bestaan");
         tbEancode.Text = "";
     }
 }
Beispiel #4
0
        private void btnHistory_Click(object sender, RoutedEventArgs e)
        {
            string email = tbEmail.Text;

            if (string.IsNullOrEmpty(email))
            {
                MSB.Show("Nieustawiony email.", "Historia zamówień", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            var dr = MSB.Show("Zostanie wysłany email na wskazany adres z tokenem, który należy uzupełnić?", "Historia zamówień", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (dr != MessageBoxResult.Yes)
            {
                return;
            }

            bool historyLock = true;

            try
            {
                Random r     = new Random();
                string token = r.Next(99999).ToString().PadLeft(5, '0');

                new Resender().SendToken(email, token);
                MSB.Show("Email wysłany.", "Historia zamówień", MessageBoxButton.OK, MessageBoxImage.Information);

                while (true)
                {
                    InputWindow input       = new InputWindow("Wprowadź token");
                    var         inputResult = input.ShowDialog();
                    if (inputResult == false)
                    {
                        historyLock = true;
                        break;
                    }
                    if (input.Value == token)
                    {
                        historyLock = false;
                        break;
                    }
                    else
                    {
                        MSB.Show("Błędny token. Spróbuj jeszcze raz.", "Historia zamówień", MessageBoxButton.OK, MessageBoxImage.Warning);
                    }
                }
            }
            catch (Exception ex)
            {
                MSB.Show(ex.Message, "Historia zamówień", MessageBoxButton.OK, MessageBoxImage.Error);
            }

            if (!historyLock)
            {
                OrdersHistory history = new OrdersHistory(email);
                history.Show();
            }
        }
 public SelectionInfo()
 {
     //预加载程序集
     Xceed.Wpf.Toolkit.MessageBox ms = new Xceed.Wpf.Toolkit.MessageBox();
     InitializeComponent();
     //绑定viewmodel上下文
     viewModel   = new Du.ViewModel.SelectionInfoViewModel();
     DataContext = viewModel;
 }
Beispiel #6
0
 private void MessagePopup_Closed(object sender, EventArgs e)
 {
     Xceed.Wpf.Toolkit.MessageBox m = sender as Xceed.Wpf.Toolkit.MessageBox;
     if ((MessageType)m.Resources["type"] == MessageType.DeleteItems && m.MessageBoxResult == MessageBoxResult.Yes)
     {
         int index = Paths.SelectedIndex;
         DeleteAt(index);
     }
 }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this._modalBackgroundColorPicker = ((Xceed.Wpf.Toolkit.ColorPicker)(target));
                return;

            case 2:
                this._childWindowCheckBox = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 3:
                this._modalChildWindowCheckBox = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 4:
                this._messageBoxCheckBox = ((System.Windows.Controls.CheckBox)(target));

            #line 85 "..\..\..\..\..\..\Samples\Window\Views\WindowContainerView.xaml"
                this._messageBoxCheckBox.Checked += new System.Windows.RoutedEventHandler(this.OnMessageBoxCheckBoxChecked);

            #line default
            #line hidden

            #line 85 "..\..\..\..\..\..\Samples\Window\Views\WindowContainerView.xaml"
                this._messageBoxCheckBox.Unchecked += new System.Windows.RoutedEventHandler(this.OnMessageBoxCheckBoxUnchecked);

            #line default
            #line hidden
                return;

            case 5:
                this._windowContainer = ((Xceed.Wpf.Toolkit.Primitives.WindowContainer)(target));
                return;

            case 6:
                this._childWindow = ((Xceed.Wpf.Toolkit.ChildWindow)(target));
                return;

            case 7:
                this._modalChildWindow = ((Xceed.Wpf.Toolkit.ChildWindow)(target));
                return;

            case 8:
                this._messageBox = ((Xceed.Wpf.Toolkit.MessageBox)(target));

            #line 149 "..\..\..\..\..\..\Samples\Window\Views\WindowContainerView.xaml"
                this._messageBox.Closed += new System.EventHandler(this.OnMessageBoxClose);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
        private void OnStyleableWindow_Click(object sender, RoutedEventArgs e)
        {
            var msgBox = new Xceed.Wpf.Toolkit.MessageBox();

            msgBox.DataContext = this.DataContext;
            msgBox.Text        = StyleableWindowMessage;
            msgBox.Caption     = StyledMsgBoxTitle;
            msgBox.Style       = (_enableStyleCheckBox.IsChecked.GetValueOrDefault()) ? ( Style )this.Resources[MessageBoxStyleKey] : null;
            msgBox.ShowDialog();
        }
 private void StyledMessageBoxButton_Click( object sender, RoutedEventArgs e )
 {
   var msgBox = new Xceed.Wpf.Toolkit.MessageBox();
   msgBox.DataContext = this.DataContext;
   msgBox.Text = StyledMsgBoxMessage;
   msgBox.Caption = StyledMsgBoxTitle;
   if( _enableStyleCheckBox.IsChecked.GetValueOrDefault() ) 
   {
     msgBox.Style = ( Style )this.Resources[ MessageBoxStyleKey ];
   }
   msgBox.ShowDialog();
 }
Beispiel #10
0
 private void ShowMessageBox(string text, string caption, MessageBoxButton button = MessageBoxButton.OK,
                             MessageBoxImage icon    = MessageBoxImage.None, MessageBoxResult defaultResult = MessageBoxResult.None,
                             MessageType specialType = MessageType.None)
 {
     Xceed.Wpf.Toolkit.MessageBox popup = new Xceed.Wpf.Toolkit.MessageBox();
     popup.CaptionForeground = gray;
     popup.Closed           += MessagePopup_Closed;
     popup.Closed           += PopupClosed;
     popup.Resources["type"] = specialType;
     DialogArea.Children.Add(popup);
     popup.ShowMessageBox(text, caption, button, icon, defaultResult);
 }
        private void generateReportButton_Click(object sender, RoutedEventArgs e)
        {
            Dictionary <string, string> data = new Dictionary <string, string>();

            if (firefighters.calcTimeSpent(true) &&
                getGlobalData(ref data))
            {
                var pdfGen = new SalaryReport(data, this.firefighters);
                pdfGen.openCreated();
            }
            else
            {
                MessageBox.Show("Nie wszystkie dane są poprawnie uzupełnione.");
            }
        }
    //public Texture2D GetTextureFromFileIndex(int index)
    //{
    //    if (fileInfos == null || index >= fileInfos.Length)
    //        return null;

    //    return GetTextureFromFileInfo(fileInfos[index]);
    //}

    public BitmapImage GetBitmapFromFileInfo(FileInfo fileInfo)
    {
        BitmapImage bi = new BitmapImage();

        bi.BeginInit();
        bi.UriSource = new Uri(fileInfo.FullName);
        bi.EndInit();

        if (bi == null)
        {
            MessageBox.Show("Something is wrong with the processed Texture named " + fileInfo.Name, "", MessageBoxButton.OK, MessageBoxImage.Error);
            return(null);
        }

        return(bi);
    }
Beispiel #13
0
        public SolidWorksInfoView()
        {
            Xceed.Wpf.Toolkit.MessageBox ms = new Xceed.Wpf.Toolkit.MessageBox();

            InitializeComponent();

            //if (Du.Setting.DuSWExPathManager.IsAdministrator())
            //{
            //    viewmodel = new Du.ViewModel.SolidWorksInfoViewModel();
            //    DataContext = viewmodel;
            //    AdminInfo.Visibility = Visibility.Collapsed;
            //}
            //else
            //{
            //    AdminInfo.Visibility = Visibility.Visible;
            //}
        }
Beispiel #14
0
        private void CanvasPanel_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (IsMultiSelecting)
            {
                var geometry       = new RectangleGeometry(new Rect(SelectionSquareTopLeft, e.GetPosition(CanvasPanel)));
                var visualInRegion = CanvasPanel.GetVisuals(geometry);

                MessageBox.Show($"选中数量:{visualInRegion.Count}");
                IsMultiSelecting = false;
                CanvasPanel.RemoveVisual(SelectionSquare);
                CanvasPanel.ReleaseMouseCapture();
            }
            else
            {
                IsDragging = false;
            }
        }
        private void ApplyButton_Click(object sender, RoutedEventArgs e)
        {
            // save the configuration
            commonSet.SaveConfiguration();

            // apply the autostart setting
            commonSet.ApplyAutoStartSetting(AutoStartCheckBox.IsChecked.Value);

            // save the time of next printing
            commonSet.ComputeNextTime();
            commonSet.SaveNextTime();

            MessageBox.Show("Configuration saved");

            // update scheduled time
            commonSet.LoadNextTime();
            ScheduledTimeTextBlock.Text = commonSet.loadedNextPrintingTime.ToString();
        }
Beispiel #16
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (order.OrderItems.Count == 0)
            {
                MSB.Show("Brak produktów.", "Składanie zamówienia", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            if (string.IsNullOrEmpty(tbEmail.Text))
            {
                MSB.Show("Nieustawiony email.", "Składanie zamówienia", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            var dr = MSB.Show("Złożyć zamówienie?", "Składanie zamówienia", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (dr != MessageBoxResult.Yes)
            {
                return;
            }

            order.Date     = DateTime.Now;
            order.Email    = tbEmail.Text;
            order.Comments = tbComments.Text;

            try
            {
                service.AddOrder(order);
                MSB.Show("Zamównie przyjęte.", "Składanie zamówienia", MessageBoxButton.OK, MessageBoxImage.Information);

                new Resender().SendOrderMessage(order);
                MSB.Show("Email wysłany.", "Składanie zamówienia", MessageBoxButton.OK, MessageBoxImage.Information);
                order.EmailSent = true;
                service.SaveChanges();

                this.Close();
            }
            catch (Exception ex)
            {
                MSB.Show(ex.Message, "Składanie zamówienia", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
        private void btnBestandLaden_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter           = "Json Files(*.json)|*json";
            openFileDialog.InitialDirectory = System.AppDomain.CurrentDomain.BaseDirectory;
            openFileDialog.ShowDialog();
            string bestand = openFileDialog.FileName;

            if (bestand != "")
            {
                JObject jObject = JObject.Parse(File.ReadAllText(bestand));
                dynamic dynO    = jObject;

                Product ingeladenProduct = new Product();
                ingeladenProduct.EanCode       = dynO.EanCode;
                ingeladenProduct.Naam          = dynO.Naam;
                ingeladenProduct.Inkoopprijs   = dynO.Inkoopprijs;
                ingeladenProduct.Eenheid       = dynO.Eenheid;
                ingeladenProduct.BTW           = dynO.BTW;
                ingeladenProduct.LeverancierID = dynO.LeverancierID;

                if (ctx.Product.Where(p => p.EanCode == ingeladenProduct.EanCode).Count() != 0)
                {
                    var result = MessageBox.Show($"Er is reeds een product met Eannummer {ingeladenProduct.EanCode}. Wil je dit product aanpassen?", "", MessageBoxButton.YesNo);
                    if (result == MessageBoxResult.No)
                    {
                        this.Close();
                    }
                }

                tbEancode.Text     = ingeladenProduct.EanCode;
                tbNaam.Text        = ingeladenProduct.Naam;
                tbInkoopprijs.Text = ingeladenProduct.Inkoopprijs.ToString();
                tbEenheid.Text     = ingeladenProduct.Eenheid;
                cbBTW.SelectedItem = (short)ingeladenProduct.BTW;
                Leverancier geselecteerdeLeverancier = ctx.Leverancier.Where(l => l.LeverancierID == ingeladenProduct.LeverancierID).FirstOrDefault();
                lbLeverancier.SelectedItem = geselecteerdeLeverancier;
            }
        }
        private void tbEancode_TextChanged(object sender, TextChangedEventArgs e)
        {
            string eancode = tbEancode.Text;

            if (ctx.Product.Where(p => p.EanCode == eancode).Count() != 0 && isNieuwProduct)
            {
                var result = MessageBox.Show($"Er is reeds een product met Eannummer {eancode}. Wil je dit product aanpassen?", "", MessageBoxButton.YesNo);
                if (result == MessageBoxResult.No)
                {
                    tbEancode.Text = string.Empty;
                }
                else
                {
                    Product            product = ctx.Product.Where(p => p.EanCode == eancode).FirstOrDefault();
                    NieuwProductWindow window  = new NieuwProductWindow(product);
                    if ((bool)window.ShowDialog())
                    {
                        DialogResult = true;
                    }
                }
            }
        }
Beispiel #19
0
        public ImportModules()
        {
//            TODO: WORK PATH BELOW
            rootPath = @"D:\OOP\OOP\Lab1\PictureDraw\Modules";
            modules  = new List <Assembly>();
            var directory = new DirectoryInfo(rootPath);

            foreach (var file in directory.GetFiles("*.dll"))
            {
                try
                {
                    if (RSACrypt.VerifySignedHash(File.ReadAllBytes(file.FullName), File.ReadAllText(@"G:\public.xml")))
                    {
                        modules.Add(Assembly.LoadFrom(file.FullName));
                    }
                }
                catch
                {
                    MessageBox.Show($@"Sorry, but {rootPath}\{file} was damaged. Please, fix or remove it.", "Load error",
                                    MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Beispiel #20
0
        private void Window_Initialized(object sender, EventArgs e)
        {
            _proxy.NativeFeedReceived += ProxyOnNativeFeedReceived;
            _proxy.Start();

            MainGrid.DataContext = _vm;

            IEnumerable <DualShockProfile> list = null;

            try
            {
                list = _proxy.GetProfiles();
            }
            catch (Exception err)
            {
                MessageBox.Show($"Can't load profiles. Error {err.Message}");
            }
            if (list == null)
            {
                list = new List <DualShockProfile>();
            }

            _vm.Profiles = list.ToList();
        }
        private void btnOpslaan_Click(object sender, RoutedEventArgs e)
        {
            if (tbNaam.Text == "")
            {
                geldigeIngave = false;
            }
            if (tbEancode.Text == "")
            {
                geldigeIngave = false;
            }
            if (tbInkoopprijs.Value == null)
            {
                geldigeIngave = false;
            }
            if (tbEenheid.Text == "")
            {
                geldigeIngave = false;
            }
            if (cbBTW.SelectedIndex == -1)
            {
                geldigeIngave = false;
            }
            if (tbMarge.Value == null)
            {
                geldigeIngave = false;
            }
            if (cbCategorie.SelectedIndex == -1)
            {
                geldigeIngave = false;
            }
            if (lbLeverancier.SelectedIndex == -1)
            {
                geldigeIngave = false;
            }



            if (geldigeIngave)
            {
                geselecteerdProduct.Naam        = tbNaam.Text;
                geselecteerdProduct.EanCode     = tbEancode.Text;
                geselecteerdProduct.Inkoopprijs = tbInkoopprijs.Value;
                geselecteerdProduct.Eenheid     = tbEenheid.Text;
                geselecteerdProduct.BTW         = Convert.ToInt32((short)cbBTW.SelectedItem);
                geselecteerdProduct.Marge       = tbMarge.Value;
                categorie   = (Categorie)cbCategorie.SelectedItem;
                leverancier = (Leverancier)lbLeverancier.SelectedItem;
                geselecteerdProduct.CategorieID   = (int)categorie.CategorieID;
                geselecteerdProduct.LeverancierID = (int)leverancier.LeverancierID;

                var result = MessageBox.Show("Productgegevens opslaan?", "Gegevens opslaan?", MessageBoxButton.YesNo);
                if (result == MessageBoxResult.Yes)
                {
                    if (isNieuwProduct)
                    {
                        ctx.Product.Add(geselecteerdProduct);
                    }
                    ctx.SaveChanges();
                    DialogResult = true;
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("Gelieve alle velden correct in te vullen");
                geldigeIngave = true;
            }
        }