• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Pipe类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ThreadPoolConsumerPool

		public ThreadPoolConsumerPool(IServiceBus bus, IObjectBuilder objectBuilder, Pipe eventAggregator, TimeSpan receiveTimeout)
		{
			_objectBuilder = objectBuilder;
			_receiveTimeout = receiveTimeout;
			_eventAggregator = eventAggregator;
			_bus = bus;
		}
开发者ID:KevM,项目名称:MassTransit,代码行数:7,代码来源:ThreadPoolConsumerPool.cs


示例2: mapCore

        // TODO: Eliminate these AsPipe/AsConitnuable switches... framework-wide
        private void mapCore(string urlPrefix, Func<Pipe, Pipe, Pipe> mapFunc, Pipe cont)
        {
            var err = HttpErrors.MethodNotAllowed();
              var notMethod = _mappings.FindMapping(urlPrefix, ifNotFound: err);

              _mappings[urlPrefix] = mapFunc(cont, notMethod);
        }
开发者ID:chakrit,项目名称:plumber,代码行数:8,代码来源:Controller.cs


示例3: Merge

        public void Merge(
            FileInfo           source,
            Pipe<CilDocumentSyntax> compile,
            FileInfo           destination)
        {
            CilSyntax context = CilBackend.CreateCompiler(null);
            context
            .BeginDocument()
                .AssemblyRewrite(source.FullName)
                    .CustomAttribute(
                        context.Types.Import(
                            typeof(DerivedAssemblyMarker)))
                .EndAssembly()
                .Do(compile)
            .EndDocument();

            ((IAssemblyResolverParameters)context).AddSearchDirectory(destination.DirectoryName);

            var writer = context as IAssemblyWriter;
            if (writer == null)
            {
                throw new InvalidOperationException("Backend does not support assembly writing");
            }

            writer.Write(destination.FullName);
        }
开发者ID:bkushnir,项目名称:IronTextLibrary,代码行数:26,代码来源:DerivedAssemblyMerger.cs


示例4: GenerateItems

    public override void GenerateItems(Pipe pipe)
    {
        float start = pipe.pipeSegmentCount + 0.5f;
        //float direction = Random.value < 0.5f ? 1f : -1f;

        //float angleStep = pipe.CurveAngle / pipe.CurveSegmentCount;

        float direction = 0.30f;

        float angleStep = 2.4f;
        for (int i = 0; i < 1; i++)
        {
            if(i>1)
            {

                PipeItem item = Instantiate<PipeItem>(
                itemPrefabs[Random.Range(0, itemPrefabs.Length)].GetComponent<PipeItem>());
                float pipeRotation =
                    (start + i * direction) * 360f / pipe.pipeSegmentCount;
                item.Position(pipe, angleStep, pipeRotation);

            }
            else
            {

                PipeItem item = Instantiate<PipeItem>(
                itemPrefabs[Random.Range(0, itemPrefabs.Length)].GetComponent<PipeItem>());
                float pipeRotation =
                    ((start * 7.5f) + i * direction) * 360f / pipe.pipeSegmentCount;
                item.Position(pipe, angleStep, pipeRotation);

            }

        }
    }
开发者ID:ChrisCrossed,项目名称:SpaceTube,代码行数:35,代码来源:CrossPlacer.cs


示例5: PumpingRound

        public static void PumpingRound()
        {
            Pump<TextMessage> pump = new Pump<TextMessage>();
            pump.Initialize();
            pump.Interval = 1;
            
            Pipe<TextMessage> p1 = new Pipe<TextMessage>();
            Pipe<TextMessage> p2 = new Pipe<TextMessage>();
            Pipe<TextMessage> p3 = new Pipe<TextMessage>();
            Pipe<TextMessage> p4 = new Pipe<TextMessage>();

            p1.Initialize();
            p2.Initialize();
            p3.Initialize();
            p4.Initialize();

            pump.AddFlow(p1, p2);
            pump.AddFlow(p2, p3);
            pump.AddFlow(p3, p4);
            pump.AddFlow(p4, p1);

            p1.AddInputNotify(new Notify(NotifyOutput));
            p2.AddInputNotify(new Notify(NotifyOutput2));
            p3.AddInputNotify(new Notify(NotifyOutput));
            p4.AddInputNotify(new Notify(NotifyOutput2));
            
            p1.Push(new TextMessage("bla bla"));

            pump.Start();            

            Console.ReadLine();
        }
