在最近的一个项目中,涉及到一个自定义翻页控制的控件,下面就这一个控件做详细的说明,这个自定义控件的主要作用是对数据源进行翻页控制,比如说:“上一页、下一页、首页、末页”等相关操作,由于在一个项目中有多个界面要用到这一部分,所以我们将其封装成一个自定义控件,从而使软件整体结构更加清楚明了,首先我们来将控件的界面展示出来。

整个控件可以分成三个部分,最左边是一个Combobox控件,中间是常见的上一页、下一页、向前、向后操作,最右边是显示当前记录。下面我们重点来介绍中间部分的封装,在这里我们将每一个按钮封装成一个ImageButton控件,这里我们贴出相应的前台、后台代码,从而从整体上进行分析。

  1. <Button x:Class="CustomControlLibrary.ImageButton"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. mc:Ignorable="d" x:Name="loc"
  7. d:DesignHeight="44" d:DesignWidth="75">
  8. <Button.Resources>
  9. <ResourceDictionary Source="Themes/Generic.xaml" />
  10. </Button.Resources>
  11. <Image Name="innerImage" Source="{Binding ImageSource,ElementName=loc}" Stretch="None" />
  12. </Button>

  这里前台的代码比较简单,我们将Button的样式写在了一个资源字典中,同时在Button上面放置一个Image控件,从而组成我们的ImageButton控件,在后台的代码中我们主要定义了两个依赖项属性,ImageSource和GrayImageSource,ImageSource是当按钮正常使用的时候,其显示的背景,GrayImageSource是当按钮的IsEnable=false的时候,其显示的背景,这里先贴出其后台代码。

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Data;
  8. using System.Windows.Documents;
  9. using System.Windows.Input;
  10. using System.Windows.Media;
  11. using System.Windows.Media.Imaging;
  12. using System.Windows.Navigation;
  13. using System.Windows.Shapes;
  14.  
  15. namespace CustomControlLibrary {
  16. /// <summary>
  17. /// ImageButton.xaml 的交互逻辑
  18. /// </summary>
  19. public partial class ImageButton : Button
  20. {
  21. public ImageButton()
  22. {
  23. InitializeComponent();
  24. this.Style = this.FindResource("ImageButtonStyle") as Style;
  25. this.IsEnabledChanged += new DependencyPropertyChangedEventHandler(ImageButton_IsEnabledChanged);
  26. }
  27. void ImageButton_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
  28. {
  29. if (this.IsEnabled && ImageSource != null)
  30. {
  31. innerImage.Source = ImageSource;
  32. } else if (!this.IsEnabled && GrayImageSource != null)
  33. {
  34. innerImage.Source = GrayImageSource;
  35. }
  36. }
  37.  
  38. public ImageSource ImageSource
  39. {
  40. get { return (ImageSource)GetValue(ImageSourceProperty); }
  41. set { SetValue(ImageSourceProperty, value); }
  42. }
  43. // Using a DependencyProperty as the backing store for ImageSource. This enables animation, styling, binding, etc...
  44. public static readonly DependencyProperty ImageSourceProperty =
  45. DependencyProperty.Register("ImageSource", typeof(ImageSource), typeof(ImageButton), new UIPropertyMetadata(null));
  46.  
  47. public ImageSource GrayImageSource
  48. {
  49. get { return (ImageSource)GetValue(GrayImageSourceProperty); }
  50. set { SetValue(GrayImageSourceProperty, value); }
  51. }
  52.  
  53. // Using a DependencyProperty as the backing store for GrayImageSource. This enables animation, styling, binding, etc...
  54. public static readonly DependencyProperty GrayImageSourceProperty =
  55. DependencyProperty.Register("GrayImageSource", typeof(ImageSource), typeof(ImageButton), new UIPropertyMetadata(null));
  56.  
  57. public override void OnApplyTemplate()
  58. {
  59. base.OnApplyTemplate();
  60. if (this.IsEnabled && ImageSource != null)
  61. {
  62. innerImage.Source = ImageSource;
  63. } else if (!this.IsEnabled && GrayImageSource != null)
  64. {
  65. innerImage.Source = GrayImageSource;
  66. }
  67. }
  68. }
  69. } 

  这里首先分析一下WPF的依赖项属性和普通的.net属性有什么不同,依赖属性是WPF平台中一个新增的概念,出现的目的是用来实现WPF中的样式、自动绑定及实现动画等特性。依赖属性的出现是WPF这种特殊的呈现原理派生出来的,与.NET普通属性不同的是,依赖属性的值是依靠多个提供程序来判断的,并且其具有内建的传递变更通知的能力。

