本文整理汇总了C#中Tracker类的典型用法代码示例。如果您正苦于以下问题:C# Tracker类的具体用法?C# Tracker怎么用?C# Tracker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Tracker类属于命名空间,在下文中一共展示了Tracker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Tracker
public Tracker()
{
flushListener = new FlushListener (this);
startListener = new StartListener (this);
startLocalStorageListener = new StartLocalStorageListener(this);
tracker = this;
}
示例2: Awake
private void Awake()
{
proximitySensor = GetComponent<Proximity>();
proximityRun = new Utility.IntervalRun(0.2f, (deltaTime) =>
{
proximitySensor.Detect(OnProximityDetect);
});
proximityRun.Start();
isUsed = false;
tracker = GetComponent<Tracker>();
parentRoom = GetComponentInParent<Room>();
if (parentRoom != null)
{
parentRoom.OnVisibilityChange += OnRoomChangeVisibility;
if (parentRoom.IsPlayerInRoom)
{
enabled = true;
}
else
{
enabled = false;
}
}
}
示例3: basic_order_for_eight_handlers_interleaved
public void basic_order_for_eight_handlers_interleaved()
{
var tracker = new Tracker();
var unity = new UnityContainer()
.RegisterInstance(tracker);
var dispatcher = Dispatcher.Create(d => d
.SetUnityContainer(unity)
.RegisterHandler<Message1>((m, s) => s.GetInstance<Tracker>().Handlers.Add(typeof(Byte)))
.RegisterHandler<Message2>((m, s) => s.GetInstance<Tracker>().Handlers.Add(typeof(Byte)))
.RegisterHandler<Message1>((m, s) => s.GetInstance<Tracker>().Handlers.Add(typeof(Int16)))
.RegisterHandler<Message2>((m, s) => s.GetInstance<Tracker>().Handlers.Add(typeof(Int16)))
.RegisterHandler<Message2>((m, s) => s.GetInstance<Tracker>().Handlers.Add(typeof(Int32)))
.RegisterHandler<Message2>((m, s) => s.GetInstance<Tracker>().Handlers.Add(typeof(Int64)))
.RegisterHandler<Message1>((m, s) => s.GetInstance<Tracker>().Handlers.Add(typeof(Int32)))
.RegisterHandler<Message1>((m, s) => s.GetInstance<Tracker>().Handlers.Add(typeof(Int64)))
);
dispatcher.Dispatch(new Message1());
Assert.That(tracker.Handlers.Count, Is.EqualTo(4));
Assert.That(tracker.Handlers[0], Is.EqualTo(typeof(Byte)));
Assert.That(tracker.Handlers[1], Is.EqualTo(typeof(Int16)));
Assert.That(tracker.Handlers[2], Is.EqualTo(typeof(Int32)));
Assert.That(tracker.Handlers[3], Is.EqualTo(typeof(Int64)));
tracker.Reset();
dispatcher.Dispatch(new Message2());
Assert.That(tracker.Handlers.Count, Is.EqualTo(4));
Assert.That(tracker.Handlers[0], Is.EqualTo(typeof(Byte)));
Assert.That(tracker.Handlers[1], Is.EqualTo(typeof(Int16)));
Assert.That(tracker.Handlers[2], Is.EqualTo(typeof(Int32)));
Assert.That(tracker.Handlers[3], Is.EqualTo(typeof(Int64)));
}
示例4: PiwikAnalytics_Droid
public PiwikAnalytics_Droid ()
{
if (_piwikTracker == null) {
Piwik piwik = Piwik.GetInstance (AndroidApp.GetAppContext ());
_piwikTracker = piwik.NewTracker(AppConfigConstants.PiwikBaseUrl, AppConfigConstants.PiwikSiteId);
}
}
示例5: Combine
public static void Combine()
{
Tracker t1 = new Tracker();
D a = new D(t1.A);
D b = new D(t1.B);
D c = new D(t1.C);
D d = new D(t1.D);
D nothing = (D)(Delegate.Combine());
Assert.Null(nothing);
D one = (D)(Delegate.Combine(a));
t1.Clear();
one(5);
Assert.Equal(t1.S, "A5");
CheckInvokeList(new D[] { a }, one, t1);
D ab = (D)(Delegate.Combine(a, b));
t1.Clear();
ab(5);
Assert.Equal(t1.S, "A5B5");
CheckInvokeList(new D[] { a, b }, ab, t1);
D abc = (D)(Delegate.Combine(a, b, c));
t1.Clear();
abc(5);
Assert.Equal(t1.S, "A5B5C5");
CheckInvokeList(new D[] { a, b, c }, abc, t1);
D abcdabc = (D)(Delegate.Combine(abc, d, abc));
t1.Clear();
abcdabc(9);
Assert.Equal(t1.S, "A9B9C9D9A9B9C9");
CheckInvokeList(new D[] { a, b, c, d, a, b, c }, abcdabc, t1);
}
示例6: GUI
public GUI(Tracker t, UDP udp, FlockOfBirds fob)
{
InitializeComponent();
_Tracker = t;
_udp = udp;
_fob = fob;
}
示例7: ReleaseTracker
private void ReleaseTracker(Tracker tracker)
{
if(object.ReferenceEquals(_tracker, tracker))
{
_tracker = null;
}
}
示例8: Main
static void Main(string[] args)
{
Torrent torrent = new Torrent(BenDecoder.Decode(args[0]));
Tracker trackerClient = new Tracker(torrent);
Console.WriteLine("Connecting to tracker at {0}", torrent.AnnounceUri);
object cv = new object();
trackerClient.Connected += delegate
{
Console.WriteLine("Connected to {0}", torrent.AnnounceUri);
};
trackerClient.Updated += delegate
{
if(trackerClient.LastResponse.IsSuccessful)
{
Console.WriteLine("{0} Seeders, {1} leechers", trackerClient.LastResponse.NumberOfSeeds, trackerClient.LastResponse.NumberOfLeechers);
ConnectToPeers(trackerClient.LastResponse.Peers, torrent);
}
else
{
QuitWithError(cv, trackerClient.LastResponse.FailureReason);
}
};
trackerClient.Error += delegate(object sender, Exception e)
{
QuitWithError(cv, e.Message);
};
trackerClient.Start();
lock(cv)
{
Monitor.Wait(cv);
}
}
示例9: AddTracker
public void AddTracker(Tracker tracker)
{
if (trackers == null)
trackers = new List<Tracker>();
if (!trackers.Contains(tracker))
trackers.Add(tracker);
}
示例10: InitTracker
// Initializes the tracker of the given type
// Initializing a tracker must not be done when the CameraDevice
// is initialized or started. This function will return null if the
// CameraDevice is currently initialized.
public Tracker InitTracker(Tracker.Type trackerType)
{
if (Application.isEditor)
{
return null;
}
if (trackerManagerInitTracker((int)trackerType) == 0)
{
Debug.LogError("Could not initialize the tracker.");
return null;
}
if (trackerType == Tracker.Type.IMAGE_TRACKER)
{
if (mImageTracker == null)
{
mImageTracker = new ImageTracker();
}
return mImageTracker;
}
else if (trackerType == Tracker.Type.MARKER_TRACKER)
{
if (mMarkerTracker == null)
{
mMarkerTracker = new MarkerTracker();
}
return mMarkerTracker;
}
else
{
Debug.LogError("Could not initialize tracker. Unknown tracker type.");
return null;
}
}
示例11: message_dispatching_with_locator
public void message_dispatching_with_locator()
{
var tracker = new Tracker();
var unity = new UnityContainer()
.RegisterInstance(tracker);
var dispatcher = Dispatcher.Create(d => d
.SetUnityContainer(unity)
.RegisterHandler<Message1>((m, s) => { s.GetInstance<Tracker>().Messages.Add(m.GetType()); })
.RegisterHandler<Message2>((m, s) => { s.GetInstance<Tracker>().Messages.Add(m.GetType()); })
);
dispatcher.Dispatch(new Message1());
Assert.That(tracker.Messages.Count, Is.EqualTo(1));
Assert.That(tracker.Messages[0], Is.EqualTo(typeof(Message1)));
tracker.Reset();
dispatcher.Dispatch(new Message2());
Assert.That(tracker.Messages.Count, Is.EqualTo(1));
Assert.That(tracker.Messages[0], Is.EqualTo(typeof(Message2)));
tracker.Reset();
dispatcher.Dispatch(new Message3());
Assert.That(tracker.Messages.Count, Is.EqualTo(0));
}
示例12: HttpTrackerTransportFactory
public HttpTrackerTransportFactory(Tracker tracker)
{
if ((int)(tracker.Protocol & (TrackerProtocol.HTTP | TrackerProtocol.HTTPS)) == 0)
throw new NotSupportedException();
Tracker = tracker;
}
示例13: ActionTrackingAttribute
public ActionTrackingAttribute(string trackingAccount, string trackingDomain, string actionDescription,
string actionUrl)
{
Tracker = new Tracker(trackingAccount, trackingDomain, new CookieBasedAnalyticsSession());
ActionDescription = actionDescription;
ActionUrl = actionUrl;
}
示例14: message_dispatching_not_generic
public void message_dispatching_not_generic()
{
var tracker = new Tracker();
var unity = new UnityContainer()
.RegisterInstance(tracker);
int m1 = 0;
int m2 = 0;
var dispatcher = Dispatcher.Create(d => d
.SetUnityContainer(unity)
.RegisterHandler(m => { m1++; }, typeof(Message1))
.RegisterHandler(m => { m2++; }, typeof(Message2))
);
dispatcher.Dispatch(new Message1());
Assert.That(m1, Is.EqualTo(1));
Assert.That(m2, Is.EqualTo(0));
m1 = m2 = 0;
dispatcher.Dispatch(new Message2());
Assert.That(m1, Is.EqualTo(0));
Assert.That(m2, Is.EqualTo(1));
}
示例15: OnEnable
void OnEnable()
{
tracker = (Tracker)target;
foldouts = new bool[tracker.serialized_objs.Count];
//for (int i = 0; i < tracker.serialized_objs.Count; i++)
// foldouts[i] = true;
}