




已阅读5页,还剩59页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
高信设备状态检修辅助决策系统软件 源代码/*/*企业信息管理 类/*/using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;using System.IO;public partial class Enterpriseinformationmanagement / Implements scrolling logic for a grids rows public class RowScroller : ItemScroller #region Fields private GridTableElement tableElement; #endregion #region Constructor / Initialize an instance of . / The associated instance of . public RowScroller(GridTableElement tableElement) this.tableElement = tableElement; #endregion #region Properties / Gets the associated instance of . / Returns the associated instance of . protected GridTableElement TableElement get return this.tableElement; private bool CanUpdateScrollRange get return this.tableElement != null & this.tableElement.ViewElement != null & this.tableElement.ViewElement.Visibility = ElementVisibility.Visible; #endregion #region Methods public override void UpdateScrollRange() if (this.CanUpdateScrollRange) base.UpdateScrollRange(); public override void UpdateScrollRange(int width, bool updateScrollValue) if (this.CanUpdateScrollRange) base.UpdateScrollRange(width, updateScrollValue); #endregion #region Events / Fired when ToolTip needs text / Event sender / An instance of . protected override void OnToolTipTextNeeded(object sender, ToolTipTextNeededEventArgs e) ItemScrollerToolTipTextNeededEventArgs itemScrollerArgs = e as ItemScrollerToolTipTextNeededEventArgs; GridElementToolTipTextNeededEventArgs args = new GridElementToolTipTextNeededEventArgs(itemScrollerArgs.ItemIndex, itemScrollerArgs.Item, e.ToolTipText); base.OnToolTipTextNeeded(sender, args); e.ToolTipText = args.ToolTipText; #endregion /*/*部门信息设置 类/*/using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;using System.IO;public partial class Departmentinformationset/ Serves as a base class to all hierarchical views.SuppressMessage(Microsoft.Naming, CA1710:IdentifiersShouldHaveCorrectSuffix, Justification = The naming is consistent with the base class.)public abstract class HierarchicalCollectionViewBase : QueryableCollectionViewinternal abstract HierarchicalCollectionView RootView get; internal HierarchicalCollectionViewBase(IEnumerable sourceCollection):base(sourceCollection)/ Gets the hierarchy descriptors used for hierarchy construction. / If this view is a child one, its root view hierarchy descriptors are returned./ The hierarchy descriptors.public abstract HierarchyDescriptorCollection HierarchyDescriptors get; / Overrides the CreateView method and returns a IQueryable view/ specific to the hierarchy collection view./ protected override IQueryable CreateView()returnthis.CreateHierachyView().SelectRecursive(h = this.RootView.IsItemExpanded(h.Item) ? h.Children : Enumerable.Empty().Select(h = h.Item).AsQueryable();internal IEnumerable CreateHierachyView() var enumerable = this.BaseView .Cast() .AsEnumerable() .Select(i = var view = this.RootView.GetChildrenView(i, this); return new HierarchyItem(i, () = view.CreateHierachyView(); ); if (this.IsFiltered) enumerable = enumerable.Where(h = this.Filter(h.Item) | h.Children.Any(); /enumerable = enumerable.Where(h = (bool)this.FilterItem(h.Item) | h.Children.Any(); return enumerable; /Func _FilterItem; /internal Func FilterItem / / get / / if (this.RootView != null & this.RootView._FilterItem != null & / this.RootView.ElementType != null & this.ElementType != null & / (this.RootView.ElementType.IsAssignableFrom(this.ElementType) | this.ElementType.IsAssignableFrom(this.RootView.ElementType) / / return this.RootView._FilterItem; / / if (_FilterItem = null) / / var parameterExpression = System.Linq.Expressions.Expression.Parameter(this.ElementType, item); / var expressionBuilder = new Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder(parameterExpression, this.FilterDescriptors); / var filterExpression = expressionBuilder.CreateFilterExpression(); / if (filterExpression != null) / / _FilterItem = BindingToExpressionHelper.CreateUntypedMemberAccessFunc(filterExpression); / / else / / _FilterItem = item = true; / / / return _FilterItem; / / /internal override void OnFilterDescriptorsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) / / _FilterItem = null; / base.OnFilterDescriptorsCollectionChanged(sender, e); / /internal override void OnFilterDescriptorsPropertyChanged(object sender, PropertyChangedEventArgs e) / / _FilterItem = null; / base.OnFilterDescriptorsPropertyChanged(sender, e); / /internal override void OnFilterDescriptorsItemChanged(object sender, ItemChangedEventArgs e) / / _FilterItem = null; / base.OnFilterDescriptorsItemChanged(sender, e); /internal IQueryable BaseViewgetif (this.TotalItemCount = 0)return this.QueryableSourceCollection;elsereturnthis.QueryableSourceCollection.Sort(this.SortDescriptors);internal void RefreshCore()this.RefreshOverrideCore();/ Returns the internal count of the collections tected override int InternalCountgetreturn this.IsInitialized ? this.InternalList.Count : 0;/ Returns false. Grouping is not supported.public override bool IsGroupedgetreturn false;internal bool IsInitializedgetreturn this.RootView != null;internal override void InitializeInternalList(IQueryable view)Type genericType = typeof(List).MakeGenericType(view.ElementType);ernalList = (IList)Activator.CreateInstance(genericType, null);internal override void PopulateInternalList(IQueryable view)if (ernalList = null)return;foreach (var item in view)ernalList.Add(item);internal override void RefreshOnItemAction(object item, ItemAction action)/ This method was made internal virtual with the introduction of the KeyedCollection and grouping/ optimizations in the QCV. At the time it seemed impossible to make the HCVB/ work with the new KeyedCollection so we decided to leave the HCVB as before./ The HCVB wants to preserve the code the same as before the KeyedCollection was introduced./ that is why it overrides all QCV methods that it needs to and preserves the old code./ IsGrouped is always false here in the HCVBif (this.CanSourceCollectionHandleItemAction(action)return;if (this.IsPaged)this.ProcessPagedCollectionChanged();return;var removedArgs = this.CreateRemovedItemCollectionChangedArgs(action, item);this.RefreshInternalLite();var addedArgs = this.CreateAddedItemCollectionChangedArgs(action, item);this.RaiseCollectionChangedOnItemAction(action, addedArgs, removedArgs);internal override void ProcessSynchronousCollectionChanged(NotifyCollectionChangedEventArgs args)/ This method was made internal virtual with the introduction of the KeyedCollection and grouping/ optimizations in the QCV. At the time it seemed impossible to make the this derived collection/ work with the new KeyedCollection so we decided to leave this as before./ This collection wants to preserve the code the same as before the KeyedCollection was introduced./ that is why it overrides all QCV methods that it needs to and preserves the old code.if (args = null)return;if (args.Action = NotifyCollectionChangedAction.Reset)/possibly cancel any current editing operationthis.RefreshOrDefer();else if (this.IsPaged)this.ProcessPagedCollectionChanged();elsevar adjustedOldIndex = this.AdjustOldIndices(args);this.RefreshInternalLite();var adjustedNewIndex = this.AdjustNewIndices(args);this.ProcessSynchronousCollectionChangedWithAdjustedArgs(args, adjustedOldIndex, adjustedNewIndex);/*/*员工信息设置 类/*/using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;using System.IO;public partial class Employeeinformationset / Unit tests for RibbonQuickAcessToolBar TestClass public partial class RibbonQuickAcessToolBarTest : AsyncUITest protected virtual QuickAccessToolBar CreateTestControl() var result = new QuickAccessToolBar(); return result; public RadRibbonBar RibbonElement get return this.TestElement; QuickAccessToolBar toolBar; public override void TestInitialize() base.TestInitialize(); toolBar = this.CreateTestControl(); this.TestPanel.Children.Add(toolBar); this.Show(); toolBar = new QuickAccessToolBar(); RibbonElement.QuickAccessToolBar = toolBar; public override void TestCleanup() base.TestCleanup(); this.TestPanel.Children.Clear(); toolBar = null; TestMethod Description(Check ToolBars Orientation Property.) public void OrientationProperty() Assert.AreEqual(Orientation.Horizontal, this.toolBar.Orientation); this.toolBar.Orientation = Orientation.Vertical; Assert.AreEqual(Orientation.Vertical, this.toolBar.Orientation); this.toolBar.Orientation = Orientation.Horizontal; Assert.AreEqual(Orientation.Horizontal, this.toolBar.Orientation); TestMethod#if !WPF Ignore#endif public void IsOverflowOpen() Assert.IsFalse(this.toolBar.IsOverflowOpen); this.toolBar.IsOverflowOpen = true; Assert.IsTrue(this.toolBar.IsOverflowOpen); this.toolBar.IsOverflowOpen = false; Assert.IsFalse(this.toolBar.IsOverflowOpen); / Ensure all default values are not null. TestMethod Description(Ensure all default values are correct.) public void CheckForNullDefaultValuesToolBar() Assert.IsFalse(this.toolBar.IsOverflowOpen); Assert.IsFalse(this.toolBar.HasOverflowItems); Assert.AreEqual(0, this.toolBar.Band); Assert.AreEqual(-1, this.toolBar.BandIndex); Assert.AreEqual(Orientation.Horizontal, this.toolBar.Orientation); Assert.IsNotNull(toolBar); / Ensure all default values are not null. TestMethod Description(Ensure all default values are correct.) public void CheckForDifferentButtonsSupport() RadRibbonButton button1 = new RadRibbonButton(); RadRibbonDropDownButton button2 = new RadRibbonDropDownButton(); RadRibbonSplitButton button3 = new RadRibbonSplitButton(); RadRibbonToggleButton button4 = new RadRibbonToggleButton(); RadRibbonRadioButton button5 = new RadRibbonRadioButton(); RadButton button6 = new RadButton(); RadDropDownButton button7 = new RadDropDownButton(); RadSplitButton button8 = new RadSplitButton(); RadToggleButton button9 = new RadToggleButton(); RadRadioButton button10 = new RadRadioButton(); Assert.IsNotNull(toolBar); Assert.AreEqual(Orientation.Horizontal, this.toolBar.Orientation); toolBar.Items.Add(button1); toolBar.Items.Add(button2); toolBar.Items.Add(button3); toolBar.Items.Add(button4); toolBar.Items.Add(button5); toolBar.Items.Add(button6); toolBar.Items.Add(button7); toolBar.Items.Add(button8); toolBar.Items.Add(button9); toolBar.Items.Add(button10); Assert.AreEqual(toolBar.Items0,button1); Assert.AreEqual(toolBar.Items1, button2); Assert.AreEqual(toolBar.Items2, button3); Assert.AreEqual(toolBar.Items3, button4); Assert.AreEqual(toolBar.Items4, button5); Assert.AreEqual(toolBar.Items5, button6); Assert.AreEqual(toolBar.Items6, button7); Assert.AreEqual(toolBar.Items7, button8); Assert.AreEqual(toolBar.Items8, button9); Assert.AreEqual(toolBar.Items9, button10); / IsMinimized test. TestMethod Description(Ensure all default values are correct.) public void IsMinimizedTest() this.RibbonElement.IsMinimized = true; Assert.AreEqual(this.RibbonElement.IsMinimized,true); Assert.AreEqual(this.toolBar.Position , QuickAccessToolBarPosition.AboveRibbon); /*/*设备资料管理 类/*/using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;using System.IO;public partial class Equipmentinformationmanagement/ Provides data for the LoadedData event.public sealed class LoadedDataEventArgs : AsyncCompletedEventArgsprivate ReadOnlyCollection allEntities;private ReadOnlyCollection entities;private bool isErrorHandled;private int totalEntityCount;internal LoadedDataEventArgs(IEnumerable entities, IEnumerable allEntities, int totalEntityCount, bool cancelled, Exception error) : base(error, can
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年智能投顾平台风险控制与合规运营风险管理风险控制策略创新报告
- 2022员工的获奖感言
- 2022年冬季安全教育讲话稿15篇
- 年产200吨医药中间体项目初步设计(参考范文)
- 2022拓展训练的心得体会合集15篇
- 国际冷链物流产业园扩建项目建议书(范文参考)
- 供水设施改造与升级可行性研究报告
- 服装设计作业展示
- 德育心理健康教育主题班会
- 五邑大学《媒介管理学》2023-2024学年第二学期期末试卷
- 2025年全国防灾减灾日班会 课件
- SL631水利水电工程单元工程施工质量验收标准第1部分:土石方工程
- (二调)武汉市2025届高中毕业生二月调研考试 英语试卷(含标准答案)+听力音频
- 数学-湖北省武汉市2025届高中毕业生二月调研考试(武汉二调)试题和解析
- 平板电脑样机功能测试报告
- 小学五年级英语一般疑问句练习题
- SAP_PS-PS模块配置和操作手册
- 煤矸石综合利用填沟造地复垦项目可行性研究报告-甲乙丙资信
- 绿化养护报价表(共8页)
- 小升初幼升小学生择校重点中学入学简历自荐信自我介绍word模板 女生版
- 本科教学工作审核评估汇报PPT课件
评论
0/150
提交评论