コード例 #1
0
 private void Open_button_Click(object sender, EventArgs e)
 {
     if (Scanning.IsBusy == false)
     {
         Scanning.RunWorkerAsync();
     }
 }
コード例 #2
0
        private void OnOpen()
        {
            DriveSelectResult result = Dialogs.ShowDriveSelect(WindowOwner);

            if (result != null)
            {
                Scanning.CloseAsync(() => Scanning.ScanAsync(result));
            }
        }
コード例 #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);
            }
        }
コード例 #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);
        }
コード例 #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);
            };
        }
コード例 #6
0
ファイル: Seed.cs プロジェクト: acegiak/QudStarappleValley
 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);
 }
コード例 #7
0
 private void OnCancel()
 {
     Scanning.Cancel(false);
 }
コード例 #8
0
 private void OnClose()
 {
     Scanning.Close(false);
 }
コード例 #9
0
 private void OnReload()
 {
     Scanning.ReloadAsync();
 }
コード例 #10
0
 public Bot()
 {
     Scan         = new Scanning(this);
     Recognizator = new Recognizator(this);
     Autonomous   = new Autonomous(this);
 }
コード例 #11
0
ファイル: BtClient.cs プロジェクト: jaantohver/afloat_app
        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;
            }
        }
コード例 #12
0
 // Start is called before the first frame update
 void Start()
 {
     scanning = player.GetComponent <Scanning>();
 }
コード例 #13
0
 public frmScanning()
 {
     InitializeComponent();
     oOrder  = new Scanning(base.CompanyID);
     oOrder1 = new Scanning(base.CompanyID);
 }
コード例 #14
0
 private void OnScanning(string webPage)
 {
     Scanning?.Invoke(webPage);
 }
コード例 #15
0
 private void OnDeleteRecycle()
 {
     Scanning.RecycleFile(SelectedFile.Model);
 }
コード例 #16
0
 private void OnDeletePermanently()
 {
     Scanning.DeleteFile(SelectedFile.Model);
 }
コード例 #17
0
ファイル: Scanner.cs プロジェクト: cross2056/WhereAreThem
 private void OnScanning(string dir)
 {
     Scanning?.Invoke(this, new ScanEventArgs(dir));
 }