本文整理汇总了C#中Page.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Page.Add方法的具体用法?C# Page.Add怎么用?C# Page.Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Page
的用法示例。
在下文中一共展示了Page.Add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAll
public Page<VideoSummary> GetAll(string userId, params Action<GetAllOptions>[] options)
{
var parameters = Options.Merge(options);
parameters["user_id"] = userId;
var xml = Signed.WithSecret(Secret).Call(MethodName(), parameters);
var videos = xml.Descendants("videos").First();
var result = new Page<VideoSummary>(
int.Parse(videos.Attribute("page").Value),
int.Parse(videos.Attribute("perpage").Value),
int.Parse(videos.Attribute("total").Value));
foreach (var video in videos.Descendants("video")) {
var item = MapFromXml<VideoSummary>(video);
result.Add(item);
}
return result;
}
示例2: Read
public IText Read(int sentecesCount)
{
if (sentecesCount <= 0)
throw new ArgumentException("Incorrect data!");
using (TextReader)
{
var listPages = new List<Page>();
int pageNumber = 1, number = 0;
Page page = new Page(pageNumber);
string input;
while ((input = TextReader.ReadLine()) != null)
{
var strings = GetParsedWords(input);
page.Add(new Sentence(strings, ++number, pageNumber));
if (number % sentecesCount != 0)
continue;
listPages.Add(page);
page = new Page(++pageNumber);
}
TextReader.Close();
return new Text(listPages);
}
}
示例3: InstallPreferences
protected void InstallPreferences()
{
if (!pref_installed) {
preference_service.InstallWidgetAdapters += OnPreferencesServiceInstallWidgetAdapters;
pref_page = preference_service.Add(new Page("clutterflow",
AddinManager.CurrentLocalizer.GetString ("ClutterFlow"), 10));
general = pref_page.Add (new Section ("general",
AddinManager.CurrentLocalizer.GetString ("General"), 1));
ClutterFlowSchemas.AddToSection (general, ClutterFlowSchemas.InstantPlayback, null);
ClutterFlowSchemas.AddToSection (general, ClutterFlowSchemas.DisplayLabel, UpdateLabelVisibility);
ClutterFlowSchemas.AddToSection (general, ClutterFlowSchemas.DisplayTitle, UpdateTitleVisibility);
ClutterFlowSchemas.AddToSection (general, ClutterFlowSchemas.VisibleCovers, UpdateVisibleCovers);
ClutterFlowSchemas.AddToSection (general, ClutterFlowSchemas.DragSensitivity, UpdateDragSensitivity);
dimensions = pref_page.Add (new Section ("dimensions",
AddinManager.CurrentLocalizer.GetString ("Dimensions"), 2));
dimensions.Add (new VoidPreference ("dimensions-desc"));
ClutterFlowSchemas.AddToSection (dimensions, ClutterFlowSchemas.MinCoverSize, UpdateMinCoverSize);
ClutterFlowSchemas.AddToSection (dimensions, ClutterFlowSchemas.MaxCoverSize, UpdateMaxCoverSize);
ClutterFlowSchemas.AddToSection (dimensions, ClutterFlowSchemas.TextureSize, UpdateTextureSize);
pref_installed = true;
}
}
示例4: BuildPreferences
private void BuildPreferences()
{
page = new Page ();
Section main_section = new Section ();
main_section.Order = -1;
space_for_data = CreateSchema<long> ("space_for_data", 0, "How much space, in bytes, to reserve for data on the device.", "");
main_section.Add (space_for_data);
page.Add (main_section);
foreach (Section section in sync.PreferenceSections) {
page.Add (section);
}
}