本文整理汇总了C#中Pipeline.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# Pipeline.Dispose方法的具体用法?C# Pipeline.Dispose怎么用?C# Pipeline.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pipeline
的用法示例。
在下文中一共展示了Pipeline.Dispose方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main(string [] args)
{
Application.Init ();
Pipeline pipeline = new Pipeline ("pipeline");
Element source = ElementFactory.Make ("filesrc", "source");
typefind = TypeFindElement.Make ("typefind");
Element sink = ElementFactory.Make ("fakesink", "sink");
source.SetProperty ("location", args[0]);
typefind.HaveType += OnHaveType;
pipeline.AddMany (source, typefind, sink);
source.Link (typefind);
typefind.Link (sink);
pipeline.SetState (State.Paused);
pipeline.SetState (State.Null);
source.Dispose ();
typefind.Dispose ();
sink.Dispose ();
pipeline.Dispose ();
}
示例2: DisposeTest
public void DisposeTest()
{
bool failed = false;
Pipeline<int> pipeline = new Pipeline<int>((i) => {
Thread.Sleep(50);
failed = true; // this should not run because the dispose will kill the thread before it gets scheduled
});
pipeline.Push(1);
pipeline.Dispose();
Assert.True(!failed);
}
示例3: Main
public static void Main (string [] args) {
Application.Init();
Pipeline pipeline = new Pipeline ("pipeline");
FileSrc source = FileSrc.Make ("source");
typefind = TypeFindElement.Make ("typefind");
FakeSink sink = FakeSink.Make ("sink");
source.Location = args[0];
typefind.HaveType += OnHaveType;
pipeline.Add (source, typefind, sink);
source.Link (typefind);
typefind.Link (sink);
pipeline.SetState (State.Paused);
pipeline.SetState (State.Null);
pipeline.Dispose();
}