开发者ID:bolke,项目名称:Sewer,代码行数:32,代码来源:Program.cs


示例6: BasicApiProvider_1_4

 public BasicApiProvider_1_4(IMapper mapper, Pipe eventAggregator)
 {
     Helper.GuardNotNull(mapper);
     Helper.GuardNotNull(eventAggregator);
     _mapper = mapper;
     _eventAggregator = eventAggregator;
 }
开发者ID:kumarkmmca,项目名称:pjsip4net,代码行数:7,代码来源:BasicApiProvider_1_4.cs


示例7: CreateGraph

        public Graph CreateGraph(Pipe pipe)
        {
            var visitor = new GraphPipelineVisitor();
            visitor.Visit(pipe);

            return CreateGraph(visitor.Vertices, visitor.Edges);
        }
开发者ID:xliang,项目名称:Magnum,代码行数:7,代码来源:PipelineGraphGenerator.cs


示例8: Position

 public void Position(Pipe pipe, float curveRotation, float ringRotation)
 {
     transform.SetParent(pipe.transform, false);
     transform.localRotation = Quaternion.Euler(0f, 0f, -curveRotation);
     rotater.localPosition = new Vector3(0f, pipe.CurveRadius);
     rotater.localRotation = Quaternion.Euler(ringRotation, 0f, 0f);
 }
开发者ID:VeselovAlex,项目名称:PipeWUnity,代码行数:7,代码来源:PipeItem.cs


示例9: Visit

        protected virtual Pipe Visit(Pipe pipe)
        {
            if (pipe == null)
                return pipe;

            switch (pipe.SegmentType)
            {
                case PipeSegmentType.End:
                    return VisitEnd((EndSegment)pipe);

                case PipeSegmentType.Filter:
                    return VisitFilter((FilterSegment)pipe);

                case PipeSegmentType.Input:
                    return VisitInput((InputSegment)pipe);

                case PipeSegmentType.MessageConsumer:
                    return VisitMessageConsumer((MessageConsumerSegment)pipe);

                case PipeSegmentType.RecipientList:
                    return VisitRecipientList((RecipientListSegment)pipe);

                case PipeSegmentType.Interceptor:
                    return VisitInterceptor((InterceptorSegment)pipe);

                default:
                    throw new ArgumentException("The pipe node is not a known type: " + pipe.SegmentType,
                                                "pipeline");
            }
        }
开发者ID:daffers,项目名称:Magnum,代码行数:30,代码来源:AbstractPipeVisitor.cs


示例10: displayIndex

        private Pipe displayIndex(Pipe notFound)
        {
            var specialFolders = new[] { ".", ".." };

              return (ctx, next) =>
              {
            // validate path
            var curPath = Path.Combine(_basePath, ctx.Request.Path.Substring(1));
            var fullPath = Path.GetFullPath(curPath);

            if (!Directory.Exists(curPath) || !fullPath.StartsWith(_basePath)) {
              notFound(ctx, next);
              return;
            }

            // generate list of files and folders to display in the index
            var entries = Directory
              .GetFiles(curPath)
              .Concat(Directory.GetDirectories(curPath))
              .Select(path => path.Substring(_basePath.Length));

            if (curPath != _basePath)
              entries = entries.Concat(specialFolders);

            // render the index page
            var html = _template.RenderIndex(curPath, entries.ToArray());
            Static.String(Mime.Text.Html, html)(ctx, next);
              };
        }
开发者ID:chakrit,项目名称:plumber,代码行数:29,代码来源:Program.cs


