当前位置: 首页>>代码示例>>C#>>正文


C# IConnector类代码示例

本文整理汇总了C#中IConnector的典型用法代码示例。如果您正苦于以下问题:C# IConnector类的具体用法?C# IConnector怎么用?C# IConnector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IConnector类属于命名空间,在下文中一共展示了IConnector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StringSearcherControl

 public StringSearcherControl(IConnector connector)
 {
     InitializeComponent();
     this.connector = connector;
     comboBox1.SelectedIndex = 2;
     comboBox2.SelectedIndex = 0;
 }
开发者ID:JerreS,项目名称:StringSearcherPlugin,代码行数:7,代码来源:StringSearcherControl.cs

示例2: MatLabConnector

		/// <summary>
		/// Создать <see cref="MatLabConnector"/>.
		/// </summary>
		/// <param name="realConnector">Подключение, через которое будут отправляться заявки и получатся маркет-данные.</param>
		/// <param name="ownTrader">Контролировать время жизни подключения <paramref name="realConnector"/>.</param>
		public MatLabConnector(IConnector realConnector, bool ownTrader)
		{
			if (realConnector == null)
				throw new ArgumentNullException("realConnector");

			RealConnector = realConnector;

			RealConnector.Connected += RealTraderOnConnected;
			RealConnector.ConnectionError += RealTraderOnConnectionError;
			RealConnector.Disconnected += RealTraderOnDisconnected;
			RealConnector.Error += RealTraderOnError;
			RealConnector.MarketTimeChanged += RealTraderOnMarketTimeChanged;
			RealConnector.NewSecurities += RealTraderOnNewSecurities;
			RealConnector.SecuritiesChanged += RealTraderOnSecuritiesChanged;
			RealConnector.NewPortfolios += RealTraderOnNewPortfolios;
			RealConnector.PortfoliosChanged += RealTraderOnPortfoliosChanged;
			RealConnector.NewPositions += RealTraderOnNewPositions;
			RealConnector.PositionsChanged += RealTraderOnPositionsChanged;
			RealConnector.NewTrades += RealTraderOnNewTrades;
			RealConnector.NewMyTrades += RealTraderOnNewMyTrades;
			RealConnector.NewMarketDepths += RealTraderOnNewMarketDepths;
			RealConnector.MarketDepthsChanged += RealTraderOnMarketDepthsChanged;
			RealConnector.NewOrders += RealTraderOnNewOrders;
			RealConnector.OrdersChanged += RealTraderOnOrdersChanged;
			RealConnector.OrdersRegisterFailed += RealTraderOnOrdersRegisterFailed;
			RealConnector.OrdersCancelFailed += RealTraderOnOrdersCancelFailed;
			RealConnector.NewStopOrders += RealTraderOnNewStopOrders;
			RealConnector.StopOrdersChanged += RealTraderOnStopOrdersChanged;
			RealConnector.StopOrdersRegisterFailed += RealTraderOnStopOrdersRegisterFailed;
			RealConnector.StopOrdersCancelFailed += RealTraderOnStopOrdersCancelFailed;
			RealConnector.NewOrderLogItems += RealTraderOnNewOrderLogItems;

			_ownTrader = ownTrader;
		}
开发者ID:reddream,项目名称:StockSharp,代码行数:39,代码来源:MatLabConnector.cs

示例3: MessageClient

        internal MessageClient(IConnector connector)
        {
            Contract.Requires(connector != null);

            this.Connector = connector;
            this.Connector.Connected += (sender, e) => OnConnected();
            this.Connector.ConnectFailed += (sender, e) => OnConnectFailed(e.Exception);
            this.Connector.Disconnected += (sender, e) => OnDisconnected();
        }
开发者ID:sunoru,项目名称:PBO,代码行数:9,代码来源:MessageClient.cs

示例4: ConnectStart

		public virtual void ConnectStart (IConnector start)	{
			if (StartConnector == start) {
				return;
			}

			DisconnectStart ();
			StartConnector = start;
			ConnectFigure (StartConnector);
			OnConnectionChanged();
		}
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:10,代码来源:LineConnection.cs

示例5: LivenessMonitor

        public LivenessMonitor(IConnector connector, int livenessTimeout = 60000, int receiveTimeout = 10000)
        {
            IsUp = true;
            this.connector = connector;
            connector.MessageReceived += connector_MessageReceived;
            ReceiveTimeout = receiveTimeout;

            timer = new System.Timers.Timer(livenessTimeout);
            timer.Elapsed += timer_Elapsed;
        }
开发者ID:renber,项目名称:AvisNet,代码行数:10,代码来源:LivenessMonitor.cs

示例6: ProcessAttachEndPoint

        public static void ProcessAttachEndPoint(IBlockWeb containerWeb, IConnector connector, XmlElement endpointElement, string blockId)
        {
            string endpointKey = null;

            if (endpointElement.Name == "valueEndPoint")
            {
                if (!TemplateProcessor.ProcessTemplateFile(endpointElement, containerWeb, blockId, connector))
                {
                    object value = ObjectReader.ReadObject(endpointElement);
                    endpointKey = connector.AttachEndPoint(value);
                }
            }
            else if (endpointElement.Name == "serviceEndPoint")
            {
                if (!TemplateProcessor.ProcessTemplateFile(endpointElement, containerWeb, blockId, connector))
                {
                    string endpointBlockId = endpointElement.GetAttribute("blockId");
                    string endpointService = endpointElement.GetAttribute("service");

                    if (!endpointElement.HasAttribute("blockId")) endpointBlockId = blockId;

                    endpointKey = connector.AttachEndPoint(endpointBlockId, endpointService);
                }
            }
            else if (endpointElement.Name == "connectorEndPoint")
            {
                if (!TemplateProcessor.ProcessTemplateFile(endpointElement, containerWeb, blockId, connector))
                {
                    string endpointBlockId = endpointElement.GetAttribute("blockId");
                    string endPointConnectorKey = endpointElement.GetAttribute("connectorKey");

                    if (!endpointElement.HasAttribute("blockId")) endpointBlockId = blockId;

                    endpointKey = connector.AttachConnectorEndPoint(endpointBlockId, endPointConnectorKey);
                }
            }
            else
            {
                throw new InvalidOperationException();
            }

            //now process fixed args
            XmlElement fixedArgsElement = endpointElement.SelectSingleNode("fixedArgs") as XmlElement;

            if (fixedArgsElement != null && endpointKey != null)
            {
                List<Connector.EndPoint> fixedArgs = EndPointExtractor.ExtractArguments(fixedArgsElement, containerWeb);

                foreach (Connector.EndPoint endPoint in fixedArgs)
                {
                    connector.AddFixedArg(endpointKey, endPoint);
                }
            }
        }
开发者ID:mm-binary,项目名称:DARF,代码行数:54,代码来源:EndPointExtractor.cs

示例7: MarketTimer

		/// <summary>
		/// Создать <see cref="MarketTimer"/>.
		/// </summary>
		/// <param name="connector">Подключение к торговой системе, из которого будет использоваться событие <see cref="IConnector.MarketTimeChanged"/>.</param>
		/// <param name="activated">Обработчик таймера.</param>
		public MarketTimer(IConnector connector, Action activated)
		{
			if (connector == null)
				throw new ArgumentNullException("connector");

			if (activated == null)
				throw new ArgumentNullException("activated");

			_connector = connector;
			_activated = activated;
		}
开发者ID:knoppixmeister,项目名称:StockSharp,代码行数:16,代码来源:MarketTimer.cs

