コード例 #1
0
        /// <summary>
        /// Нажатие кнопки "Выполнить действия" на вкладке результатов сканирования
        /// </summary>
        private void metroButton12_Click(object sender, EventArgs e)
        {
            ApplyingActions.Text = "Выполнить действия";

            List <VirusAction> virusesActions = new List <VirusAction>();

            foreach (ListViewItem item in metroListView4.Items)
            {
                virusesActions.Add((VirusAction)item.Tag);
            }

            if (virusesActions.Count > 0)
            {
                var popup = new PopupNotifier()
                {
                    ContentText = "Действия выполнены",
                    TitleText   = "Antivirus"
                };

                popup.Popup();
            }

            API.ApplyingActions(virusesActions.ToArray());

            VirusesBuffer.Clear();
            this.ScanObjectsList.Items.Clear();
            this.metroListView4.Items.Clear();
            this.TabControl.SelectedIndex = 0;

            ScanManager.Reset();
        }
コード例 #2
0
        /// <summary>
        /// Отменить(завершить) сканирование
        /// </summary>
        private void metroButton3_Click(object sender, EventArgs e)
        {
            Logger.WriteLine("[GUI] Abort click");
            ScanManager.Abort();

            ScanManager.CountAllFiles = ScanManager.CountAllScannedFiles;
        }
コード例 #3
0
ファイル: ARDetection.cs プロジェクト: ZaK14120/ARS
 public void ResetAR()
 {
     ScanManager.SetActive(true);
     SpawnObject.SetActive(false);
     isSpawned = false;
     AppUIManager.instance.OpenPage(0);
 }
コード例 #4
0
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            switch (e.CloseReason)
            {
            case CloseReason.WindowsShutDown:
            {
                //Windows закрывает все приложения перед завершением работы

                ScanManager.Stop();
                API.ApiStop();
                Updater.Stop();
                break;
            }

            case CloseReason.UserClosing:
            {
                e.Cancel = true;
                this.Hide();
                break;
            }

            case CloseReason.TaskManagerClosing:
            {
                //TaskManager закрывает приложение

                ScanManager.Stop();
                API.ApiStop();
                Updater.Stop();
                break;
            }
            }
        }
コード例 #5
0
        /// <summary>
        /// Начать сканирование
        /// </summary>
        private void metroButton2_Click(object sender, EventArgs e)
        {
            if (ScanObjectsList.Items.Count == 0)
            {
                return;
            }

            VirusesBuffer.Clear();
            this.TabControl.SelectedIndex = 6;

            var files = new List <string>();
            var dirs  = new List <string>();

            foreach (ListViewItem Item in ScanObjectsList.Items)
            {
                if (Item.SubItems[1].Text.LastIndexOf('.') > Item.SubItems[1].Text.LastIndexOf('\\'))
                {
                    files.Add(Item.Tag.ToString());
                }
                else
                {
                    dirs.Add(Item.Tag.ToString());
                }
            }

            ScanManager.StartScan(dirs.ToArray(), files.ToArray());

            Thread.Sleep(300);
            active_scan_updater.Start();
        }
コード例 #6
0
    // Use this for initialization
    void Start()
    {
        mainMenuCanvas = GameObject.Find("_UI");
        Debug.Log("1111111111111111111111111111111111111111111111111111");
        introScreen    = GameObject.Find("_Intro_Screen");
        shoppingScreen = GameObject.Find("_Shopping_Screen");
        scannerScreen  = GameObject.Find("_Scanner_Screen");
        paymentScreen  = GameObject.Find("_Payment_Screen");
        outroScreen    = GameObject.Find("_Outro_Screen");
        budget         = GameObject.Find("_BudgetSprite");
        totalSpent     = GameObject.Find("_TotalAmoutSprite");
        menu_buttons   = GameObject.FindGameObjectsWithTag("MenuButton");
        foodMeter      = GameObject.FindGameObjectWithTag("FoodMeter");
        Debug.Log("3333333333333333333333333333333333333333333333333333");


        sprite_spawn_manager = shoppingScreen.GetComponent <SpriteSpawnManager>();
        audio_manager        = GameObject.Find("_AudioManager").GetComponent <AudioManager>();
        animation_manager    = GameObject.Find("_AnimationPlayer").GetComponent <AnimationManager>();
        cashRegisterSprite   = GameObject.Find("_CashRegisterSprite").GetComponent <SpriteRenderer>();
        scan_manager         = scannerScreen.GetComponent <ScanManager>();
        basket_manager       = FindObjectOfType <BasketManager>();
        budgetText           = budget.GetComponentInChildren <TextMesh>();
        totalText            = totalSpent.GetComponentInChildren <TextMesh>();
        paymentText          = GameObject.Find("_TotalPaid").GetComponent <TextMesh>();
        payment_manager      = paymentScreen.GetComponent <PaymentManager>();
        list_checker         = GameObject.Find("_ListMenu").GetComponent <ListChecker>();
        list_checker_2       = GameObject.Find("_ListMenu_2").GetComponent <ListChecker>();
        Debug.Log("2222222222222222222222222222222222222222222222222222");


        itemSprites = scan_manager.itemSprites;
        StartGame();
    }
