本文整理汇总了C#中Monitor类的典型用法代码示例。如果您正苦于以下问题:C# Monitor类的具体用法?C# Monitor怎么用?C# Monitor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Monitor类属于命名空间,在下文中一共展示了Monitor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Init
static void Init(string programPath)
{
client = new TenhouClient("aixile");
gameEnd.Reset();
client.OnLogin += () =>
{
//client.EnterLobby(0);
client.Join(GameType.North);
client.Join(GameType.North_fast);
client.Join(GameType.East);
client.Join(GameType.East_fast);
};
client.OnGameEnd += () => { gameEnd.Set(); };
client.OnClose += () => { gameEnd.Set(); };
monitor = new Monitor(client);
monitor.Start();
controller = new Controller(client, programPath);
controller.Start();
client.Login();
}
开发者ID:key8931,项目名称:Tenhou-Client,代码行数:25,代码来源:Program.cs
示例2: Main
public static int Main(String[] args)
{
Monitor monitor = new Monitor();
SocketListener listener = new SocketListener(monitor);
listener.startListening();
return 0;
}
开发者ID:2XL,项目名称:CPUMonitor,代码行数:7,代码来源:SocketListener.cs
示例3: Main
private static void Main(string[] args)
{
//string filename =
// @"..\..\..\Dev.ProcessMonitor.TestTargerExe\bin\Debug\Dev.ProcessMonitor.TestTargerExe.exe";
//string arg = "";
////string filename =
//// @"..\..\..\Dev.ProcessMonitor.FormTest\bin\Debug\Dev.ProcessMonitor.FormTest.exe";
////string arg = "";
//var starter = new ProcessStarterAsyn(filename, arg);
//starter.StandardErrorOut += starter_StandardErrorOut;
//starter.StandardOut += starter_StandardOut;
//starter.StartAsyn();
//Console.WriteLine("pressanykey");
var m = new Monitor(true);
m.StandardErrorOut += m_StandardErrorOut;
m.Start();
Console.ReadKey();
m.Stop();
}
开发者ID:safawo,项目名称:Dev.ProcessMonitor,代码行数:29,代码来源:Program.cs
示例4: OnStart
protected override void OnStart(string[] args)
{
m = new Monitor(true);
m.StandardErrorOut += m_StandardErrorOut;
m.StandardOut += m_StandardOut;
m.Start();
}
开发者ID:safawo,项目名称:Dev.ProcessMonitor,代码行数:7,代码来源:Service1.cs
示例5: ToString
public override string ToString()
{
g = (Monitor)base.Tag;
Binding myBinding = new Binding("ext");
myBinding.Mode = BindingMode.TwoWay;
myBinding.Source = g;
txtext.SetBinding(TextBox.TextProperty, myBinding);
Binding myBinding2 = new Binding("basename");
myBinding2.Mode = BindingMode.TwoWay;
myBinding2.Source = g;
txtbase.SetBinding(TextBox.TextProperty, myBinding2);
Binding myBinding3 = new Binding("flags");
myBinding3.Mode = BindingMode.TwoWay;
myBinding3.Source = g;
txtflags.SetBinding(TextBox.TextProperty, myBinding3);
Binding descbinding = new Binding("Description");
descbinding.Mode = BindingMode.TwoWay;
descbinding.Source = g;
txtdesc.SetBinding(TextBox.TextProperty, descbinding);
return base.ToString();
}
开发者ID:julianobarbosa,项目名称:integradesigner,代码行数:28,代码来源:MonitorProperty.xaml.cs
示例6: OnePassDataIndexer
/// <summary>
/// Initializes a new instance of the <see cref="OnePassDataIndexer"/> class, using a event stream, a cutoff value and a value that indicates if the events should be sorted.
/// </summary>
/// <param name="eventStream">The event stream.</param>
/// <param name="cutoff">The cutoff.</param>
/// <param name="sort">if set to <c>true</c> the events will be sorted during the indexing.</param>
/// <param name="monitor">The evaluation monitor.</param>
public OnePassDataIndexer(IObjectStream<Event> eventStream, int cutoff, bool sort, Monitor monitor)
: base(monitor) {
EventStream = eventStream;
Cutoff = cutoff;
Sort = sort;
}
开发者ID:knuppe,项目名称:SharpNL,代码行数:14,代码来源:OnePassDataIndexer.cs
示例7: MainPage
public MainPage()
{
this.InitializeComponent ();
this.teams = new TeamCollection ();
this.attacks = new AttackCollection (this.LayoutCanvas);
this.allocators =
new AllocatorClassifier (new [] {
typeof (CircleAllocator),
typeof (RectangleAllocator),
typeof (GridAllocator)
});
this.monitor = new Monitor ();
this.lock_object = new object ();
this.service_names = new List <string> ();
this.windowSize = new Size (this.LayoutCanvas.Width, this.LayoutCanvas.Height);
this.speed = (int) this.speedSlider.Value + 1;
this.realtimeMode = this.realtime.IsChecked == true;
this.begin_with_realtime = false;
this.play_iter = 0;
this.update_interval = 10;
foreach (var allocator in this.allocators)
this.Allocation.Items.Add (allocator.Name);
this.Allocation.SelectedIndex = this.allocators.Index;
}
开发者ID:HackerDom,项目名称:ructf-2013-final,代码行数:29,代码来源:MainPage.xaml.cs
示例8: AddMonitor
//public void AddBattery(Battery battery)
//{
// using (var db = new ShopContext())
// {
// var tmp = (from entity in db.Carts
// where entity.GoodsId == battery.Id
// where entity.GoodsCategory == "battery"
// select entity).FirstOrDefault();
// if (tmp == null)
// {
// var cart = new Cart
// {
// GoodsId = battery.Id,
// GoodsCategory = "battery",
// Price = battery.Price,
// Count = 1
// };
// db.Carts.Add(cart);
// }
// else
// {
// tmp.Count++;
// db.Entry(tmp).State = EntityState.Modified;
// }
// db.SaveChanges();
// }
//}
public void AddMonitor(Monitor monitor, List<Cart> list)
{
var cart = new Cart
{
GoodsId = monitor.Id,
GoodsCategory = "Monitors",
Price = monitor.Price,
Count = 1
};
var flg = 1;
foreach (Cart item in list)
{
if (item.GoodsId == monitor.Id && item.GoodsCategory == "Monitors")
{
item.Count++;
flg = 0;
break;
}
}
if (flg == 1)
{
list.Add(cart);
}
}
开发者ID:krasnovandr,项目名称:VeryOldTrash,代码行数:52,代码来源:CartRepository.cs
示例9: ParseContexts
/// <summary>
/// Parses the specified contexts and re-populates context array with features and returns
/// the values for these features.
/// If all values are unspecified, then null is returned.
/// </summary>
/// <param name="contexts">The contexts.</param>
/// <param name="monitor">The evaluation monitor.</param>
/// <returns>The event values.</returns>
/// <exception cref="System.InvalidOperationException">Negative values are not allowed: context</exception>
public static float[] ParseContexts(string[] contexts, Monitor monitor) {
var hasRealValue = false;
var values = new float[contexts.Length];
for (var ci = 0; ci < contexts.Length; ci++) {
var ei = contexts[ci].LastIndexOf("=", StringComparison.InvariantCulture);
if (ei > 0 && ei + 1 < contexts[ci].Length) {
var gotReal = true;
try {
values[ci] = float.Parse(contexts[ci].Substring(ei + 1), CultureInfo.InvariantCulture);
} catch (Exception) {
gotReal = false;
if (monitor != null)
monitor.OnError("Unable to determine value in context:" + contexts[ci]);
values[ci] = 1;
}
if (gotReal) {
if (values[ci] < 0) {
throw new InvalidOperationException("Negative values are not allowed: " + contexts[ci]);
}
contexts[ci] = contexts[ci].Substring(0, ei);
hasRealValue = true;
}
} else {
values[ci] = 1;
}
}
if (!hasRealValue) {
values = null;
}
return values;
}
开发者ID:knuppe,项目名称:SharpNL,代码行数:42,代码来源:RealValueFileEventStream.cs
示例10: SetMonitor
public override void SetMonitor(Monitor mon)
{
foreach (Solver t in solvers)
{
t.SetMonitor(mon);
}
}
开发者ID:samplet,项目名称:HalfAndHalf,代码行数:7,代码来源:ParallelSolver.cs
示例11: MonitorAdorner
public MonitorAdorner(HeliosVisualView adornedElement, string monitorLabel, Monitor monitor)
: base(adornedElement)
{
_textFormat.VerticalAlignment = TextVerticalAlignment.Center;
_label = monitorLabel;
_monitor = monitor;
}
开发者ID:Heliflyer,项目名称:helios,代码行数:7,代码来源:MonitorAdorner.cs
示例12: HandsRecognition
public HandsRecognition(Monitor mon)
{
m_images = new Queue<PXCMImage>();
this.mon = mon;
LUT = Enumerable.Repeat((byte)0, 256).ToArray();
LUT[255] = 1;
}
开发者ID:GillllllBOOM,项目名称:ThereMe,代码行数:7,代码来源:HandsRecognition.cs
示例13: Setup
public void Setup()
{
buildFactoryFake = new BuildFactoryFake();
buildRepositoryFake = new BuildRepositoryFake();
solutionBuildFake = new SolutionBuildFake();
buildFactoryFake.Build = solutionBuildFake;
monitor = new Monitor(buildFactoryFake, buildRepositoryFake);
}
开发者ID:abhijeetpathak,项目名称:BuildMonitor,代码行数:8,代码来源:MonitorTests.cs
示例14: button4_Click
private void button4_Click(object sender, EventArgs e)
{
var m = new Monitor(true);
m.StandardErrorOut += starter_StandardErrorOut;
m.StandardOut += starter_StandardOut;
m.Start();
}
开发者ID:safawo,项目名称:Dev.ProcessMonitor,代码行数:8,代码来源:Form1.cs
示例15: StartCommand
public StartCommand(Monitor monitor, Func<Machine> getCurrentMachine, IncludeFileCommand includeCommand) : base(monitor, "start", "starts the emulation.", "s")
{
if(includeCommand == null)
{
throw new ArgumentException("includeCommand cannot be null.", "includeCommand");
}
GetCurrentMachine = getCurrentMachine;
IncludeCommand = includeCommand;
}
开发者ID:rte-se,项目名称:emul8,代码行数:9,代码来源:StartCommand.cs
示例16: Service1
public Service1()
{
m = new Monitor(false);
Setting.AttachLog(new ObserverLogToLog4net());
InitializeComponent();
}
开发者ID:safawo,项目名称:Dev.ProcessMonitor,代码行数:9,代码来源:Service1.cs
示例17: Main
private static void Main()
{
using (var monitor = new Monitor("c:\\foobar", "*.dll"))
{
monitor.Start();
// breakpoints in your actual service should not be hit :)
}
}
开发者ID:CSharpFan,项目名称:windows-service-debugging,代码行数:9,代码来源:Program.cs
示例18: Program
public Program()
{
Computer comp = new Computer();
comp = new Disk( comp );
comp = new Monitor( comp );
comp = new CD( comp );
comp = new CD( comp );
Console.WriteLine( comp.Description() );
}
开发者ID:andrecamilo,项目名称:CSharp-GOF-Patterns,代码行数:9,代码来源:Program.cs
示例19: MonitorThread
//Builder
public MonitorThread(Monitor monitor, bool running)
{
this.monitor = monitor;
this.suspensionLvl = 0;
this.serviceMgr = new ServiceTools();
this.suspendMtx = new Mutex();
if (!running)
SuspendThread();
}
开发者ID:Celtc,项目名称:TaskMonitor,代码行数:11,代码来源:MonitorThread.cs
示例20: Main
static void Main(string[] args)
{
Console.Title = "果园的监控";
Orchard orchard = new Orchard(); //创建果园实例
IMonitor bjMonitor = new Monitor(orchard, "北京果园监控员");//北京果园监控员
IMonitor shMonitor = new Monitor(orchard, "上海果园监控员");//上海果园监控员
orchard.State = "苹果园!"; //将果园监控状态改为苹果园
orchard.Notify(); //通知监控员更新监控状态
Console.Read();
}
开发者ID:dalinhuang,项目名称:wdeqawes-efrwserd-rgtedrtf,代码行数:10,代码来源:Program.cs
注:本文中的Monitor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论