Ejemplo n.º 1
0
 /// <summary>
 /// Сохранение выбранного менеджера сканеров в конфигурационный файл.
 /// </summary>
 /// <param name="scannerManager">Выбранных менеджер сканеров.</param>
 private void SaveScannerManagerSettings(ScannerManager scannerManager)
 {
     if (RuntimeConfigurationManager.UpdateAppSettings("ScannerManager", scannerManager.ToString()))
     {
         UpdateScannerManager(scannerManager);
     }
 }
        private void btnStartDirScan_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(this.rtbDirScanTarget.Text))
            {
                MessageBox.Show("You need to enter url!", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            var url = this.GetBaseUrl(this.rtbDirScanTarget.Text.Trim());

            this._scannerManager = new ScannerManager(url);

            this.ExtractSelectedChecks(false);

            if (this._settingsToCheck.Count == 0)
            {
                MessageBox.Show("Please, select atleast one check!", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            this.ActivateStatusLabel(true);

            this.gvDirScanResults.DataSource = null;

            this.DisableControls(this.Controls, false);
            this.bgDirectoryWorker.RunWorkerAsync();
        }
Ejemplo n.º 3
0
        public IBSampleApp()
        {
            InitializeComponent();
            ibClient              = new IBClient(this);
            marketDataManager     = new MarketDataManager(ibClient, marketDataGrid_MDT);
            deepBookManager       = new DeepBookManager(ibClient, deepBookGrid);
            historicalDataManager = new HistoricalDataManager(ibClient, historicalChart, barsGrid);
            realTimeBarManager    = new RealTimeBarsManager(ibClient, rtBarsChart, rtBarsGrid);
            scannerManager        = new ScannerManager(ibClient, scannerGrid);
            orderManager          = new OrderManager(ibClient, liveOrdersGrid, tradeLogGrid);
            accountManager        = new AccountManager(ibClient, accountSelector, accSummaryGrid, accountValuesGrid, accountPortfolioGrid, positionsGrid);
            contractManager       = new ContractManager(ibClient, fundamentalsOutput, contractDetailsGrid);
            advisorManager        = new AdvisorManager(ibClient, advisorAliasesGrid, advisorGroupsGrid, advisorProfilesGrid);
            optionsManager        = new OptionsManager(ibClient, optionChainCallGrid, optionChainPutGrid, optionPositionsGrid);

            mdContractRight.Items.AddRange(ContractRight.GetAll());
            mdContractRight.SelectedIndex = 0;

            conDetRight.Items.AddRange(ContractRight.GetAll());
            conDetRight.SelectedIndex = 0;

            fundamentalsReportType.Items.AddRange(FundamentalsReport.GetAll());
            fundamentalsReportType.SelectedIndex = 0;

            this.groupMethod.DataSource    = AllocationGroupMethod.GetAsData();
            this.groupMethod.ValueMember   = "Value";
            this.groupMethod.DisplayMember = "Name";

            this.profileType.DataSource    = AllocationProfileType.GetAsData();
            this.profileType.ValueMember   = "Value";
            this.profileType.DisplayMember = "Name";
        }
Ejemplo n.º 4
0
 public Form1()
 {
     InitializeComponent();
     files                   = new List <string>();
     scannerManager          = new ScannerManager(Handle);
     cbScanner.DataSource    = scannerManager.GetAllScanners();
     cbScanner.SelectedIndex = scannerManager.DefaultScanner;
 }
Ejemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        flightControl = transform.GetComponent <SpaceFlightController>();
        // weaponsManager = transform.GetComponent<WeaponsManager>();
        // damageManager = transform.GetComponent<DamageManager>();
        scannerManager = transform.GetComponent <ScannerManager>();

        rb = transform.GetComponent <Rigidbody>();
    }
Ejemplo n.º 6
0
		/// <summary>
		/// Обновление активного менеджера сканеров в интерфейсе.
		/// </summary>
		/// <param name="scannerManager">Активный менеджер сканеров.</param>
	    private void UpdateScannerManager(ScannerManager scannerManager)
	    {
			switch (scannerManager)
			{
				case ScannerManager.TwainDotNet:
					radioButtonTwain.Select();
					break;
				default:
					radioButtonWia.Select();
					break;
			}
	    }
Ejemplo n.º 7
0
        /// <summary>
        /// Обновление активного менеджера сканеров в интерфейсе.
        /// </summary>
        /// <param name="scannerManager">Активный менеджер сканеров.</param>
        private void UpdateScannerManager(ScannerManager scannerManager)
        {
            switch (scannerManager)
            {
            case ScannerManager.TwainDotNet:
                radioButtonTwain.Select();
                break;

            default:
                radioButtonWia.Select();
                break;
            }
        }
        private void btnQuickStart_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(this.rtb_QuickScanUrl.Text))
            {
                MessageBox.Show("You need to enter url!", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            var url = this.GetBaseUrl(this.rtb_QuickScanUrl.Text.Trim());

            this._scannerManager  = new ScannerManager(url);
            this._settingsToCheck = new List <ScannerSetting>
            {
                this._settingsManager.GetSettingByName("backend_dirs", true),
                this._settingsManager.GetSettingByName("general_Nikto", true)
            };

            this.ActivateStatusLabel(true);

            this.DisableControls(this.Controls, false);
            this.bgQuickWorker.RunWorkerAsync();
        }
Ejemplo n.º 9
0
        //for scanner role
        public async Task SetScanner(int userId)
        {
            ScannerManager manager;
            UserSignalR    currentUser = null;
            int?           schoolId    = null;

            using (var ds = new DataSeed()) {
                schoolId = ds.GetUserSchoolId(userId);
                if (schoolId == 0)
                {
                    return;
                }
                var sameUser = Users.FirstOrDefault(p => p.UserId == userId);
                if (sameUser != null)
                {
                    Users.Remove(sameUser);
                }
                var schoolScanner = Users.FirstOrDefault(p => p.SchoolId == schoolId && p.Role == HubRole.Scanner);
                currentUser = Users.FirstOrDefault(p => p.ConnectionId == Context.ConnectionId);
                if (schoolScanner == null)
                {
                    manager = new ScannerManager(Convert.ToInt32(schoolId), userId, ds);
                }
                else
                {
                    manager = schoolScanner.Ssm;
                }
            }
            //set User data
            currentUser.SchoolId = Convert.ToInt32(schoolId);
            currentUser.UserId   = userId;
            currentUser.Ssm      = manager;
            currentUser.Role     = HubRole.Scanner;

            await Groups.AddAsync(Context.ConnectionId, currentUser.UserGroup);
        }
 public ScanningSettingsForm(ScannerManager manager)
     : this()
 {
     this.manager = manager;
 }
Ejemplo n.º 11
0
        public IBSampleAppDialog()
        {
            InitializeComponent();
            ibClient = new IBClient(signal);

            marketDataManager     = new MarketDataManager(ibClient, marketDataGrid_MDT);
            deepBookManager       = new DeepBookManager(ibClient, deepBookGrid);
            historicalDataManager = new HistoricalDataManager(ibClient, historicalChart, barsGrid);
            realTimeBarManager    = new RealTimeBarsManager(ibClient, rtBarsChart, rtBarsGrid);
            scannerManager        = new ScannerManager(ibClient, scannerGrid, scannerParamsOutput);
            orderManager          = new OrderManager(ibClient, liveOrdersGrid, tradeLogGrid);
            accountManager        = new AccountManager(ibClient, accountSelector, accSummaryGrid, accountValuesGrid, accountPortfolioGrid, positionsGrid);
            contractManager       = new ContractManager(ibClient, fundamentalsOutput, contractDetailsGrid); //ibClient, form tab, form tab. https://interactivebrokers.github.io/tws-api/contract_details.html#gsc.tab=0
            advisorManager        = new AdvisorManager(ibClient, advisorAliasesGrid, advisorGroupsGrid, advisorProfilesGrid);
            optionsManager        = new OptionsManager(ibClient, optionChainCallGrid, optionChainPutGrid, optionPositionsGrid, listViewOptionParams);
            acctPosMultiManager   = new AcctPosMultiManager(ibClient, positionsMultiGrid, accountUpdatesMultiGrid);
            mdContractRight.Items.AddRange(ContractRight.GetAll());
            mdContractRight.SelectedIndex = 0;

            conDetRight.Items.AddRange(ContractRight.GetAll());
            conDetRight.SelectedIndex = 0;

            fundamentalsReportType.Items.AddRange(FundamentalsReport.GetAll());
            fundamentalsReportType.SelectedIndex = 0;

            this.groupMethod.DataSource    = AllocationGroupMethod.GetAsData();
            this.groupMethod.ValueMember   = "Value";
            this.groupMethod.DisplayMember = "Name";

            this.profileType.DataSource    = AllocationProfileType.GetAsData();
            this.profileType.ValueMember   = "Value";
            this.profileType.DisplayMember = "Name";

            hdRequest_EndTime.Text = DateTime.Now.ToString("yyyyMMdd HH:mm:ss");

            DateTime execFilterDefault = DateTime.Now.AddHours(-1);

            execFilterTime.Text = execFilterDefault.ToString("yyyyMMdd HH:mm:ss");


            // Events liniking
            // All events belong to EWrapper interface and called Public member functions
            ibClient.Error                  += ibClient_Error;
            ibClient.ConnectionClosed       += ibClient_ConnectionClosed;
            ibClient.CurrentTime            += time => addTextToBox("Current Time: " + time + "\n");
            ibClient.TickPrice              += ibClient_TickPrice;
            ibClient.TickSize               += ibClient_TickSize;
            ibClient.TickString             += (tickerId, tickType, value) => addTextToBox("Tick string. Ticker Id:" + tickerId + ", Type: " + TickType.getField(tickType) + ", Value: " + value + "\n");
            ibClient.TickGeneric            += (tickerId, field, value) => addTextToBox("Tick Generic. Ticker Id:" + tickerId + ", Field: " + TickType.getField(field) + ", Value: " + value + "\n");
            ibClient.TickEFP                += (tickerId, tickType, basisPoints, formattedBasisPoints, impliedFuture, holdDays, futureLastTradeDate, dividendImpact, dividendsToLastTradeDate) => addTextToBox("TickEFP. " + tickerId + ", Type: " + tickType + ", BasisPoints: " + basisPoints + ", FormattedBasisPoints: " + formattedBasisPoints + ", ImpliedFuture: " + impliedFuture + ", HoldDays: " + holdDays + ", FutureLastTradeDate: " + futureLastTradeDate + ", DividendImpact: " + dividendImpact + ", DividendsToLastTradeDate: " + dividendsToLastTradeDate + "\n");
            ibClient.TickSnapshotEnd        += tickerId => addTextToBox("TickSnapshotEnd: " + tickerId + "\n");
            ibClient.NextValidId            += ibClient_NextValidId; // Receives next valid order id. Will be invoked automatically upon successfull API client connection. Used for sending connection status
            ibClient.DeltaNeutralValidation += (reqId, underComp) =>
                                               addTextToBox("DeltaNeutralValidation. " + reqId + ", ConId: " + underComp.ConId + ", Delta: " + underComp.Delta + ", Price: " + underComp.Price + "\n");

            ibClient.ManagedAccounts         += accountsList => HandleMessage(new ManagedAccountsMessage(accountsList));
            ibClient.TickOptionCommunication += (tickerId, field, impliedVolatility, delta, optPrice, pvDividend, gamma, vega, theta, undPrice) =>
                                                HandleMessage(new TickOptionMessage(tickerId, field, impliedVolatility, delta, optPrice, pvDividend, gamma, vega, theta, undPrice));

            ibClient.AccountSummary     += (reqId, account, tag, value, currency) => HandleMessage(new AccountSummaryMessage(reqId, account, tag, value, currency));
            ibClient.AccountSummaryEnd  += reqId => HandleMessage(new AccountSummaryEndMessage(reqId));
            ibClient.UpdateAccountValue += (key, value, currency, accountName) => HandleMessage(new AccountValueMessage(key, value, currency, accountName));
            ibClient.UpdatePortfolio    += (contract, position, marketPrice, marketValue, averageCost, unrealisedPNL, realisedPNL, accountName) =>
                                           HandleMessage(new UpdatePortfolioMessage(contract, position, marketPrice, marketValue, averageCost, unrealisedPNL, realisedPNL, accountName));

            ibClient.UpdateAccountTime  += timestamp => HandleMessage(new UpdateAccountTimeMessage(timestamp));
            ibClient.AccountDownloadEnd += account => HandleMessage(new AccountDownloadEndMessage(account));
            ibClient.OrderStatus        += (orderId, status, filled, remaining, avgFillPrice, permId, parentId, lastFillPrice, clientId, whyHeld) =>
                                           HandleMessage(new OrderStatusMessage(orderId, status, filled, remaining, avgFillPrice, permId, parentId, lastFillPrice, clientId, whyHeld));

            ibClient.OpenOrder          += (orderId, contract, order, orderState) => HandleMessage(new OpenOrderMessage(orderId, contract, order, orderState));
            ibClient.OpenOrderEnd       += () => HandleMessage(new OpenOrderEndMessage());
            ibClient.ContractDetails    += (reqId, contractDetails) => HandleMessage(new ContractDetailsMessage(reqId, contractDetails));
            ibClient.ContractDetailsEnd += (reqId) => HandleMessage(new ContractDetailsEndMessage());
            ibClient.ExecDetails        += (reqId, contract, execution) => HandleMessage(new ExecutionMessage(reqId, contract, execution));
            ibClient.ExecDetailsEnd     += reqId => addTextToBox("ExecDetailsEnd. " + reqId + "\n");
            ibClient.CommissionReport   += commissionReport => HandleMessage(new CommissionMessage(commissionReport));
            ibClient.FundamentalData    += (reqId, data) => HandleMessage(new FundamentalsMessage(data));
            ibClient.HistoricalData     += (reqId, date, open, high, low, close, volume, count, WAP, hasGaps) =>
                                           HandleMessage(new HistoricalDataMessage(reqId, date, open, high, low, close, volume, count, WAP, hasGaps));

            ibClient.HistoricalDataEnd  += (reqId, startDate, endDate) => HandleMessage(new HistoricalDataEndMessage(reqId, startDate, endDate));
            ibClient.MarketDataType     += (reqId, marketDataType) => addTextToBox("MarketDataType. " + reqId + ", Type: " + marketDataType + "\n");
            ibClient.UpdateMktDepth     += (tickerId, position, operation, side, price, size) => HandleMessage(new DeepBookMessage(tickerId, position, operation, side, price, size, ""));
            ibClient.UpdateMktDepthL2   += (tickerId, position, marketMaker, operation, side, price, size) => HandleMessage(new DeepBookMessage(tickerId, position, operation, side, price, size, marketMaker));
            ibClient.UpdateNewsBulletin += (msgId, msgType, message, origExchange) =>
                                           addTextToBox("News Bulletins. " + msgId + " - Type: " + msgType + ", Message: " + message + ", Exchange of Origin: " + origExchange + "\n");

            ibClient.Position          += (account, contract, pos, avgCost) => HandleMessage(new PositionMessage(account, contract, pos, avgCost));
            ibClient.PositionEnd       += () => addTextToBox("PositionEnd \n");
            ibClient.RealtimeBar       += (reqId, time, open, high, low, close, volume, WAP, count) => HandleMessage(new RealTimeBarMessage(reqId, time, open, high, low, close, volume, WAP, count));
            ibClient.ScannerParameters += xml => HandleMessage(new ScannerParametersMessage(xml));
            ibClient.ScannerData       += (reqId, rank, contractDetails, distance, benchmark, projection, legsStr) =>
                                          HandleMessage(new ScannerMessage(reqId, rank, contractDetails, distance, benchmark, projection, legsStr));

            ibClient.ScannerDataEnd          += reqId => addTextToBox("ScannerDataEnd. " + reqId + "\r\n");
            ibClient.ReceiveFA               += (faDataType, faXmlData) => HandleMessage(new AdvisorDataMessage(faDataType, faXmlData));
            ibClient.BondContractDetails     += (requestId, contractDetails) => addTextToBox("Receiving bond contract details.");
            ibClient.VerifyMessageAPI        += apiData => addTextToBox("verifyMessageAPI: " + apiData);
            ibClient.VerifyCompleted         += (isSuccessful, errorText) => addTextToBox("verifyCompleted. IsSuccessfule: " + isSuccessful + " - Error: " + errorText);
            ibClient.VerifyAndAuthMessageAPI += (apiData, xyzChallenge) => addTextToBox("verifyAndAuthMessageAPI: " + apiData + " " + xyzChallenge);
            ibClient.VerifyAndAuthCompleted  += (isSuccessful, errorText) => addTextToBox("verifyAndAuthCompleted. IsSuccessfule: " + isSuccessful + " - Error: " + errorText);
            ibClient.DisplayGroupList        += (reqId, groups) => addTextToBox("DisplayGroupList. Request: " + reqId + ", Groups" + groups);
            ibClient.DisplayGroupUpdated     += (reqId, contractInfo) => addTextToBox("displayGroupUpdated. Request: " + reqId + ", ContractInfo: " + contractInfo);

            ibClient.PositionMulti                        += (reqId, account, modelCode, contract, pos, avgCost) => HandleMessage(new PositionMultiMessage(reqId, account, modelCode, contract, pos, avgCost));
            ibClient.PositionMultiEnd                     += (reqId) => HandleMessage(new PositionMultiEndMessage(reqId));
            ibClient.AccountUpdateMulti                   += (reqId, account, modelCode, key, value, currency) => HandleMessage(new AccountUpdateMultiMessage(reqId, account, modelCode, key, value, currency));
            ibClient.AccountUpdateMultiEnd                += (reqId) => HandleMessage(new AccountUpdateMultiEndMessage(reqId));
            ibClient.SecurityDefinitionOptionParameter    += (reqId, exchange, underlyingConId, tradingClass, multiplier, expirations, strikes) => HandleMessage(new SecurityDefinitionOptionParameterMessage(reqId, exchange, underlyingConId, tradingClass, multiplier, expirations, strikes));
            ibClient.SecurityDefinitionOptionParameterEnd += (reqId) => HandleMessage(new SecurityDefinitionOptionParameterEndMessage(reqId));
            ibClient.SoftDollarTiers                      += (reqId, tiers) => HandleMessage(new SoftDollarTiersMessage(reqId, tiers));
        }
Ejemplo n.º 12
0
		/// <summary>
		/// Сохранение выбранного менеджера сканеров в конфигурационный файл.
		/// </summary>
		/// <param name="scannerManager">Выбранных менеджер сканеров.</param>
		private void SaveScannerManagerSettings(ScannerManager scannerManager)
	    {
			if (RuntimeConfigurationManager.UpdateAppSettings("ScannerManager", scannerManager.ToString()))
				UpdateScannerManager(scannerManager);
	    }
Ejemplo n.º 13
0
 private void Awake()
 {
     instance = this;
 }
Ejemplo n.º 14
0
 public void Init()
 {
     SavedDataServices.LoadEverything();
     m_scannerManager = InstanceManager.ScannerManager;
 }
Ejemplo n.º 15
0
 public ScanningForm(ScannerManager manager)
     : this()
 {
     this.scanner = manager;
 }
Ejemplo n.º 16
0
 public void Init()
 {
     m_scannerManager     = InstanceManager.ScannerManager;
     m_guiManager         = InstanceManager.GUIManager;
     m_gameLoopController = InstanceManager.GameLoopController;
 }