private void RbChecked(object sender, RoutedEventArgs e)
        {
            double price = rbSell.IsChecked != null && (bool)rbSell.IsChecked
                               ? ClipboardTools.GetSellPrice(_sell, profile)
                               : ClipboardTools.GetBuyPrice(_buy, profile);

            ClipboardTools.SetClipboardWrapper(price);
        }
        private void FileSystemWatcherOnCreated(object sender, FileSystemEventArgs fileSystemEventArgs)
        {
            Dispatcher.Invoke(new Action(delegate
            {
                lblItemName.Content = "Fetching...";
                lblItemName.ToolTip = string.Empty;

                if (cbAutoCopy.IsChecked != null && (bool)cbAutoCopy.IsChecked)
                {
                    var img = new BitmapImage();
                    img.BeginInit();
                    img.UriSource = new Uri("pack://application:,,,/Elinor;component/Images/38_16_195.png");
                    img.EndInit();
                    imgCopyStatus.Source = img;
                }
            }));

            _lastEvent = fileSystemEventArgs;
            while (MiscTools.IsFileLocked(new FileInfo(fileSystemEventArgs.FullPath)))
            {
                Thread.Sleep(25);
            }
            if (fileSystemEventArgs.ChangeType == WatcherChangeTypes.Created &&
                fileSystemEventArgs.Name.EndsWith(".txt"))
            {
                ProcessData(fileSystemEventArgs.FullPath);
            }

            Dispatcher.Invoke(new Action(delegate
            {
                if (cbAutoCopy.IsChecked != null && (bool)cbAutoCopy.IsChecked)
                {
                    bool isSell = rbSell.IsChecked != null && (bool)rbSell.IsChecked;

                    if (rbSell.IsChecked != null && (bool)rbSell.IsChecked)
                    {
                        ClipboardTools.SetClipboardWrapper(
                            ClipboardTools.GetSellPrice(_sell, profile));
                    }
                    else if (rbBuy.IsChecked != null && (bool)rbBuy.IsChecked)
                    {
                        ClipboardTools.SetClipboardWrapper(
                            ClipboardTools.GetBuyPrice(_buy, profile));
                    }


                    var img = new BitmapImage();
                    img.BeginInit();
                    img.UriSource = (isSell && _sell > 0) || (!isSell && _buy > 0)
                            ? new Uri("pack://application:,,,/Elinor;component/Images/38_16_193.png")
                            : new Uri("pack://application:,,,/Elinor;component/Images/38_16_194.png");
                    img.EndInit();
                    imgCopyStatus.Source = img;
                }
            }));

            UpdateStatus();
        }
 private void LblBuyMouseDown(object sender, MouseButtonEventArgs e)
 {
     ClipboardTools.SetClipboardWrapper(ClipboardTools.GetBuyPrice(_buy, profile));
 }