Ejemplo n.º 1
0
 private void textBlock_TargetUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
 {
     if (!string.IsNullOrEmpty(this.textBlock.Text))
     {
         StopFadingOut();
     }
 }
Ejemplo n.º 2
0
        private void imageBeingViewed_TargetUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
        {
            var image = ((Image)e.Source).Source as BitmapImage;

            if (image == null)
            {
                return;
            }

            var flipViewWitdth = flipViewImages.ActualWidth;
            var flipViewHeight = flipViewImages.ActualHeight;
            var imageWidth     = image.PixelWidth;
            var imageHeight    = image.PixelHeight;
            var canvasCustom   = ControlHelper.RecurseChildren <CropSelectionCanvas>(flipViewImages).First();

            var ratioWidth  = flipViewWitdth / imageWidth;
            var ratioHeight = flipViewHeight / imageHeight;

            _ratio = ratioWidth > ratioHeight ? ratioWidth : ratioHeight;

            if (_ratio < 1.0)
            {
                sliderZoom.Minimum = _ratio;
                sliderZoom.Value   = _ratio;
            }
            else
            {
                _ratio             = 1;
                sliderZoom.Minimum = 1;
                sliderZoom.Value   = 1;
            }
        }
Ejemplo n.º 3
0
 private void KeyList_TargetUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
 {
     if (KeyList.Items.Count > 0)
     {
         KeyList.ScrollIntoView(KeyList.Items[0]);
     }
 }
 private async void Image_TargetUpdated(object?sender, System.Windows.Data.DataTransferEventArgs e)
 {
     if (!(sender is Image image))
     {
         return;
     }
     await image.FadeIn(false);
 }
Ejemplo n.º 5
0
 private void AssociatedObject_TargetUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
 {
     //e.Handled = tr
     if (IsProcessing)
     {
         ScrollIntoView();
     }
 }
Ejemplo n.º 6
0
 private void ZoomToFit(object sender, System.Windows.Data.DataTransferEventArgs e)
 {
     if (AlbumArt != null && AlbumArt.Image != null && !Double.IsNaN(AlbumArt.Image.PixelWidth) && !Double.IsNaN(AlbumArt.Image.PixelHeight))
     {
         double fitHorizontal = mImageScroller.ViewportWidth / AlbumArt.Image.PixelWidth;
         double fitVertical   = mImageScroller.ViewportHeight / AlbumArt.Image.PixelHeight;
         Zoom = Math.Min(fitHorizontal, fitVertical);
     }
 }
Ejemplo n.º 7
0
        static void im_SourceUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
        {
            FileStream        filestream = new FileStream(@"c:\temp\pict.jpg", FileMode.Create);
            JpegBitmapEncoder encoder    = new JpegBitmapEncoder();

            encoder.Frames.Add(BitmapFrame.Create(actual));
            encoder.Save(filestream);
            filestream.Dispose();
        }
Ejemplo n.º 8
0
        private void Logo_TargetUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
        {
            // This event is tied to the background image that appears in each probe window.
            // After a probe is started, this event removes the image from the ItemsControl.
            var image = (sender as Image);

            if (image.Visibility == Visibility.Collapsed)
            {
                image.Visibility = Visibility.Collapsed;
                image.Source     = null;
            }
        }
        /// <summary>
        /// Scroll to the bottom of the TextBlock
        /// </summary>
        /// <param name="sender">object who fired this event</param>
        /// <param name="e">NOT USED</param>
        private void _ScrollToBottom(object sender, System.Windows.Data.DataTransferEventArgs e)
        {
            TextBox tb;

            if (null == (tb = sender as TextBox))
            {
                // do nothing
            }
            else
            {
                tb.Select(tb.Text.Length, 0);
            }
        }
Ejemplo n.º 10
0
        private void txtName_SourceUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
        {
            int    i        = 2;
            var    server   = lstServers.SelectedItem as ServerElement;
            string origName = server.Name;

            while (App.Settings.Current.Servers.OfType <ServerElement>().Any((s) => s.Name == server.Name && s != server))
            {
                server.Name = origName + " " + i++;
            }
            txtName.Text = server.Name;
            lstServers.Items.Refresh();
        }
Ejemplo n.º 11
0
 /// <summary>
 /// 出力帳票が変更された時のイベント処理(ラジオボタンクリック)
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void rdo出力帳票_TargetUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
 {
     if (this.rdo出力帳票.Text == "0")
     {
         this.FiscalYear.IsEnabled = true;
         this.txt作成月.IsEnabled     = false;
     }
     else if (this.rdo出力帳票.Text == "1")
     {
         this.FiscalYear.IsEnabled = false;
         this.txt作成月.IsEnabled     = true;
     }
 }
        private void MainGrid_TargetUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
        {
            var grid = (Grid)e.TargetObject;
            var b    = (bool?)grid.Tag;

            if (b == true)
            {
                VisualStateManager.GoToElementState(grid, "IsLoading", true);
            }
            else
            {
                VisualStateManager.GoToElementState(grid, "Ready", true);
            }
        }
