本文整理汇总了C#中ITracker类的典型用法代码示例。如果您正苦于以下问题:C# ITracker类的具体用法?C# ITracker怎么用?C# ITracker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITracker类属于命名空间,在下文中一共展示了ITracker类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: PackageTracker
public PackageTracker(IWebPoster webPoster, IGeocodeDb geocodeDb)
{
//Todo: This is a bad place to load these:
var uspsUserName = WebConfigurationManager.AppSettings["UspsUserName"];
var uspsPassword = WebConfigurationManager.AppSettings["UspsPassword"];
var fedexKey = WebConfigurationManager.AppSettings["FedexKey"];
var fedexPassword = WebConfigurationManager.AppSettings["FedexPassword"];
var fedexAccountNumber = WebConfigurationManager.AppSettings["FedexAccountNumber"];
var fedexMeterNumber = WebConfigurationManager.AppSettings["FedexMeterNumber"];
var coreTrackers = new List<ITracker>();
coreTrackers.Add(new Tracking.Simulation.SimulationTracker());
coreTrackers.Add(new UpsTracker());
coreTrackers.Add(new UspsTracker(new PostUtility(), uspsUserName, uspsPassword, true));
coreTrackers.Add(new FedexTracker(new TrackService(), fedexKey, fedexPassword, fedexAccountNumber, fedexMeterNumber, false));
//coreTrackers.Add(new DhlTracker(new PostUtility(), "", "");
var multiTracker = new MultiTracker(coreTrackers);
var cacheTracker = new CacheTracker(multiTracker);
var emptyTracker = new EmptyTrackingNumberTracker(cacheTracker);
var loggingTracker = new LoggingTracker(emptyTracker);
var sanitizerTracker = new TrackingNumberStandardizerTracker(loggingTracker);
var geocodingTracker = new GeocodingTracker(sanitizerTracker, geocodeDb);
var errorHandlerTracker = new ErrorHandlerTracker(geocodingTracker);
_defaultTracker = errorHandlerTracker;
}
开发者ID:ytechie,项目名称:SimpleTracking,代码行数:28,代码来源:PackageTracker.cs
示例2: LoadProfiles_SettingWithProfiles_ShouldReturnExistentProfilesEnumerable
public void LoadProfiles_SettingWithProfiles_ShouldReturnExistentProfilesEnumerable(Db db, CurrentInteraction currentInteraction, ITracker tracker, Analytics.Tracking.Profile profile)
{
var profileItem = new DbItem("profile", ID.NewID, new TemplateID(ProfileItem.TemplateID));
db.Add(profileItem);
var profileSettingItem = new DbItem("profileSetting", ID.NewID, new TemplateID(Templates.ProfilingSettings.ID))
{
{Templates.ProfilingSettings.Fields.SiteProfiles, profileItem.ID.ToString()}
};
db.Add(profileSettingItem);
var provider = new ProfileProvider();
var fakeSiteContext = new FakeSiteContext(new StringDictionary
{
{"rootPath", "/sitecore"},
{"startItem", profileSettingItem.FullPath.Remove(0, "/sitecore".Length)}
})
{
Database = db.Database
};
using (new SiteContextSwitcher(fakeSiteContext))
{
var siteProfiles = provider.GetSiteProfiles();
siteProfiles.Count().Should().Be(1);
}
}
开发者ID:Sitecore,项目名称:Habitat,代码行数:28,代码来源:ProfileProviderTests.cs
示例3: LoadProfiles_NoSetProfiles_ShouldReturnEmptyProfilesEnumerable
public void LoadProfiles_NoSetProfiles_ShouldReturnEmptyProfilesEnumerable(Database db, [Content] Item item, ITracker tracker, IProfileProvider provider)
{
//arrange
tracker.IsActive.Returns(true);
var fakeSiteContext = new FakeSiteContext(new StringDictionary
{
{
"rootPath", "/sitecore"
},
{
"startItem", item.Paths.FullPath.Remove(0, "/sitecore".Length)
}
});
fakeSiteContext.Database = db;
using (new SiteContextSwitcher(fakeSiteContext))
{
using (new TrackerSwitcher(tracker))
{
var model = new VisitInformation(provider);
model.LoadProfiles().Count().Should().Be(0);
}
}
}
开发者ID:robearlam,项目名称:Habitat,代码行数:25,代码来源:VisitInformationTests.cs
示例4: LoadProfiles_SettingsIsEmpty_ShouldReturnExistentProfilesEnumerable
public void LoadProfiles_SettingsIsEmpty_ShouldReturnExistentProfilesEnumerable([Content] Item item, CurrentInteraction currentInteraction, ITracker tracker, Profile profile)
{
var profileSettingItem = item.Add("profileSetting", new TemplateID(Templates.ProfilingSettings.ID));
var profileItem = item.Add("profile", new TemplateID(ProfileItem.TemplateID));
var provider = new ProfileProvider();
var fakeSiteContext = new FakeSiteContext(new StringDictionary
{
{
"rootPath", "/sitecore"
},
{
"startItem", profileSettingItem.Paths.FullPath.Remove(0, "/sitecore".Length)
}
});
fakeSiteContext.Database = item.Database;
using (new SiteContextSwitcher(fakeSiteContext))
{
provider.GetSiteProfiles().Count().Should().Be(0);
}
}
开发者ID:robearlam,项目名称:Habitat,代码行数:25,代码来源:ProfileProviderTests.cs
示例5: QueueProcessor
public QueueProcessor(Logger log, IDataStore dataStore, IHubContext<IMatchmakingClient> hub, ITracker tracker, IMatchEvaluator matchBuilder, CircularBuffer<TimeSpan> timeToMatch)
{
_log = log;
_dataStore = dataStore;
_hub = hub;
_tracker = tracker;
_matchBuilder = matchBuilder;
_timeToMatch = timeToMatch;
_queueSleepMin = Int32.Parse( CloudConfigurationManager.GetSetting("QueueSleepMin") );
_queueSleepMax = Int32.Parse( CloudConfigurationManager.GetSetting("QueueSleepMax") );
_queueSleepLength = Int32.Parse( CloudConfigurationManager.GetSetting("QueueSleepLength") );
Task.Run( async () =>
{
_log.Info("Running QueueProcessor...");
while( true )
{
var sleepTime = _queueSleepMax;
try
{
await processQueue();
sleepTime = _queueSleepMax - (_dataStore.DocumentDbPopulation * (_queueSleepMax/_queueSleepLength));
}
catch(Exception ex)
{
_log.Error(ex);
}
Thread.Sleep(sleepTime < _queueSleepMin ? _queueSleepMin : sleepTime);
}
});
}
开发者ID:spencerhakim,项目名称:firetea.ms,代码行数:35,代码来源:QueueProcessor.cs
示例6: MoveViewModel
public MoveViewModel(DomaConnection source, DomaConnection target, ITracker tracker)
{
_tracker = tracker;
Source = source;
Target = target;
}
开发者ID:runerys,项目名称:DomaMove,代码行数:7,代码来源:MoveViewModel.cs
示例7: Attach
public void Attach(ITracker view)
{
view.TrackerDown += new NsNodeTrackerEventHandler(view_TrackerDown);
view.TrackerDrag += new NsNodeTrackerEventHandler(view_TrackerDrag);
view.TrackerUp += new NsNodeTrackerEventHandler(view_TrackerUp);
view.TrackerDetach += new NsNodeTrackerEventHandler(view_TrackerDetach);
}
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:7,代码来源:ContourTracker.cs
示例8: CorpseTrackerGUI
public CorpseTrackerGUI(ITracker<TrackedCorpse> tracker, HudList hudList)
{
try
{
this.tracker = tracker;
this.hudList = hudList;
hudList.ClearColumnsAndRows();
hudList.AddColumn(typeof(HudStaticText), 53, null);
hudList.AddColumn(typeof(HudStaticText), 162, null);
hudList.AddColumn(typeof(HudStaticText), 100, null);
hudList.AddColumn(typeof(HudStaticText), 0, null);
HudList.HudListRowAccessor newRow = hudList.AddRow();
((HudStaticText)newRow[0]).Text = "Time";
((HudStaticText)newRow[1]).Text = "Name";
((HudStaticText)newRow[2]).Text = "Coords";
((HudStaticText)newRow[3]).Text = "Id";
tracker.ItemAdded += new Action<TrackedCorpse>(corpseTracker_ItemAdded);
tracker.ItemChanged += new Action<TrackedCorpse>(corpseTracker_ItemChanged);
tracker.ItemRemoved += new Action<TrackedCorpse>(corpseTracker_ItemRemoved);
hudList.Click += new HudList.delClickedControl(hudList_Click);
}
catch (Exception ex) { Debug.LogException(ex); }
}
开发者ID:IbespwnAC,项目名称:MagTools,代码行数:28,代码来源:CorpseTrackerGUI.cs
示例9: SetUp
public void SetUp()
{
_mocks = new MockRepository();
_mockTracker = _mocks.CreateMock<ITracker>();
CacheTracker.ClearCache();
}
开发者ID:ytechie,项目名称:SimpleTracking,代码行数:7,代码来源:CacheTracker.cs
示例10: SqlServerDatabaseProfile
/// <summary>
/// Standard constructor
/// </summary>
/// <param name="connectionString"></param>
/// <param name="databaseName"></param>
/// <param name="databaseRepository"></param>
/// <param name="commandTimeout"></param>
/// <param name="tracker"></param>
public SqlServerDatabaseProfile(string connectionString, string databaseName, string databaseRepository, int commandTimeout, ITracker tracker)
{
_connectionString = connectionString;
_commandTimeout = commandTimeout;
_databaseName = databaseName;
_databaseRepository = databaseRepository;
_tracker = tracker;
}
开发者ID:rolfwessels,项目名称:databaseversioncontrol,代码行数:16,代码来源:SqlServerDatabaseProfile.cs
示例11: TrackPageEvent_InActiveTracker_ShouldNotTrack
public void TrackPageEvent_InActiveTracker_ShouldNotTrack(Database db, [Content] Item item, ITracker tracker, AccountTrackerService accountTrackerService)
{
using (new TrackerSwitcher(tracker))
{
accountTrackerService.TrackPageEvent(item.ID);
tracker.CurrentPage.DidNotReceive().Register(Arg.Is<PageEventItem>(x => x.ID == item.ID));
}
}
开发者ID:robearlam,项目名称:Habitat,代码行数:8,代码来源:AccountTrackerServiceTests.cs
示例12: TrackPageEventShouldTrackById
public void TrackPageEventShouldTrackById(Database db, [Content] Item item, ITracker tracker, AccountTrackerService accountTrackerService)
{
using (new TrackerSwitcher(tracker))
{
accountTrackerService.TrackPageEvent(item.ID);
tracker.CurrentPage.Received(1).Register(Arg.Is<PageEventItem>(x => x.ID == item.ID));
}
}
开发者ID:dubovitsky,项目名称:Habitat,代码行数:8,代码来源:AccountTrackerServiceTests.cs
示例13: TrackOutcome_NullOutcomeId_ThrowException
public void TrackOutcome_NullOutcomeId_ThrowException([NoAutoProperties] TrackerService trackerService, ITracker tracker)
{
tracker.IsActive.Returns(true);
using (new TrackerSwitcher(tracker))
{
trackerService.Invoking(x => x.TrackOutcome(null)).ShouldThrow<ArgumentNullException>();
}
}
开发者ID:zyq524,项目名称:Habitat,代码行数:8,代码来源:TrackerServiceTests.cs
示例14: VisitDetails_TrackerInteractionNotInitialized_ShouldReturnNull
public void VisitDetails_TrackerInteractionNotInitialized_ShouldReturnNull(IContactProfileProvider contact, IProfileProvider profile, ITracker tracker)
{
//arrange
var controller = new DemoController(contact, profile);
using (new TrackerSwitcher(tracker))
{
controller.VisitDetails().Should().Be(null);
}
}
开发者ID:robearlam,项目名称:Habitat,代码行数:9,代码来源:DemoControllerTests.cs
示例15: ContactDetails_ContactInitialized_ShouldReturnContactInformation
public void ContactDetails_ContactInitialized_ShouldReturnContactInformation(IContactProfileProvider contact, IProfileProvider profile, ITracker tracker)
{
//arrange
var controller = new DemoController(contact, profile);
using (new TrackerSwitcher(tracker))
{
controller.ContactDetails().As<ViewResult>().Model.Should().BeOfType<ContactInformation>();
}
}
开发者ID:robearlam,项目名称:Habitat,代码行数:9,代码来源:DemoControllerTests.cs
示例16: GpsTracking
public GpsTracking(ITracker tracker)
{
_tracker = tracker;
IsBestAccuracy = true;
MinInterval = 60;
MinDistance = 0;
DistanceFilter = 3;
SendInterval = 30;
}
开发者ID:Fedorm,项目名称:core-master,代码行数:9,代码来源:GPSTracking.cs
示例17: TrackPageEvent_ValidID_ShouldTrackById
public void TrackPageEvent_ValidID_ShouldTrackById(Database db, [Content] Item item, ITracker tracker, TrackerService trackerService)
{
tracker.IsActive.Returns(true);
using (new TrackerSwitcher(tracker))
{
trackerService.TrackPageEvent(item.ID);
tracker.CurrentPage.Received(1).Register(Arg.Is<PageEventItem>(x => x.ID == item.ID));
}
}
开发者ID:zyq524,项目名称:Habitat,代码行数:9,代码来源:TrackerServiceTests.cs
示例18: Contact_ContactInitialized_ShouldReturnContact
public void Contact_ContactInitialized_ShouldReturnContact([NoAutoProperties] ContactProfileProvider provider, ITracker tracker, Contact contact)
{
tracker.IsActive.Returns(true);
tracker.Contact.Returns(contact);
using (new TrackerSwitcher(tracker))
{
tracker.Contact.Should().NotBeNull();
provider.Contact.ShouldBeEquivalentTo(tracker.Contact);
}
}
开发者ID:aehyok,项目名称:Habitat,代码行数:10,代码来源:ContactProfileProviderTests.cs
示例19: IdentifyContact_ValidIdentifier_ShouldIdentifyContact
public void IdentifyContact_ValidIdentifier_ShouldIdentifyContact([NoAutoProperties] TrackerService trackerService, string contactIdentifier, ITracker tracker, [Substitute] Session session)
{
tracker.IsActive.Returns(true);
tracker.Session.Returns(session);
using (new TrackerSwitcher(tracker))
{
trackerService.IdentifyContact(contactIdentifier);
tracker.Session.Received().Identify(contactIdentifier);
}
}
开发者ID:zyq524,项目名称:Habitat,代码行数:10,代码来源:TrackerServiceTests.cs
示例20: VisitDetails_TrackerInitialized_ShouldReturnVisitInformation
public void VisitDetails_TrackerInitialized_ShouldReturnVisitInformation(IContactProfileProvider contact, IProfileProvider profile, ITracker tracker, CurrentInteraction interaction)
{
tracker.Interaction.Returns(interaction);
//arrange
var controller = new DemoController(contact, profile);
using (new TrackerSwitcher(tracker))
{
controller.VisitDetails().As<ViewResult>().Model.Should().BeOfType<VisitInformation>();
}
}
开发者ID:robearlam,项目名称:Habitat,代码行数:10,代码来源:DemoControllerTests.cs
注:本文中的ITracker类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论