依赖属性的定义与普通的.NET属性的定义有区别,普通的.NET属性定义只需要定义其set和get区块的赋值与设置即可,而依赖属性需要向.NET的属性系统进行注册。这里我们定义了ImageSource和GrayImageSource两个依赖项属性。另外这里还重写了基类的OnApplyTemplate方法,这个方法是FrameworkElement中定义的方法,在派生类中重写后,每当应用程序代码或内部进程调用 ApplyTemplate,都将调用此方法。FrameworkElement 派生类可以使用 OnApplyTemplate 类处理程序获知显式调用或由布局系统调用此方法的情况。OnApplyTemplate 在完全生成模板并将其附加到逻辑树之后调用。

然后就是具体的DataPager控件的实现了,这里也分别贴出相应的前台和后台的代码。

  1. <UserControl x:Class="CustomControlLibrary.DataPager" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:loc="clr-namespace:CustomControlLibrary"
  6. x:Name="dp" Margin="3"
  7. mc:Ignorable="d"
  8. d:DesignHeight="46" d:DesignWidth="590" Loaded="DataPager_Loaded">
  9. <Grid>
  10. <!--<Grid.Resources>
  11. <Style TargetType="{x:Type Image}">
  12. <Setter Property="Margin" Value="3,0,3,0" />
  13. <Setter Property="Cursor" Value="Hand" />
  14. </Style>
  15. </Grid.Resources>-->
  16. <Grid.ColumnDefinitions>
  17. <ColumnDefinition Width="Auto" />
  18. <ColumnDefinition />
  19. <ColumnDefinition Width="Auto" />
  20. </Grid.ColumnDefinitions>
  21. <ComboBox Grid.Column="0" VerticalAlignment="Center" Name="cboPageSize"
  22. MinWidth="40" Margin="5,0,0,0" ItemsSource="{Binding Path=PageSizeItems,ElementName=dp}"
  23. SelectedItem="{Binding PageSize,Mode=TwoWay,ElementName=dp}" SelectionChanged="cbpPageSize_SelectionChanged" Visibility="Visible"/>
  24. <StackPanel Grid.Column="1" VerticalAlignment="Center" Orientation="Horizontal" Margin="5,0,0,0">
  25. <loc:ImageButton Click="btnFirst_Click" x:Name="btnFirst"
  26. ImageSource="/CustomControlLibrary;component/Images/pagination_first.gif"
  27. GrayImageSource="/CustomControlLibrary;component/Images/pagination_first_gray.gif" />
  28. <loc:ImageButton Click="btnPrev_Click" x:Name="btnPrev"
  29. ImageSource="/CustomControlLibrary;component/Images/pagination_prev.gif"
  30. GrayImageSource="/CustomControlLibrary;component/Images/pagination_prev_gray.gif" />
  31. <TextBlock Text="第页 " VerticalAlignment="Center"/>
  32. <TextBox Width="30" Text="{Binding Path=PageIndex,ElementName=dp}" Name="tbPageIndex" PreviewKeyDown="tbPageIndex_PreviewKeyDown" LostFocus="tbPageIndex_LostFocus" />
  33. <TextBlock Text=" 共 " VerticalAlignment="Center"/>
  34. <TextBlock Text="{Binding Path=PageCount, ElementName=dp}" VerticalAlignment="Center"/>
  35. <loc:ImageButton Click="btnNext_Click" x:Name="btnNext"
  36. ImageSource="/CustomControlLibrary;component/Images/pagination_next.gif"
  37. GrayImageSource="/CustomControlLibrary;component/Images/pagination_next_gray.gif" />
  38. <loc:ImageButton Click="btnLast_Click" x:Name="btnLast"
  39. ImageSource="/CustomControlLibrary;component/Images/pagination_last.gif"
  40. GrayImageSource="/CustomControlLibrary;component/Images/pagination_last_gray.gif" />
  41. <!--<loc:ImageButton Click="btnRefresh_Click"
  42. ImageSource="/CustomControlLibrary;component/Images/pagination_load.png" Visibility="Hidden"/>-->
  43. </StackPanel>
  44. <TextBlock Grid.Column="2" VerticalAlignment="Center" Margin="5,0,5,0" >显示记录
  45. <TextBlock Text="{Binding Path=Start,ElementName=dp}" /><TextBlock Text="{Binding Path=End,ElementName=dp}"/><TextBlock Text="{Binding Path=Total,ElementName=dp}"/> 条记录
  46. </TextBlock>
  47. </Grid>
  48. </UserControl>

  这里重点介绍后台的逻辑代码。

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Data;
  8. using System.Windows.Documents;
  9. using System.Windows.Input;
  10. using System.Windows.Media;
  11. using System.Windows.Media.Imaging;
  12. using System.Windows.Navigation;
  13. using System.Windows.Shapes;
  14. using System.ComponentModel;
  15.  
  16. namespace CustomControlLibrary {
  17. /// <summary>
  18. /// DataPager.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class DataPager : UserControl, INotifyPropertyChanged
  21. {
  22. public DataPager()
  23. {
  24. InitializeComponent();
  25. }
  26.  
  27. #region 依赖属性和事件
  28. public string PageSizeList
  29. {
  30. get { return (string)GetValue(PageSizeListProperty); }
  31. set { SetValue(PageSizeListProperty, value); }
  32. }
  33.  
  34. // Using a DependencyProperty as the backing store for PageSizeList. This enables animation, styling, binding, etc...
  35. public static readonly DependencyProperty PageSizeListProperty =
  36. DependencyProperty.Register("PageSizeList", typeof(string), typeof(DataPager), new UIPropertyMetadata("5,10,20", (s, e) =>
  37. {
  38. DataPager dp = s as DataPager;
  39. if (dp.PageSizeItems == null)
  40. dp.PageSizeItems = new List<int>();
  41. else
  42. dp.PageSizeItems.Clear();
  43. dp.RaisePropertyChanged("PageSizeItems");
  44. }));
  45.  
  46. public int PageSize
  47. {
  48. get { return (int)GetValue(PageSizeProperty); }
  49. set { SetValue(PageSizeProperty, value); }
  50. }
  51.  
  52. // Using a DependencyProperty as the backing store for PageSize. This enables animation, styling, binding, etc...
  53. public static readonly DependencyProperty PageSizeProperty =
  54. DependencyProperty.Register("PageSize", typeof(int), typeof(DataPager), new UIPropertyMetadata(16));
  55.  
  56. public int Total
  57. {
  58. get { return (int)GetValue(TotalProperty); }
  59. set { SetValue(TotalProperty, value); }
  60. }
  61.  
  62. // Using a DependencyProperty as the backing store for Total. This enables animation, styling, binding, etc...
  63. public static readonly DependencyProperty TotalProperty =
  64. DependencyProperty.Register("Total", typeof(int), typeof(DataPager), new UIPropertyMetadata(0));
  65.  
  66. public int PageIndex
  67. {
  68. get { return (int)GetValue(PageIndexProperty); }
  69. set { SetValue(PageIndexProperty, value); }
  70. }
  71.  
  72. // Using a DependencyProperty as the backing store for PageIndex. This enables animation, styling, binding, etc...
  73. public static readonly DependencyProperty PageIndexProperty =
  74. DependencyProperty.Register("PageIndex", typeof(int), typeof(DataPager), new UIPropertyMetadata(1));
  75.  
  76. public IEnumerable<object> ItemsSource
  77. {
  78. get { return (IEnumerable<object>)GetValue(ItemsSourceProperty); }
  79. set { SetValue(ItemsSourceProperty, value); }
  80. }
  81.  
  82. /// <summary>
  83. /// ItemsSource数据源
  84. /// </summary>
  85. public static readonly DependencyProperty ItemsSourceProperty =
  86. DependencyProperty.Register("ItemsSource", typeof(IEnumerable<object>), typeof(DataPager), new UIPropertyMetadata(null));
  87.  
  88. public static readonly RoutedEvent PageChangedEvent = EventManager.RegisterRoutedEvent("PageChanged", RoutingStrategy.Bubble, typeof(PageChangedEventHandler), typeof(DataPager));
  89. /// <summary>
  90. /// 分页更改事件
  91. /// </summary>
  92. public event PageChangedEventHandler PageChanged
  93. {
  94. add
  95. {
  96. AddHandler(PageChangedEvent, value);
  97. }
  98. remove
  99. {
  100. RemoveHandler(PageChangedEvent, value);
  101. }
  102. }
  103. #endregion
  104.  
  105. #region 通知属性
  106. private List<int> _pageSizeItems;
  107. /// <summary>
  108. /// 显示每页记录数集合
  109. /// </summary>
  110. public List<int> PageSizeItems
  111. {
  112. get
  113. {
  114. if (_pageSizeItems == null)
  115. {
  116. _pageSizeItems = new List<int>();
  117. }
  118. if (PageSizeList != null)
  119. {
  120. List<string> strs = PageSizeList.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList();
  121. _pageSizeItems.Clear();
  122. strs.ForEach(c => {
  123. _pageSizeItems.Add(Convert.ToInt32(c));
  124. });
  125. }
  126. return _pageSizeItems;
  127. }
  128. set
  129. {
  130. if (_pageSizeItems != value)
  131. {
  132. _pageSizeItems = value;
  133. RaisePropertyChanged("PageSizeItems");
  134. }
  135. }
  136. }
  137.  
  138. private int _pageCount;
  139. /// <summary>
  140. /// 总页数
  141. /// </summary>
  142. public int PageCount
  143. {
  144. get { return _pageCount; }
  145. set
  146. {
  147. if (_pageCount != value)
  148. {
  149. _pageCount = value;
  150. RaisePropertyChanged("PageCount");
  151. }
  152. }
  153. }
  154.  
  155. private int _start;
  156. /// <summary>
  157. /// 开始记录数
  158. /// </summary>
  159. public int Start
  160. {
  161. get { return _start; }
  162. set
  163. {
  164. if (_start != value)
  165. {
  166. _start = value;
  167. RaisePropertyChanged("Start");
  168. }
  169. }
  170. }
  171.  
  172. private int _end;
  173. /// <summary>
  174. /// 结束记录数
  175. /// </summary>
  176. public int End
  177. {
  178. get { return _end; }
  179. set
  180. {
  181. if (_end != value)
  182. {
  183. _end = value;
  184. RaisePropertyChanged("End");
  185. }
  186. }
  187. }
  188.  
  189. public event PropertyChangedEventHandler PropertyChanged;
  190. public void RaisePropertyChanged(string propertyName)
  191. {
  192. if (PropertyChanged != null)
  193. {
  194. PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  195. }
  196. }
  197. #endregion
  198.  
  199. #region 字段、属性、委托
  200. public delegate void PageChangedEventHandler(object sender, PageChangedEventArgs args);
  201. private PageChangedEventArgs pageChangedEventArgs;
  202. #endregion
  203.  
  204. #region 引发分页更改事件
  205. /// <summary>
  206. /// 引发分页更改事件
  207. /// </summary>
  208. private void RaisePageChanged()
  209. {
  210. if (pageChangedEventArgs == null)
  211. {
  212. pageChangedEventArgs = new PageChangedEventArgs(PageChangedEvent, PageSize, PageIndex);
  213. }
  214. else
  215. {
  216. pageChangedEventArgs.PageSize = this.PageSize;
  217. pageChangedEventArgs.PageIndex = this.PageIndex;
  218. }
  219. RaiseEvent(pageChangedEventArgs);
  220. //calc start、end
  221. if (ItemsSource != null)
  222. {
  223. int curCount = ItemsSource.Count();
  224. Start = (PageIndex - 1) * PageSize + 1;
  225. End = Start + curCount - 1;
  226.  
  227. if (Total % PageSize != 0)
  228. {
  229. PageCount = Total / PageSize + 1;
  230. }
  231. else
  232. {
  233. PageCount = Total / PageSize;
  234. }
  235. }
  236. else
  237. {
  238. Start = End = PageCount = Total = 0;
  239. }
  240. //调整图片的显示
  241. btnFirst.IsEnabled = btnPrev.IsEnabled = (PageIndex != 1);
  242. btnNext.IsEnabled = btnLast.IsEnabled = (PageIndex != PageCount);
  243. }
  244. #endregion
  245.  
  246. #region 分页操作事件
  247. void DataPager_Loaded(object sender, RoutedEventArgs e)
  248. {
  249. RaisePageChanged();
  250. }
  251.  
  252. private void cbpPageSize_SelectionChanged(object sender, SelectionChangedEventArgs e)
  253. {
  254. if (this.IsLoaded)
  255. {
  256. PageSize = (int)cboPageSize.SelectedItem;
  257. RaisePageChanged();
  258. }
  259. }
  260.  
  261. private void btnFirst_Click(object sender, RoutedEventArgs e)
  262. {
  263. PageIndex = 1;
  264. RaisePageChanged();
  265. }
  266.  
  267. private void btnPrev_Click(object sender, RoutedEventArgs e)
  268. {
  269. if (PageIndex > 1)
  270. {
  271. --PageIndex;
  272. }
  273. RaisePageChanged();
  274. }
  275.  
  276. private void btnNext_Click(object sender, RoutedEventArgs e)
  277. {
  278. if (Total % PageSize != 0)
  279. {
  280. PageCount = Total / PageSize + 1;
  281. }
  282. else
  283. {
  284. PageCount = Total / PageSize;
  285. }
  286.  
  287. if (PageIndex < PageCount)
  288. {
  289. ++PageIndex;
  290. }
  291. RaisePageChanged();
  292. }
  293.  
  294. private void btnLast_Click(object sender, RoutedEventArgs e)
  295. {
  296. if (Total % PageSize != 0)
  297. {
  298. PageCount = Total / PageSize + 1;
  299. }
  300. else
  301. {
  302. PageCount = Total / PageSize;
  303. }
  304. PageIndex = PageCount;
  305. RaisePageChanged();
  306. }
  307.  
  308. private void btnRefresh_Click(object sender, RoutedEventArgs e)
  309. {
  310. RaisePageChanged();
  311. }
  312.  
  313. private void tbPageIndex_PreviewKeyDown(object sender, KeyEventArgs e)
  314. {
  315. if (e.Key == Key.Enter)
  316. {
  317. tbPageIndex_LostFocus(sender, null);
  318. }
  319. }
  320.  
  321. private void tbPageIndex_LostFocus(object sender, RoutedEventArgs e)
  322. {
  323. int pIndex = 0;
  324. try
  325. {
  326. pIndex = Convert.ToInt32(tbPageIndex.Text);
  327. } catch { pIndex = 1; }
  328.  
  329. if (pIndex < 1) PageIndex = 1;
  330. else if (pIndex > PageCount) PageIndex = PageCount;
  331. else PageIndex = pIndex;
  332.  
  333. RaisePageChanged();
  334. }
  335. #endregion
  336.  
  337. }
  338.  
  339. /// <summary>
  340. /// 分页更改参数
  341. /// </summary>
  342. public class PageChangedEventArgs : RoutedEventArgs
  343. {
  344. public int PageSize { get; set; }
  345. public int PageIndex { get; set; }
  346.  
  347. public PageChangedEventArgs(RoutedEvent routeEvent, int pageSize, int pageIndex)
  348. : base(routeEvent)
  349. {
  350. this.PageSize = pageSize;
  351. this.PageIndex = pageIndex;
  352. }
  353. }
  354. }

  这里定义了一些该控件要使用的一些属性,PageSize属性用于定义每一页中的项的数量,Total属性定义总共有多少项,PageIndex定义当前的页码,ItemsSource用于定义数据源的集合,类型是IEnumerable<object>类型,这个里面定义的最重要的函数是RaisePageChanged,该函数将引发分页更改事件,在这个函数中我们将当前定义的路由事件PageChangedEvent,以及每一页项目的大小,以及当前页码传递到PageChangedEventArgs的一个对象中,然后调用RaiseEvent来引发特定的路由事件,这里需要注意的是必须将当前定义的路由事件传递到基类RoutedEventArgs中,否则不能触发该路由事件。