コード例 #7
0
        public override void Setup()
        {
            base.Setup();

            dataProvider     = Substitute.For <IDataProvider>();
            tvShowRepository = new TvShowRepository(StorageProvider, dataProvider);
            scanManager      = new ScanManager(StorageProvider, dataProvider, tvShowRepository);
        }
コード例 #8
0
        private void выходToolStripMenuItem_Click(object sender, EventArgs e)
        {
            API.StopKernel();
            ScanManager.Stop();
            API.ApiStop();
            Updater.Stop();

            Application.Exit();
        }
コード例 #9
0
 public ScanManagerVM()
 {
     //using (StreamReader r = new StreamReader("config.json"))
     //{
     //    var jsonString = r.ReadToEnd();
     //    Model = JsonSerializer.Deserialize<ScanManager>(jsonString);
     //}
     Model = new ScanManager(new Intel.RealSense.Context());
 }
コード例 #10
0
        public void OnRulesDownloaded()
        {
            // Initialise Scanner
            mScanManager = new ScanManager();
            mScanManager.RegisterListener(this);

            FIRST_TIME_UPDATE = true;
            mUpdate.UnregisterListener(this);
        }
コード例 #11
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click         += FabOnClick;
            startScan          = FindViewById <Button>(Resource.Id.button1);
            startScan.Click   += StartScan_Click;
            stopScan           = FindViewById <Button>(Resource.Id.button2);
            stopScan.Click    += StopScan_Click;
            edittext           = FindViewById <EditText>(Resource.Id.edittext);
            edittext.KeyPress += (object sender, View.KeyEventArgs e) => {
                e.Handled = false;
                if (e.Event.Action == KeyEventActions.Down && e.KeyCode == Keycode.Enter)
                {
                    Toast.MakeText(this, edittext.Text, ToastLength.Short).Show();
                    e.Handled = true;
                }
                else if (e.Event.Action == KeyEventActions.Up && e.KeyCode == Keycode.Enter)
                {
                    edittext.Text = "";
                    e.Handled     = true;
                }
            };
            mRadioGroup = FindViewById <RadioGroup>(Resource.Id.mode_output);
            mRadioGroup.CheckedChange += delegate(object sender, RadioGroup.CheckedChangeEventArgs e) {
                switch (e.CheckedId)
                {
                case Resource.Id.intent_output:
                    idmode[0] = 0;
                    mScanManager.SetPropertyInts(idmodebuf, idmode);
                    //scanResult.setVisibility(View.GONE);
                    break;

                case Resource.Id.keyboard_output:
                    idmode[0] = 1;
                    idmode[1] = 2;
                    mScanManager.SetPropertyInts(idmodebuf, idmode);
                    //scanResult.setVisibility(View.VISIBLE);
                    //scanResult.requestFocus();
                    break;
                }
            };
            mScanManager = new ScanManager();
            mScanManager.GetPropertyInts(idmodebuf, idmode);
            receiver = new MySampleBroadcastReceiver();
        }
コード例 #12
0
ファイル: ARDetection.cs プロジェクト: ZaK14120/ARS
 public void Summon()
 {
     if (!isSpawned && FindingSquare.activeSelf)
     {
         SpawnObject.SetActive(true);
         SpawnObject.transform.position = FindingSquare.transform.position;
         SpawnObject.transform.LookAt(Camera.main.transform);
         SpawnObject.transform.rotation = Quaternion.Euler(0, SpawnObject.transform.rotation.eulerAngles.y, 0);
         ScanManager.SetActive(false);
         AppUIManager.instance.OpenPage(1);
         isSpawned = true;
     }
 }
コード例 #13
0
    // Use this for initialization
    void Start()
    {
        initPos = this.gameObject.transform.position;

        is_item_selected  = false;
        did_touch_scanner = false;
        move_this_item    = false;
        in_basket         = false;

        sprite_renderer = this.gameObject.GetComponent <SpriteRenderer>();
        audio_manager   = GameObject.Find("_AudioManager").GetComponent <AudioManager>();
        scan_manager    = FindObjectOfType <ScanManager>();
    }
コード例 #14
0
 /// <summary>
 /// Приостановить сканирование
 /// </summary>
 private void metroButton4_Click(object sender, EventArgs e)
 {
     if (pauseScan.Text == "Приостановить")
     {
         pauseScan.Text = "Продолжить";
         ScanManager.Pause();
     }
     else
     {
         pauseScan.Text = "Приостановить";
         ScanManager.Resume();
     }
 }
コード例 #15
0
ファイル: App.xaml.cs プロジェクト: Kobzol/pvbps
        public App()
        {
            this.config = this.ParseConfig("config.json");

            this.client      = new VirustotalClient(this.config.ApiUrl, this.config.ApiKey);
            this.database    = new DatabaseManager(this.config.DatabaseFile);
            this.quarantine  = new Quarantine(this.config.QuarantinePath, this.config.QuarantineKey);
            this.scanManager = new ScanManager(this.client, this.database, this.quarantine, this.database.GetScans());

            this.Exit += this.HandleExit;

            this.SetupDatabasePersist();
        }
コード例 #16
0
        public MainWindow(ScanManager scanManager, DatabaseManager database, VirustotalClient client)
        {
            this.scanManager = scanManager;
            this.database    = database;
            this.client      = client;
            this.DataContext = this;

            this.InitializeComponent();

            this.UpdateScans(this.scanManager.Scans);
            this.scanManager.OnScanCreated += this.OnScanCreated;
            this.scanManager.OnScanUpdated += this.OnScanUpdated;
            this.client.OnStatus           += this.OnRequestStatus;
        }
コード例 #17
0
    // Use this for initialization
    void Start()
    {
        if (scanManagerObject == null)
        {
            scanManager = GameObject.Find("ScanManager").GetComponent <ScanManager>();
        }
        else
        {
            scanManager = scanManagerObject.GetComponent <ScanManager>();
        }

        keywords.Add("Main Menu", () =>
        {
            // load main menu scene
            scanManager.LoadScene("MainMenu");
        });

        keywords.Add("Save room", () =>
        {
            // save the current mesh
            scanManager.SaveRoom();
            Debug.Log("Saved room");
        });

        keywords.Add("Save and Quit", () =>
        {
            // save the current mesh
            scanManager.SaveRoom();

            // return to main menu
            scanManager.LoadScene("MainMenu");
        });

        keywords.Add("Stop scanner", () => {
            SpatialMappingManager.Instance.StopObserver();
        });

        keywords.Add("Start scanner", () =>
        {
            SpatialMappingManager.Instance.StartObserver();
        });

        // Tell the KeywordRecognizer about our keywords.
        keywordRecognizer = new KeywordRecognizer(keywords.Keys.ToArray());

        // Register a callback for the KeywordRecognizer and start recognizing!
        keywordRecognizer.OnPhraseRecognized += KeywordRecognizer_OnPhraseRecognized;
        keywordRecognizer.Start();
    }
コード例 #18
0
ファイル: Program.cs プロジェクト: dessarn/Checkout
        static void Main(string[] arg)
        {
            IFakeDataStore dataStore     = new FakeDataStore();
            IBasketService basketService = new BasketService(dataStore);
            IBasketClient  basketClient  = new BasketClient(basketService);
            IScanManager   sm            = new ScanManager(basketClient);

            if (arg.Length > 0)
            {
                sm.SetupScanListener(arg[0]);
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1(basketClient));
        }
コード例 #19
0
        public static void initScan()
        {
            if (Xamarin.Essentials.DeviceInfo.Manufacturer != "Unitech")
            {
                return;
            }
            ;

            mScanManager = new ScanManager();

            // Set the output mode of the barcode reader (either send output to text box or as Android intent).
            // Set to 0 if barcode output is to be sent as intent, barcode output is to be sent to the text box in focus
            mScanManager.SwitchOutputMode(0);

            mScanManager.TriggerMode = Android.Device.Scanner.Configuration.Triggering.Host;

            mScanManager.EnableAllSymbologies(true);

            // Turn off the power for the bar code reader.
            mScanManager.CloseScanner(); // -> save power if not used
        }
コード例 #20
0
        public MainForm()
        {
#if DEBUG
            Logger.Init();
#endif
            cryptor.SetRandomIV();

            {
                //Накладываем белую панель на кусочек TabControl'а сверху
                var topPanel    = new Panel();
                var leftPanel   = new Panel();
                var rightPanel  = new Panel();
                var buttomPanel = new Panel();

                APIHandlers.f = this;

                {
                    {
                        topPanel.Visible  = true;
                        topPanel.Location = new System.Drawing.Point(0, 27);
                        topPanel.Name     = "topPanel";
                        topPanel.Size     = new System.Drawing.Size(904, 20);
                        topPanel.TabIndex = 7;

                        topPanel.ForeColor = SystemColors.ControlLightLight;
                        topPanel.BackColor = SystemColors.ControlLightLight;
                    }

                    {
                        leftPanel.Visible  = true;
                        leftPanel.Location = new System.Drawing.Point(0, 6);
                        leftPanel.Name     = "leftPanel";
                        leftPanel.Size     = new System.Drawing.Size(6, 470);
                        leftPanel.TabIndex = 8;

                        leftPanel.ForeColor = SystemColors.ControlLightLight;
                        leftPanel.BackColor = SystemColors.ControlLightLight;
                    }

                    {
                        rightPanel.Visible  = true;
                        rightPanel.Location = new System.Drawing.Point(902, 6);
                        rightPanel.Name     = "rightPanel";
                        rightPanel.Size     = new System.Drawing.Size(4, 470);
                        rightPanel.TabIndex = 9;

                        rightPanel.ForeColor = SystemColors.ControlLightLight;
                        rightPanel.BackColor = SystemColors.ControlLightLight;
                    }

                    {
                        buttomPanel.Visible  = true;
                        buttomPanel.Location = new System.Drawing.Point(0, 452);
                        buttomPanel.Name     = "buttomPanel";
                        buttomPanel.Size     = new System.Drawing.Size(910, 8);
                        buttomPanel.TabIndex = 9;

                        buttomPanel.ForeColor = SystemColors.ControlLightLight;
                        buttomPanel.BackColor = SystemColors.ControlLightLight;
                    }
                }


                this.Controls.Add(topPanel);
                this.Controls.Add(leftPanel);
                this.Controls.Add(rightPanel);
                this.Controls.Add(buttomPanel);
            }


            InitializeComponent();

            ScanManager.Init(this);

            {
                TabControl.Multiline  = true;
                TabControl.Appearance = TabAppearance.Buttons; //FlatButtons
                TabControl.ItemSize   = new System.Drawing.Size(0, 1);
                TabControl.SizeMode   = TabSizeMode.Fixed;
                TabControl.TabStop    = false;
            }

            {
                API.Init();

                API.onScanCompleted += APIHandlers.OnScannedFile;
                API.onScanFound     += APIHandlers.OnFoundVirus;
                API.onVirusInfo     += APIHandlers.virusInfo;
            }

            {
                Updater.Tick    += MyTimer_Tick;
                Updater.Interval = 200;
                Updater.Enabled  = true;
            }

            {
                //Применение настроек касающихся ядра
                API.SetAutoScanRemovableDevices(Configuration.AutoScanRemovableDevices);

                //Добавление правил фильтрации
                {
                    foreach (string path in Configuration.PathExceptions)
                    {
                        API.AddSimpleRule(path);
                    }

                    foreach (string file in Configuration.ExtentionExceptions)
                    {
                        API.AddSimpleRule(file);
                    }
                }
            }

            {
                //Установка настроек на форму
                metroCheckBox1.Checked = Configuration.Notify_FoundVirus;
                metroCheckBox2.Checked = Configuration.AutoScanRemovableDevices;

                switch (Configuration.AutoAction)
                {
                case ActionType.Delete:
                {
                    settingsAutoAction.Text = "Удалить";
                    break;
                }

                case ActionType.ToQuarantine:
                {
                    settingsAutoAction.Text = "В карантин";
                    break;
                }

                case ActionType.Nothing:
                {
                    settingsAutoAction.Text = "Ничего не делать";
                    break;
                }
                }
            }
        }