本文整理汇总了C#中RequestData.Add方法的典型用法代码示例。如果您正苦于以下问题:C# RequestData.Add方法的具体用法?C# RequestData.Add怎么用?C# RequestData.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RequestData
的用法示例。
在下文中一共展示了RequestData.Add方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Show_Visitor_Insight_as_summary_of_tab_data_by_default
public void Show_Visitor_Insight_as_summary_of_tab_data_by_default()
{
var requestData = new RequestData();
requestData.Add(DataKey.IsNewVisitor, true);
requestData.Add(DataKey.EngagementValue, 0);
requestData.Add(DataKey.TrafficType, "Returning");
_requestDataProvider.Setup(x => x.GetData()).Returns(requestData);
dynamic data = _sut.GetData(null);
string column1 = data.Rows[0].Columns[0].Data;
string column2 = data.Rows[0].Columns[1].Data;
Assert.Contains("Visitor", column1);
Assert.Contains("Insight", column2);
}
示例2: Returns_null_if_Sitecore_Item_not_in_request_data
public void Returns_null_if_Sitecore_Item_not_in_request_data()
{
var requestData = new RequestData();
requestData.Add(DataKey.Campaign, "Foo");
_requestDataProvider.Setup(x => x.GetData()).Returns(requestData);
var data = _sut.GetData(null);
Assert.Null(data);
}
示例3: Return_null_if_analysis_overview_information_is_missing
public void Return_null_if_analysis_overview_information_is_missing()
{
var requestData = new RequestData();
var fieldList = new FieldList();
fieldList.AddField("Foo", "Bar");
requestData.Add(DataKey.Item, fieldList);
_requestDataProvider.Setup(x => x.GetData()).Returns(requestData);
var data = _sut.GetData(null);
Assert.Null(data);
}
示例4: Show_Item_Path_and_Template_as_first_row_of_tab_data
public void Show_Item_Path_and_Template_as_first_row_of_tab_data()
{
var requestData = new RequestData();
var fieldList = new FieldList();
fieldList.AddField("Full Path", "/sitecore/content/foo");
fieldList.AddField("Template Name", "Bar");
requestData.Add(DataKey.Item, fieldList);
_requestDataProvider.Setup(x => x.GetData()).Returns(requestData);
dynamic data = _sut.GetData(null);
string summaryRow = data.Rows[0].Columns[1].Data;
Assert.Contains("/sitecore/content/foo", summaryRow);
Assert.Contains("Bar", summaryRow);
}
示例5: GetAnalyticsData
private RequestData GetAnalyticsData()
{
var tracker = _trackerBuilder.Tracker;
if (tracker.Interaction != null)
{
var data = new RequestData();
data.Add(DataKey.Profiles, GetProfiles());
data.Add(DataKey.LastPages, GetLastPages(5));
data.Add(DataKey.Goals, GetGoals(5));
data.Add(DataKey.Campaign, GetCampaign());
data.Add(DataKey.TrafficType, GetTrafficType());
data.Add(DataKey.EngagementValue, GetEngagementValue());
data.Add(DataKey.IsNewVisitor, GetVisitType());
return data;
}
return null;
}
示例6: Not_include_page_views_if_no_page_visits_recorded
public void Not_include_page_views_if_no_page_visits_recorded()
{
var requestData = new RequestData();
requestData.Add(DataKey.IsNewVisitor, true);
requestData.Add(DataKey.EngagementValue, 0);
requestData.Add(DataKey.TrafficType, "Returning");
_requestDataProvider.Setup(x => x.GetData()).Returns(requestData);
var data = (TabSection) _sut.GetData(null);
var sectionFound = data.Rows.Any(x => (string)x.Columns.First().Data == "Page Views");
Assert.False(sectionFound);
}
示例7: Show_matched_patters_as_first_row_of_tab_data
public void Show_matched_patters_as_first_row_of_tab_data()
{
var requestData = new RequestData();
requestData.Add(DataKey.IsNewVisitor, true);
requestData.Add(DataKey.EngagementValue, 0);
requestData.Add(DataKey.TrafficType, "Returning");
requestData.Add(DataKey.Profiles, new[]
{
new Profile { Name = "Foo", PatternCard = "Pattern Card", Values = "values" },
new Profile { Name = "Bar", PatternCard = null, Values = "values" },
new Profile { Name = "Non", PatternCard = string.Empty, Values = "values" },
new Profile { Name = "Plus", PatternCard = "Another pattern card", Values = "values" }
});
_requestDataProvider.Setup(x => x.GetData()).Returns(requestData);
dynamic data = _sut.GetData(null);
string summaryRow = data.Rows[0].Columns[1].Data;
Assert.Equal("Pattern Card, Another pattern card", summaryRow);
}
示例8: Include_profiles_section_if_profiles_recorded
public void Include_profiles_section_if_profiles_recorded()
{
var requestData = new RequestData();
requestData.Add(DataKey.IsNewVisitor, true);
requestData.Add(DataKey.EngagementValue, 0);
requestData.Add(DataKey.TrafficType, "Returning");
requestData.Add(DataKey.Profiles, new[]
{
new Profile { Name = "Foo", PatternCard = "pattern card 1", Values = "values here" },
new Profile { Name = "Bar", PatternCard = string.Empty, Values = "values here" }
});
_requestDataProvider.Setup(x => x.GetData()).Returns(requestData);
var data = (TabSection)_sut.GetData(null);
var sectionFound = data.Rows.Any(x => x.Columns.First().Data.ToString().Contains("Profiles"));
Assert.True(sectionFound);
}
示例9: Include_goals_section_if_goals_recorded
public void Include_goals_section_if_goals_recorded()
{
var requestData = new RequestData();
requestData.Add(DataKey.IsNewVisitor, true);
requestData.Add(DataKey.EngagementValue, 0);
requestData.Add(DataKey.TrafficType, "Returning");
requestData.Add(DataKey.Goals, new[]
{
new Goal { Name = "Foo", Timestamp = DateTime.Now.AddMinutes(-10)}
});
_requestDataProvider.Setup(x => x.GetData()).Returns(requestData);
var data = (TabSection)_sut.GetData(null);
var sectionFound = data.Rows.Any(x => (string)x.Columns.First().Data == "Goals");
Assert.True(sectionFound);
}
示例10: Include_page_views_if_page_visits_recorded
public void Include_page_views_if_page_visits_recorded()
{
var requestData = new RequestData();
requestData.Add(DataKey.IsNewVisitor, true);
requestData.Add(DataKey.EngagementValue, 0);
requestData.Add(DataKey.TrafficType, "Returning");
requestData.Add(DataKey.LastPages, new[]
{
new PageHolder(1,Guid.NewGuid(), DateTime.Now, "http://microsoft.com/")
} );
_requestDataProvider.Setup(x => x.GetData()).Returns(requestData);
var data = (TabSection)_sut.GetData(null);
var sectionFound = data.Rows.Any(x => (string)x.Columns.First().Data == "Page Views");
Assert.True(sectionFound);
}
示例11: button5_Click
private void button5_Click(object sender, EventArgs e)
{
Growl.Connector.Application app = new Growl.Connector.Application("SurfWriter");
//app.Icon = "http://atomicbride.com/Apple.gif";
//app.Icon = "http://www.thetroyers.com/images/Apple_Logo.jpg";
app.Icon = @"c:\apple.png";
app.CustomTextAttributes.Add("Creator", "Apple Software");
app.CustomTextAttributes.Add("Application-ID", "08d6c05a21512a79a1dfeb9d2a8f262f");
NotificationType nt1 = new NotificationType("Download Complete", "Download completed");
nt1.Icon = new BinaryData(new byte[] { 65, 66, 67, 68 });
nt1.CustomTextAttributes.Add("Language", "English");
nt1.CustomTextAttributes.Add("Timezone", "PST");
Notification notification = new Notification(app.Name, nt1.Name, "123456", "\u2605 Your document was published", @"File 'c:\file.txt' was successfully published at 8:57pm.");
notification.Sticky = false;
notification.Priority = Priority.Emergency;
//notification.Icon = "http://atomicbride.com/Apple.gif";
app.Icon = @"c:\apple.png";
notification.CustomTextAttributes.Add("Filename", @"c:\file.txt");
notification.CustomTextAttributes.Add("Timestamp", "8:57pm");
notification.CustomBinaryAttributes.Add("File", new BinaryData(new byte[] { 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78 }));
string data = "this is my context\nthis is after a line break";
string type = typeof(string).ToString();
CallbackContext context = new CallbackContext(data, type);
Growl.Connector.RequestData rd = new RequestData();
rd.Add("Return-To-Me", "some text value");
rd.Add("Return-To-Me2", "another value");
growl.Notify(notification, context, rd);
this.textBox1.Text = "NOTIFY sent";
}
示例12: button2_Click
private void button2_Click(object sender, EventArgs e)
{
Growl.Connector.Application app = new Growl.Connector.Application("SurfWriter");
//app.Icon = "http://atomicbride.com/Apple.gif";
//app.Icon = "http://www.thetroyers.com/images/Apple_Logo.jpg";
app.Icon = @"c:\apple.png";
app.CustomTextAttributes.Add("Creator", "Apple Software");
app.CustomTextAttributes.Add("Application-ID", "08d6c05a21512a79a1dfeb9d2a8f262f");
NotificationType nt1 = new NotificationType("Download Complete", "Download completed");
//nt1.Icon = new BinaryData(new byte[] { 65, 66, 67, 68 });
nt1.CustomTextAttributes.Add("Language", "English");
nt1.CustomTextAttributes.Add("Timezone", "PST");
Notification notification = new Notification(app.Name, nt1.Name, "123456", "\u2065 Your docu;ment\nwas publi&shed", "File 'c:\\file.txt' was successfully published at 8:57pm.\n\nClick this notification to open the file.\n\nThis is a test of the expanding displays.");
notification.Sticky = false;
notification.Priority = Priority.Emergency;
notification.Icon = "http://atomicbride.com/Apple.gif";
//notification.Icon = "http://haxe.org/favicon.ico";
notification.CustomTextAttributes.Add("Filename", @"c:\file.txt");
notification.CustomTextAttributes.Add("Timestamp", "8:57pm");
notification.CustomBinaryAttributes.Add("File", new BinaryData(new byte[] { 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78 }));
notification.CoalescingID = "secretfaketest";
//string url = "http://localhost/growl-callback.aspx";
//string url = "mailto:[email protected]";
string url = "itpc:http://www.npr.org/rss/podcast.php?id=35";
CallbackContext callback = new CallbackContext(url);
Growl.Connector.RequestData rd = new RequestData();
rd.Add("Return-To-Me", "some text value");
rd.Add("Return-To-Me2", "this is some longer value, including a \n few \n line \n breaks");
rd.Add("Can I have spaces?", "dont know");
growl.Notify(notification, callback, rd);
this.textBox1.Text = "NOTIFY sent";
}
示例13: GetData
public RequestData GetData()
{
var data = new RequestData();
data.Add(DataKey.Item, "foo-bar");
return data;
}
示例14: GetSitecoreData
private RequestData GetSitecoreData()
{
var data = new RequestData();
data.Add(DataKey.Request, GetRequest());
data.Add(DataKey.Diagnostics, GetDiagnostics());
data.Add(DataKey.PageMode, GetPageMode());
data.Add(DataKey.Culture, GetCulture());
data.Add(DataKey.Language, GetLanguage());
data.Add(DataKey.Domain, GetDomain());
data.Add(DataKey.Device, GetDevice());
data.Add(DataKey.User, GetUser());
data.Add(DataKey.Database, GetDatabase());
data.Add(DataKey.Site, GetSite());
data.Add(DataKey.ItemVisualization, GetItemVisualization());
data.Add(DataKey.ItemTemplate, GetItemTemplate());
data.Add(DataKey.Item, GetItem());
data.Add(DataKey.VersionInfo, GetVersionInfo());
data.Add(DataKey.License, GetLicense());
data.Add(DataKey.Services, _serviceClients.ToArray());
data.Add(DataKey.Controllers, _controllers.ToArray());
data.Add(DataKey.UserList, _users.ToArray());
return data;
}