示例11: spawnPipes

 void spawnPipes()
 {
     lastPipes = (Pipe)Instantiate(pipes);
     lastPipes.p = p;
     lastPipes.speed = pipeSpeed;
     lastPipes.transform.position = new Vector3(12,Random.Range(minHeight,maxHeight),0);
 }
开发者ID:RezaRukmana,项目名称:TGK-Flappy,代码行数:7,代码来源:PipeGenerator.cs


示例12: GdbProtocol

 public GdbProtocol(Pipe pipe)
 {
     mPipe = pipe;
     mPipe.PipeReceiveEvent += RecvFired;
     mTimer.Elapsed += ResendTimer;
     mTimer.Start();
 }
开发者ID:HBelusca,项目名称:NasuTek-Odyssey-Tools,代码行数:7,代码来源:gdbbase.cs


示例13: BlockingPipe

		internal BlockingPipe(Pipe pipe)
			: base(pipe.Loop)
		{
			Handle = pipe;
			Stream = pipe;
			Pipe = pipe;
		}
开发者ID:txdv,项目名称:LibuvSharp.Blocking,代码行数:7,代码来源:BlockingPipe.cs


示例14: Connect

        public static IServer Connect(this IContainer container,
            string host, int port, Pipe pipes, params IService[] services)
        {
            var broker = container.BuildServicesBroker(services);
              var handler = container.BuildRequestHandler(pipes, broker);

              return container.BuildServer(host, port, handler);
        }
开发者ID:chakrit,项目名称:plumber,代码行数:8,代码来源:Pipes.cs


示例15: TimeoutTest

        public void TimeoutTest()
        {
            var pipe = new Pipe {OutputStream = {ReadTimeout = 0}};
            Assert.Throws<TimeoutException>(() => pipe.OutputStream.ReadByte());

            pipe.WriteText(new string('a', 2048));
            Assert.AreEqual(new string('a', 2048), pipe.ReadTextAsync(2048).Result);
        }
开发者ID:narkhedegs,项目名称:Pipe,代码行数:8,代码来源:PipeTest.cs


示例16: Start

 // Use this for initialization
 void Start()
 {
     world = pipeSystem.transform.parent;
     rotater = transform.GetChild(0);
     currentPipe = pipeSystem.SetupFirstPipe();
     deltaToRotation = 360f / (2f * Mathf.PI * currentPipe.CurveRadius);
     SetupCurrentPipe();
 }
开发者ID:VeselovAlex,项目名称:PipeWUnity,代码行数:9,代码来源:Player.cs


示例17: Setup

        public void Setup()
        {
            Input = PipeSegment.Input(PipeSegment.End<object>());
            BeforeCalled = new ManualResetEvent(false);
            AfterCalled = new ManualResetEvent(false);

            EstablishContext();
        }
开发者ID:daffers,项目名称:Magnum,代码行数:8,代码来源:Interceptor_Specs.cs


示例18: StraightThroughPipelineRunner

		public StraightThroughPipelineRunner()
		{
			Pipe consumer = PipeSegment.Consumer<ClaimModified>(m => Interlocked.Increment(ref _count));

			_input = PipeSegment.Input(consumer);

			_message = new ClaimModified();
		}
开发者ID:daffers,项目名称:Magnum,代码行数:8,代码来源:StraightThroughPipelineRunner.cs


示例19: Disconnect

 public void Disconnect(Pipe pipe)
 {
     if(Pipe != pipe)
     {
         Debug.LogWarning("Tried to disconnect unconnected pipe");
         return;
     }
     Pipe = null;
 }
开发者ID:GabrielSibley,项目名称:games,代码行数:9,代码来源:Dock.cs


示例20: indexCheck

 private Pipe indexCheck(Pipe onFolder, Pipe onFile)
 {
     return (ctx, next) =>
       {
     var path = mapPath(ctx.Request.Path);
     (string.IsNullOrEmpty(path) || Directory.Exists(path) ? onFolder : onFile)
       (ctx, next);
       };
 }
开发者ID:chakrit,项目名称:plumber,代码行数:9,代码来源:Program.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PipeDirection类代码示例发布时间:2022-05-24
下一篇:
C# PingMessage类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap