protected override void OnElementChanged(ElementChangedEventArgs <Page> args) { base.OnElementChanged(args); if (args.OldElement != null || Element == null) { return; } Log.Debug("", "HI"); try { if (view == null) { var activity = Context as Activity; view = activity.LayoutInflater.Inflate(Resource.Layout.ScanLayout, this, false); AddView(view); scanView = view.FindViewById <ScanView>(Resource.Id.scan_view); scanView.Init("mro_config_shipping_container.json", licenseKey); scanView.ScanViewPlugin.AddScanResultListener(this); scanView.CameraOpened += ScanView_CameraOpened; } } catch (Exception e) { // show error } }
public void MoveToScan() { var scanner = new ScanView(); scanner.Show(); CloseAction(); }
protected override void OnElementChanged(ElementChangedEventArgs <Page> args) { base.OnElementChanged(args); if (args.OldElement != null || Element == null) { return; } string configurationFile = (Element as ScanExamplePage).ConfigurationFile.Replace(".json", "") + ".json"; try { if (view == null) { var activity = Context as Activity; view = activity.LayoutInflater.Inflate(Resource.Layout.ScanLayout, this, false); AddView(view); scanView = view.FindViewById <ScanView>(Resource.Id.scan_view); scanView.Init(configurationFile, licenseKey); scanView.ScanViewPlugin.AddScanResultListener(this); scanView.CameraOpened += ScanView_CameraOpened; } } catch (Exception e) { // show error } }
internal void Navigate(object param) { ShowAppHeader = true; switch (Convert.ToString(param)) { case "Profile": AppViewPage = new ProfileView(); break; case "Zone Selection": AppViewPage = null; break; case "Scan": AppViewPage = new ScanView(); break; case "Batch Manager": AppViewPage = null; break; case "Batch Details": AppViewPage = null; break; case "Log Out": AppViewPage = new LoginView(); ShowAppHeader = false; break; } }
public App() { ServiceContainer.Register <ScanViewModel>(() => new ScanViewModel()); ServiceContainer.Register <OrderViewModel>(() => new OrderViewModel()); ServiceContainer.Register <MainViewModel>(() => new MainViewModel()); ServiceContainer.Register <LoginViewModel>(() => new LoginViewModel()); ServiceContainer.Register <RegisterViewModel>(() => new RegisterViewModel()); InitializeComponent(); ServiceContainer.Register <ISettingsService>(() => new SettingsService()); _settingsService = ServiceContainer.Resolve <ISettingsService>(); //var mainPage = new ScanView(); //MainPage = new NavigationPage(mainPage); OnStart(); ServiceContainer.Register <OrderViewModel>(() => new OrderViewModel()); ServiceContainer.Register <OrderCompleteViewModel>(() => new OrderCompleteViewModel()); var mainPage = new ScanView(); MainPage = new NavigationPage(mainPage); }
public void GetToPreviousWindow() { _videoSource?.Stop(); var scanner = new ScanView(); scanner.Show(); CloseAction(); }
private void MenuButtonScan_Click(object sender, EventArgs e) { //Switches to the scan screen ScanView scanView = new ScanView(WorkingArea); SwitchView(scanView); ActiveControl = scanView.Controls[3]; MenuButtonScan.BackColor = Color.DarkSlateBlue; MenuPanel.Size = new Size(WorkingArea.Width / 2, 100); MenuButtonDelete.Hide(); }
private void DisposeResources() { if (scanView != null) { scanView.Dispose(); scanView = null; } view = null; RemoveAllViews(); GC.Collect(); }
public FifoApp() { InitializeComponent(); WorkingArea = Screen.PrimaryScreen.WorkingArea; MinimumSize = new Size(WorkingArea.Width, WorkingArea.Height); ScanView scanView = new ScanView(WorkingArea); SwitchView(scanView); ActiveControl = scanView.Controls[3]; MenuButtonScan.BackColor = Color.DarkSlateBlue; MenuPanel.Size = new Size(WorkingArea.Width / 2, 100); MenuButtonDelete.Location = new Point(WorkingArea.Width - MenuButtonDelete.Width, 0); }
private void DisposeResources() { if (scanView != null) { scanView.Stop(); scanView.CameraView.ReleaseCameraInBackground(); scanView.CameraOpened -= ScanView_CameraOpened; scanView.Dispose(); scanView = null; } view = null; RemoveAllViews(); GC.Collect(); }
public ScanViewPage() { // We don't want to keep multiple instances of the scan views that we're navigating to. NavigationCacheMode = NavigationCacheMode.Required; ((Frame)Window.Current.Content).CacheSize = 0; ApplicationView.GetForCurrentView().Title = "Anyline Examples"; this.InitializeComponent(); AnylineDebug.SetVerbosity(Verbosity.Debug); _anylineScanView = AnylineScanView; }
static void Main(string[] args) { try { ScanView.SetNetsparkerConfigs(); string path = ScanView.GetNetsparkerPath(); string reportLocation = ScanView.GetReportLocation(); using (NetsparkerSession session = new NetsparkerSession(path)) { if (session.NetsparkerCLIState()) { using (NetsparkerManager manager = new NetsparkerManager(session, reportLocation)) { string inputSelection = ""; do { Console.Write("\nYapmak istediğiniz işlemi seçiniz." + "\nA: Tarama Oluşturmak İçin" + "\nQ: Çıkış İçin" + "\nSeçiminiz: "); inputSelection = Console.ReadLine().ToUpper(); switch (inputSelection) { case "A": ScanView.ScanCreate(manager); break; case "Q": break; default: Console.WriteLine("\n***Hatalı Seçim. Lütfen Seçiminizi kontrol ediniz.***\n"); break; } } while (inputSelection.ToUpper() != "Q"); } Console.WriteLine("Başarılı bir şekilde çıkış işlemi gerçekleştirildi."); Console.Read(); } } } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.Read(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); try { SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true); // we pass the json path from the previous activity var jsonPath = Intent.GetStringExtra("jsonPath"); // we pass the title from the previous activity Title = Intent.GetStringExtra("title"); Window.SetFlags(WindowManagerFlags.KeepScreenOn, WindowManagerFlags.KeepScreenOn); SetContentView(Resource.Layout.scan_activity); _scanView = FindViewById <ScanView>(Resource.Id.scan_view); // the initialization parses the json configuration and builds the whole use-case _scanView.Init(jsonPath, LICENSE_KEY); /* * Depending on your config/use-case, the ScanViewPlugin is of a different type. * You need to add your implementation of IO.Anyline.Plugin.IScanResultListener to retrieve scan results. */ _scanView.ScanViewPlugin.AddScanResultListener(_scanResultListener); //var myBarcodeListener = new MyBarcodeListener(); //_scanView.CameraView.EnableBarcodeDetection(myBarcodeListener, null); //var bar = new AT.Nineyards.Anyline.Modules.Barcode.NativeBarcodeScanView(ApplicationContext, null); // handle camera open events _scanView.CameraOpened += ScanView_CameraOpened; // handle camera error events _scanView.CameraError += ScanView_CameraError; _isInitialized = true; } catch (Exception e) { Util.ShowError(e.ToString(), this); } }
public void Start() { seeker = this.GetComponent <Seeker>(); controller = this.GetComponent <CharacterController>(); Mysquad = WorldManger.Instace.squadlist[CloesetsSpawnPoint().GetComponent <Spawner>().LastSquad]; Mysquad.AddUnit(this.gameObject); if (IsSquadLeader == true) { scanview = this.GetComponentInChildren <ScanView>(); } if (MyWeapon = null) { Mysquad.GetWeapon(this.gameObject); } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); try { _isInitialized = false; if (_scanView != null) { _scanView.Dispose(); _scanView.CameraOpened -= ScanView_CameraOpened; _scanView.CameraError -= ScanView_CameraError; _scanView = null; GC.Collect(); } } catch (Exception) { } Finish(); }
private void GoBack() { try { _isInitialized = false; if (_scanView != null) { _scanView.Stop(); _scanView.CameraView.ReleaseCamera(); _scanView.CameraOpened -= ScanView_CameraOpened; _scanView.CameraError -= ScanView_CameraError; _scanView.Dispose(); _scanView = null; GC.Collect(); } } catch (Exception) { } Finish(); }
static void Main(string[] args) { try { ScanView.SetIPAndPort(); using (NexposeSession session = new NexposeSession(ScanView.IP, ScanView.Port, ScanView.Username, ScanView.Password)) { using (NexposeManager manager = new NexposeManager(session)) { if (session.W3afServiceState()) { string inputSelection = ""; do { Console.Write("\nYapmak istediğiniz işlemi seçiniz." + "\nA: Tarama Oluşturmak İçin" + "\nB: Taramaları listelemek için " + //"\nC: Tarama Durumunu Görüntülemek İçin" + //"\nD: Tarama Silmek İçin" + //"\nE: Zafiyetleri Görmek İçin" + //"\nF: Zafiyetleri XML Olarak Masaüstüne Kaydet" + "\nQ: Çıkış İçin" + "\nSeçiminiz: "); inputSelection = Console.ReadLine().ToUpper(); switch (inputSelection) { case "A": ScanView.CreateScan(manager); break; case "B": ScanView.GetScans(manager); break; case "C": //ScanView.GetScanStatus(manager); break; case "D": //ScanView.DeleteScan(manager); break; case "E": //ScanView.ShowScanVulnerabilities(manager); break; case "F": //ScanView.SaveScanVulnerabilitiesAsXML(manager); break; case "Q": break; default: Console.WriteLine("\n***Hatalı Seçim. Lütfen Seçiminizi kontrol ediniz.***\n"); break; } } while (inputSelection != "Q"); } else { Console.WriteLine("Not OKEY"); } Console.Read(); } } } catch (Exception ex) { throw ex; } }
static async Task Main(string[] args) { if (args.Length > 0) { Settings = Settings.CreateOverride(args); } if (Settings.MigrateOldLibrarianData.Length > 0) { Migrate(); return; } if (Settings.Log) { Logger.SetLogger(new Logger("log.txt")); } AppDomain.CurrentDomain.UnhandledException += (sender, eventArgs) => Logger.Instance.Log(eventArgs.ExceptionObject.ToString() ?? "Unknown Exception", Logger.Level.Error); State = new State(Settings); using UiHub uiHub = UiHub.Register(80, 20, true); uiHub.Title = $"Librarian v{Version}"; uiHub.MainLoopInterval = Settings.UiInputInterval; uiHub.ViewUpdateReduction = Settings.UiRenderReduction; InitView initView = new InitView(uiHub.AddView("Init")); MainView mainView = new MainView(uiHub.AddView("Main")); DownloadView downloadView = new DownloadView(uiHub.AddView("Download")); ScanView scanView = new ScanView(uiHub.AddView("Scan")); State.PropertyChanged += (s, e) => { switch (e.PropertyName) { case nameof(State.Current): switch (State.Current) { case State.View.Init: uiHub.SwitchView(initView.Name); break; case State.View.Main: uiHub.SwitchView(mainView.Name); break; case State.View.Download: uiHub.SwitchView(downloadView.Name); break; case State.View.Scan: uiHub.SwitchView(scanView.Name); break; } break; case nameof(State.InitCurrentPath): initView.UpdateView(State.InitCurrentPath); break; default: mainView.UpdateView(State); break; } }; State.DownloadState.PropertyChanged += (s, e) => downloadView.UpdateView(State.DownloadState); State.ScanState.PropertyChanged += (s, e) => scanView.UpdateView(State.ScanState); downloadView.UpdateView(State.DownloadState); scanView.UpdateView(State.ScanState); CancellationTokenSource tokenSource = new CancellationTokenSource(); Logger.Instance.Log($"Starting Librarian v{Version}"); Task run = Task.Run(() => Run(tokenSource.Token), tokenSource.Token); uiHub.Run(); tokenSource.Cancel(); await run; Logger.Instance.Log("Stopping"); }