Exemplo n.º 1
0
 private void Open_button_Click(object sender, EventArgs e)
 {
     if (Scanning.IsBusy == false)
     {
         Scanning.RunWorkerAsync();
     }
 }
Exemplo n.º 2
0
        private void OnOpen()
        {
            DriveSelectResult result = Dialogs.ShowDriveSelect(WindowOwner);

            if (result != null)
            {
                Scanning.CloseAsync(() => Scanning.ScanAsync(result));
            }
        }
Exemplo n.º 3
0
        private void OnRefreshSelected()
        {
            HashSet <FileItemBase> filesToRefresh = new HashSet <FileItemBase>();

            IsolateRefreshableFiles(filesToRefresh, SelectedFiles.Select(f => f.Model));
            if (filesToRefresh.Count > 0)
            {
                Scanning.RefreshFilesAsync(filesToRefresh);
            }
        }
Exemplo n.º 4
0
        public static FfmpegCommand Create(string value)
        {
            switch (value)
            {
            case "AVI|MPEG2":
                FfmpegCommand aviresolution = new Resolution();
                FfmpegCommand aviaspect     = new AspectRatio();
                FfmpegCommand aviscanning   = new Scanning();
                aviresolution.SetSuccessor(aviaspect);
                aviaspect.SetSuccessor(aviscanning);
                return(aviresolution);

            case "MP4|WEBM":     // Don't need Scanning. Maybe need to add some other commands...
                FfmpegCommand mp4Resolution = new Resolution();
                FfmpegCommand mp4Aspect     = new AspectRatio();
                mp4Resolution.SetSuccessor(mp4Aspect);
                return(mp4Resolution);
                //Etc etc...
            }

            return(null);
        }
Exemplo n.º 5
0
        private void AddFileFromScanner_Clicked(object sender, EventArgs e)
        {
            Scanning scan = new Scanning();

            _parent.mainCanvas.Children.Add(scan);

            scan.ReadyButtonClicked += (s, ea) =>
            {
                FileModel file = new FileModel(scan.FileName, new ContentType(MimeTypes.MimeTypeMap.GetMimeType(".pdf")), scan.FileStream.Length, DateTime.Now, scan.FileStream.ToArray());

                file.Downloaded = true;
                AddFile(file);


                FileListContainer.Visibility = Visibility.Visible;
                _parent.mainCanvas.Children.Remove(scan);
            };

            scan.CancelButtonClicked += (s, ea) =>
            {
                _parent.mainCanvas.Children.Remove(scan);
            };
        }
Exemplo n.º 6
0
 public override bool HandleEvent(GetShortDescriptionEvent E)
 {
     if (this.stage > 0)
     {
         string debug = "";
         if (Scanning.HasScanningFor(XRLCore.Core.Game.Player.Body, Scanning.Scan.Bio))
         {
             int drams = 0;
             if (GetPuddle() != null)
             {
                 if (debugstring() == "thriving" || debugstring() == "dry")
                 {
                     drams = GetPuddle().Volume;
                 }
             }
             int count = drams * stageLength;
             int days  = (int)Math.Floor((double)count / 1200);
             int hours = (int)Math.Floor((double)(count % 1200) / (1200 / 24));
             E.Postfix.Append("&gBIOSCAN: Suitable water for " + days.ToString() + "d " + hours.ToString() + "h.");
         }
     }
     return(true);
 }
Exemplo n.º 7
0
 private void OnCancel()
 {
     Scanning.Cancel(false);
 }
Exemplo n.º 8
0
 private void OnClose()
 {
     Scanning.Close(false);
 }
Exemplo n.º 9
0
 private void OnReload()
 {
     Scanning.ReloadAsync();
 }
Exemplo n.º 10
0
 public Bot()
 {
     Scan         = new Scanning(this);
     Recognizator = new Recognizator(this);
     Autonomous   = new Autonomous(this);
 }
Exemplo n.º 11
0
        public static void Init()
        {
            if (adapter != null)
            {
                return;
            }

            adapter                     = BluetoothAdapter.DefaultAdapter;
            gattCallback                = new GattCallback();
            gattCallback.Connecting    += OnDeviceConnecting;
            gattCallback.Connected     += OnDeviceConnected;
            gattCallback.Disconnecting += OnDeviceDisconnecting;
            gattCallback.Disconnected  += OnDeviceDisconencted;

            if (adapter == null)
            {
                Console.WriteLine("Device does not support Bluetooth");
                return;
            }

            if (!adapter.IsEnabled)
            {
                Console.WriteLine("Bluetooth is not enabled");
                return;
            }

            Scanning?.Invoke(null, EventArgs.Empty);

            ICollection <BluetoothDevice> pairedDevices = adapter.BondedDevices;

            if (pairedDevices.Count > 0)
            {
                // There are paired devices. Get the name and address of each paired device.
                foreach (BluetoothDevice d in pairedDevices)
                {
                    string deviceName            = d.Name;
                    string deviceHardwareAddress = d.Address;

                    Console.WriteLine(deviceName + " - " + deviceHardwareAddress);

                    if (deviceHardwareAddress == "20:16:02:30:52:56" || deviceName == "aFloat")
                    {
                        Device = d;

                        Found?.Invoke(null, EventArgs.Empty);

                        Console.WriteLine("Device found. BondState = {0}", Device.BondState);
                    }
                }
            }
            else
            {
                Console.WriteLine("No paired devices");
            }

            if (Device == null)
            {
                NotFound?.Invoke(null, EventArgs.Empty);

                return;
            }
        }
Exemplo n.º 12
0
 // Start is called before the first frame update
 void Start()
 {
     scanning = player.GetComponent <Scanning>();
 }
Exemplo n.º 13
0
 public frmScanning()
 {
     InitializeComponent();
     oOrder  = new Scanning(base.CompanyID);
     oOrder1 = new Scanning(base.CompanyID);
 }
Exemplo n.º 14
0
 private void OnScanning(string webPage)
 {
     Scanning?.Invoke(webPage);
 }
Exemplo n.º 15
0
 private void OnDeleteRecycle()
 {
     Scanning.RecycleFile(SelectedFile.Model);
 }
Exemplo n.º 16
0
 private void OnDeletePermanently()
 {
     Scanning.DeleteFile(SelectedFile.Model);
 }
Exemplo n.º 17
0
 private void OnScanning(string dir)
 {
     Scanning?.Invoke(this, new ScanEventArgs(dir));
 }