自定义控件DataPager的更多相关文章

  1. android自定义控件一站式入门

    自定义控件 Android系统提供了一系列UI相关的类来帮助我们构造app的界面,以及完成交互的处理. 一般的,所有可以在窗口中被展示的UI对象类型,最终都是继承自View的类,这包括展示最终内容的非 ...

  2. ASP.NET MVC学习之母版页和自定义控件的使用

    一.母板页_Layout.cshtml类似于传统WebForm中的.master文件,起到页面整体框架重用的目地1.母板页代码预览 <!DOCTYPE html> <html> ...

  3. C# 自定义控件VS用户控件

    1 自定义控件与用户控件区别 WinForm中, 用户控件(User Control):继承自 UserControl,主要用于开发 Container 控件,Container控件可以添加其他Con ...

  4. 自定义控件之 圆形 / 圆角 ImageView

    一.问题在哪里? 问题来源于app开发中一个很常见的场景——用户头像要展示成圆的:       二.怎么搞? 机智的我,第一想法就是,切一张中间圆形透明.四周与底色相同.尺寸与头像相同的蒙板图片,盖在 ...

  5. 如何开发FineReport的自定义控件?

    FineReport作为插件化开发的报表软件,有些特殊需求的功能需要自己开发,开发的插件包帆软官方有提提供,可以去帆软论坛上找,本文将主要介绍如何开发一个自定义控件,这里讲讲方法论. 第一步:实例化一 ...

  6. WPF自定义控件第二 - 转盘按钮控件

    继之前那个控件,又做了一个原理差不多的控件.这个控件主要模仿百度贴吧WP版帖子浏览界面左下角那个弹出的按钮盘.希望对大家有帮助. 这个控件和之前的也差不多,为了不让大家白看,文章最后发干货. 由于这个 ...

  7. 【Win 10应用开发】AdaptiveTrigger在自定义控件中是可以触发的

    前些天,看到有网友给我留言,说AdaptiveTrigger在自定义控件(模板化控件)中不能触发.因为当时我正在写其他的代码,就没有去做实验来验证,于是我就给这位网友提了使用GotoVisualSta ...

  8. WPF自定义控件与样式(3)-TextBox & RichTextBox & PasswordBox样式、水印、Label标签、功能扩展

    一.前言.预览 申明:WPF自定义控件与样式是一个系列文章,前后是有些关联的,但大多是按照由简到繁的顺序逐步发布的等,若有不明白的地方可以参考本系列前面的文章,文末附有部分文章链接. 本文主要是对文本 ...

  9. Android自定义控件之自定义ViewGroup实现标签云

    前言: 前面几篇讲了自定义控件绘制原理Android自定义控件之基本原理(一),自定义属性Android自定义控件之自定义属性(二),自定义组合控件Android自定义控件之自定义组合控件(三),常言 ...