示例8: RougeSpyGameScene

        public RougeSpyGameScene(SceneHandler handler, string name, IConnector connector, GraphicsDeviceManager graphicsDeviceManager)
            : base(handler, name, connector, graphicsDeviceManager)
        {
            //movement system
            MainSystem.UpdateComplexSystem.AddSubSystem(new InputUpdateSystem(MainSystem));
            MainSystem.UpdateComplexSystem.AddSubSystem(new CalculateMovementUpdateSystem(MainSystem));
            MainSystem.UpdateComplexSystem.AddSubSystem(new HitBoxCollisionUpdateSystem(MainSystem));
            MainSystem.UpdateComplexSystem.AddSubSystem(new ApplyMovementUpdateSystem(MainSystem));
            MainSystem.UpdateComplexSystem.AddSubSystem(new HitBoxUpdateSystem(MainSystem));

            //render system
            MainSystem.RenderComplexSystem.AddSubSystem(new Texture2DRenderSystem(MainSystem));
            MainSystem.RenderComplexSystem.AddSubSystem(new HitBoxRenderSystem(MainSystem, 2));

            //Player
            PlayerID = MainSystem.CreateEntityID();
            MainSystem.GetUpdateSystem<InputUpdateSystem>().CreateInputNode(PlayerID, new GamePadInput());
            MainSystem.GetUpdateSystem<CalculateMovementUpdateSystem>().CreateMovementNode(PlayerID);
            MainSystem.GetUpdateSystem<ApplyMovementUpdateSystem>().CreateMovementNode(PlayerID);
            MainSystem.GetComponent<Motion2DComponent>(PlayerID).Acceleration = 0.2f;
            MainSystem.GetComponent<Motion2DComponent>(PlayerID).Decceleration = 0.3f;
            MainSystem.GetComponent<Motion2DComponent>(PlayerID).MaxSpeed = 10.0f;
            Texture2D texture = AssetLoader.Instance.Load<Texture2D>("Player_Alpha_64_43");
            MainSystem.GetRenderSystem<Texture2DRenderSystem>().CreateTexture2DRenderNode(PlayerID, texture);
            MainSystem.GetComponent<Position2DComponent>(PlayerID).Position = new Vector2(200);
            MainSystem.GetComponent<Position2DComponent>(PlayerID).Origin = new Vector2(texture.Width / 2, texture.Height / 2);

            List<Vector2> points = new List<Vector2>();
            points.Add(Vector2.Zero);
            points.Add(new Vector2(texture.Width - 24, 0));
            points.Add(new Vector2(texture.Width - 24, texture.Height));
            points.Add(new Vector2(0, texture.Height));
            MainSystem.GetUpdateSystem<HitBoxUpdateSystem>().CreateHitBoxNode(PlayerID, points);
            MainSystem.GetComponent<HitBox2DComponent>(PlayerID).Offset = new Vector2(12, 0);
            MainSystem.GetUpdateSystem<HitBoxCollisionUpdateSystem>().CreateHitBoxCollisionUpadateNode(PlayerID, points, new PositionCorrectionHitBoxIntersectionReaction(MainSystem, PlayerID));
            MainSystem.GetRenderSystem<HitBoxRenderSystem>().CreateHitBoxRenderNode(PlayerID, points);

            string[][] blueprint = new string[3][];
            blueprint[0] = new string[] { "w", "w", "w" };
            blueprint[1] = new string[] { "w", " ", "w" };
            blueprint[2] = new string[] { "w", "w", "w" };

            List<Vector2> hitBoxOutline = new List<Vector2>();
            hitBoxOutline.Add(new Vector2(0, 0));
            hitBoxOutline.Add(new Vector2(64, 0));
            hitBoxOutline.Add(new Vector2(64, 64));
            hitBoxOutline.Add(new Vector2(0, 64));

            List<TileBluePrint> tileBluePrints = new List<TileBluePrint>();
            tileBluePrints.Add(new TileBluePrint("w", AssetLoader.Instance.Load<Texture2D>("WoodenTileA"), hitBoxOutline));
            TileMapBluePrint tileMapBluePrint = new TileMapBluePrint(blueprint, tileBluePrints, new Vector2(64,64));
            TileMapLoader.Load(tileMapBluePrint, MainSystem);            
        }
开发者ID:Norskan,项目名称:Playground,代码行数:53,代码来源:TestGroundGameScene.cs