Ejemplo n.º 13
0
        private void ComboBox_TargetUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
        {
            ComboBox     suppliers = (ComboBox)sender;
            ProductToBuy product   = suppliers.BindingGroup.Items[0] as ProductToBuy;

            if (product.idProveedor == 0)
            {
                suppliers.SelectedIndex = 0;
            }
            else
            {
                suppliers.SelectedValue = product.idProveedor;
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Called when the output file textbox is changed either through the Browse button
        /// or manually by typing into the box.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OutputFileBox_Changed(object sender, System.Windows.Data.DataTransferEventArgs e)
        {
            try
            {
                string filename = OutputFileBox.Text;
                if (Directory.Exists(filename))
                {
                    // Missing filename -- add the input file, or default.
                    string inputFileName;
                    if (!string.IsNullOrEmpty(InputFileBox.Text))
                    {
                        inputFileName = Path.GetFileName(InputFileBox.Text);
                    }
                    else
                    {
                        inputFileName = "readsimulator";
                    }
                    OutputFileBox.Text = Path.Combine(filename,
                                                      Path.GetFileNameWithoutExtension(inputFileName) + "_out.fa");
                    return;
                }

                // Has filename, use existing filename
                string directory = Path.GetDirectoryName(filename);
                if (string.IsNullOrEmpty(directory) || !Directory.Exists(directory))
                {
                    MessageBox.Show("Selected Output directory and filename is not valid.", this.Title,
                                    MessageBoxButton.OK,
                                    MessageBoxImage.Error);
                }

                // Add our extension if one is not supplied.
                filename = Path.GetFileName(filename);
                if (Path.GetExtension(filename) == string.Empty)
                {
                    OutputFileBox.Text += "_out.fa";
                }
            }
            finally
            {
                if (!string.IsNullOrEmpty(OutputFileBox.Text) && File.Exists(OutputFileBox.Text))
                {
                    MessageBox.Show(
                        OutputFileBox.Text +
                        " is an existing file. It will be overwritten by the generated output files if you run the simulator using this output. Change the filename or directory if you do not wish to overwrite this file.",
                        this.Title, MessageBoxButton.OK, MessageBoxImage.Warning);
                }
            }
        }
Ejemplo n.º 15
0
 private void FilePath_Changed(object sender, System.Windows.Data.DataTransferEventArgs e)
 {
     try
     {
         var text = (sender as TextBlock)?.Text;
         if (!string.IsNullOrEmpty(text))
         {
             Dispatcher.BeginInvoke((Action)(() => MapTabControl.SelectedIndex = 0));
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
 }
        private void DataGridTracks_TargetUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
        {
            if (e.Property == DataGrid.ItemsSourceProperty)
            {
                CollectionUtils.GetColumnSorting(out string sortMemberPath, out ListSortDirection sortDirection);

                if (!string.IsNullOrEmpty(sortMemberPath))
                {
                    this.Dispatcher.BeginInvoke((Action) delegate()
                    {
                        // Sorting is incorrect when not done via dispatcher. Probably it happens too soon.
                        this.SortDataGrid(this.DataGridTracks, sortMemberPath, sortDirection);
                    }, null);
                }
            }
        }
Ejemplo n.º 17
0
        private void AssociatedObject_TargetUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
        {
            if (!String.IsNullOrEmpty(AssociatedObject.Text) && AssociatedObject.IsVisible)
            {
                string value = AssociatedObject.Text.TrimEnd('°');

                if (Int32.Parse(value) > 35)
                {
                    MessageBox.Show("Температура превысила допустимы значения! Температура: " + AssociatedObject.Text,
                                    "Предупреждение", MessageBoxButton.OK, MessageBoxImage.Exclamation);

                    AssociatedObject.Foreground = Brushes.Crimson;
                }
                else
                {
                    AssociatedObject.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#2195f2"));
                }
            }
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Called when the input file textbox is changed either through the Browse button
        /// or by typing into the box.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void InputFileBox_Changed(object sender, System.Windows.Data.DataTransferEventArgs e)
        {
            string inputFileName = InputFileBox.Text;

            if (!string.IsNullOrEmpty(inputFileName) && LoadInputFile(inputFileName))
            {
                SimulationButton.IsEnabled = true;

                if (String.IsNullOrEmpty(OutputFileBox.Text) && File.Exists(inputFileName))
                {
                    OutputFileBox.Text = Path.Combine(
                        Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
                        Path.GetFileNameWithoutExtension(inputFileName) + "_out.fa");
                }
            }
            else
            {
                SimulationButton.IsEnabled = false;
            }
        }
Ejemplo n.º 19
0
        /// <summary>
        /// 売上先が変更された時のイベント処理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void rdo売上先_TargetUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
        {
            this.txt得意先.Text1 = string.Empty;
            this.txt得意先.Text2 = string.Empty;

            // 得意先
            if (this.rdo売上先.Text == "0")
            {
                this.txt得意先.LinkItem = "0,3";
            }
            // 販社
            else if (this.rdo売上先.Text == "1")
            {
                this.txt得意先.LinkItem = "4";
            }
            // 両方
            else
            {
                this.txt得意先.LinkItem = "0,3,4";
            }
        }
Ejemplo n.º 20
0
        private void TextBlock_TargetUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
        {
            string strMsg = (sender as TextBlock).Text;

            if (string.IsNullOrEmpty(strMsg))
            {
                return;
            }
            else if (strMsg.ToUpper().StartsWith("ERROR") || strMsg.ToUpper().StartsWith("WARNING"))
            {
                (sender as TextBlock).Foreground = Brushes.White;
                (sender as TextBlock).Background = Brushes.Red;
            }
            else
            {
                (sender as TextBlock).Foreground = Brushes.Black;
                (sender as TextBlock).ClearValue(TextBlock.BackgroundProperty);
            }

            (sender as TextBlock).ToolTip = strMsg;
        }
Ejemplo n.º 21
0
        private void TxtIProceduresID_TargetUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
        {
            if (this.MyViewModel == null)
            {
                return;
            }
            int IProId;

            int.TryParse(txtIProceduresID.Text.ToString(), out IProId);


            dhProcedure ObjInv = this.MyViewModel.db.Procedures.Where(I => I.BIsActive == true && I.IProcedureId == IProId).FirstOrDefault();

            //iFacede.GetdhItem(Globalized.ObjDbName, new dhItems { IItemID = Convert.ToInt32(ItemList.SelectedValue) });
            //ObjDhItem.IQuantity = 0;
            // creat the new object of doctor investigation
            if (ObjInv == null)
            {
                return;
            }

            dhDocProcedures objDocProcedure = new dhDocProcedures();

            objDocProcedure.IProcedureId      = IProId;
            objDocProcedure.IDocid            = this.MyViewModel.ObjNewDoctor.IDocid;
            objDocProcedure.VProcedureName    = ObjInv.VProcedureName;
            objDocProcedure.VProcedureDesc    = ObjInv.VProcedureDesc;
            objDocProcedure.IProcedureCharges = ObjInv.IProCharges;
            this.MyViewModel.ObjNewDoctor.DocProcedures.Add(objDocProcedure);

            // update the source
            this.DocProcedures.ItemsSource = this.MyViewModel.ObjNewDoctor.DocProcedures;


            // clear the source
            // this.InvestigationList.SelectedItem = null;
            // this.InvestigationList.SelectedValue = "";

            //this.InvestigationList
        }
Ejemplo n.º 22
0
 private void PlaceHolder_SourceUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
 {
     Debug.WriteLine(GetCurrentMethod());
 }
Ejemplo n.º 23
0
        //--------------------------------------------------------------------------------------------------

        #region Value Commit

        protected virtual void OnSourceUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
        {
            CommmitChange();
        }
Ejemplo n.º 24
0
 private void RichTextBlock_TargetUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
 {
     e.Handled = true;
 }
Ejemplo n.º 25
0
 private void SolidColorBrush_SourceUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
 {
 }
Ejemplo n.º 26
0
 private void Window_SourceUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
 {
 }
Ejemplo n.º 27
0
 private void ItemSelect_TargetUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
 {
     ItemSelect.SelectedIndex = 0;
 }
Ejemplo n.º 28
0
 private async void Image_TargetUpdatedAsync(object sender, System.Windows.Data.DataTransferEventArgs e) =>
 // Fade in image
 await(sender as Image).FadeInAsync(false);
Ejemplo n.º 29
0
 private void LstvDownloads_SourceUpdatedEventHandler(object sender, System.Windows.Data.DataTransferEventArgs e)
 {
     lstvDownloads.Items.Refresh();
 }
Ejemplo n.º 30
0
 private void LinearXAxis_TargetUpdated(object sender, System.Windows.Data.DataTransferEventArgs e)
 {
 }