随机推荐

  1. undefined == false 么

    今天碰到个问题,我需要去判断 undefined == false 会返回什么,想当然的以为会返回true,但是结果却返回的是false,这我就有点晕了,不是说undefined.null.0.NaN ...

  2. 如何控制docker的CPU和内存份额

    1.内存:docker run -it -m 200M --memory-swap=300M progrium/stress --vm 1 --vm-bytes 500M 刚开始会报错: docker ...

  3. 11.11 开课二个月零七天(ajax和bootstrp做弹窗)

    1.用ajax做弹窗显示信息详情 nation.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN&qu ...

  4. 【SCOI2015】小凸想跑步

    题面 题解 推波柿子: 设点\(A(x_a, y_a), B(x_b, y_b), C(x_c, y_c), D(x_d, y_d), P(x, y)\) \(\vec{a} = (x_b - x_a ...

  5. 【URLOS开发入门】docker官方系统镜像——Alpine入门教程

    我们在进行URLOS应用开发时,经常会用到一些基础系统镜像,如:ubuntu.CentOS.Debian等,我们可以通过docker pull命令直接拉取官方镜像. root@ubuntu:~# do ...

  6. GlusterFS分布式存储数据的恢复机制(AFR)的说明

    GlusterFSFS恢复数据都是基于副本卷来说的,GlusterFSFS复制卷是采用镜像的方式做的,并且是同步事务性操作.简单来说就是,某一个客户要写文件时,先把这个文件锁住,然后同时写两个或多个副 ...

  7. Samba服务的配置总结

    之前介绍了Linux下Samba服务器部署,这里简单总结下Samba服务参数的配置说明: Samba服务的主配置文件是smb.conf,默认在/etc/samba/目录下.smb.conf含有多个段, ...

  8. uml 图学习记录

    UML类图与类的关系详解   2011-04-21 来源:网络   在画类图的时候,理清类和类之间的关系是重点.类的关系有泛化(Generalization).实现(Realization).依赖(D ...

  9. oracle数据库添加新用户

    /*分为四步 */ /*第1步:创建临时表空间 */ create temporary tablespace kmyf_temp tempfile 'E:\app\pangxy\product\11. ...

  10. Linux内核分析第七周总结

    第七章 可执行程序的装载 可执行程序的生成 可执行程序的生成: c语言代码--->经过编译器的预处理--->编译成汇编代码--->由汇编器编译成目标代码--->链接成可执行文件 ...