示例9: _ConnectAsyncCallback

        private void _ConnectAsyncCallback(IConnector connector, object callbackState)
        {
            if (!(callbackState is object[])) throw new ArgumentException();

            object[] states = (object[])callbackState;
            ConnectAsyncCallback callback = states[0] as ConnectAsyncCallback;
            object state = states[2];

            Daemon = new Daemon(_factory);
            Core = new Core(_factory);
            callback(connector, state);
        }
开发者ID:fuzeman,项目名称:DelugeRPC.NET,代码行数:12,代码来源:DelugeRPC.cs

示例10: GetSourceFieldForConnection

        /// <summary>
        /// Gets the source field for connection.
        /// </summary>
        /// <param name="connector">The connector.</param>
        /// <returns>SourceField.</returns>
        public SourceField GetSourceFieldForConnection(IConnector connector)
        {
            var fields = new List<SourceField>();
            CollectAllFields(fields, null);

            var field = fields.FirstOrDefault(con => con.ConnectorOut.Id == connector.Id);
            if (field != null)
            {
                field.DataType = connector.DataType;
            }
            return field;
        }
开发者ID:mparsin,项目名称:Elements,代码行数:17,代码来源:SourceFieldList.cs

示例11: AttachConnector

 public void AttachConnector(IConnector connector)
 {
     if(connector == null)
         return;
     //only attach'm if not already present and not the parent
     if(!attachedConnectors.Contains(connector) && connector!=attachedTo)
     {
         connector.DetachFromParent();
         attachedConnectors.Add(connector);
         //make sure the attached connector is centered at this connector
         connector.Point = this.point;
         connector.AttachedTo = this;
     }
 }
开发者ID:Tom-Hoinacki,项目名称:OO-CASE-Tool,代码行数:14,代码来源:ConnectorBase.cs

示例12: Scene

        public Scene(SceneHandler handler, string name, IConnector connector, GraphicsDeviceManager graphicsDeviceManager, List<Scene> children)
        {
            Handler = handler;
            Name = name;
            Connector = connector;

            GraphicsDeviceManager = graphicsDeviceManager;

            if (connector != null)
            {
                Connector.Next = this;
            }

            Children = children;
        }
开发者ID:Norskan,项目名称:Playground,代码行数:15,代码来源:Scene.cs

示例13: FrmDatabaseImportProcess

        public FrmDatabaseImportProcess(List<DataImportTable> tableList, DataBase newBase, Connector.SgbdType sgbdType, IConnector conn)
        {
            InitializeComponent();
            Cursor.Current = Cursors.WaitCursor;
            _sgbdType = sgbdType;
            _db = newBase;
            _tableList = tableList;
            _conn = conn;
            foreach (DataImportTable table in tableList)
                table.Count = conn.GetCount(table.Name);
            _columnsCount = tableList.Sum(t => t.Columns.Count);

            launch();
            Cursor.Current = Cursors.Default;
        }
开发者ID:TMA-AQ,项目名称:AlgoQuest,代码行数:15,代码来源:FrmDatabaseImportProcess.cs

示例14: DDTConnection

        public DDTConnection(IConnector mFrom, IConnector mTo, IModel model, ConnectionType type)
            : base(model)
        {
            this.From = new Connector(mFrom.Point, model);
                this.From.Name = "From";
                this.From.Parent = this;

                From.AttachTo(mFrom);

                this.To = new Connector(mTo.Point, model); ;
                this.To.Name = "To";
                this.To.Parent = this;

                To.AttachTo(mTo);

            this.connectionType = type;
        }
开发者ID:Tom-Hoinacki,项目名称:OO-CASE-Tool,代码行数:17,代码来源:DDTConnection.cs

示例15: OnDeserialization

		public void OnDeserialization (Object sender) {
			ConnectFigure (_startConnector);
			StartConnector = _startConnector;
			
			ConnectFigure (_endConnector);
			EndConnector = _endConnector;
		}
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:7,代码来源:LineConnection.cs


注:本文中的IConnector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。