您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 信息化管理 > 4钢化玻璃屏强度测试软件源代码
钢化玻璃屏强度测试软件源代码1/******************************************************//**系统主界面类//******************************************************/usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Windows;usingSystem.Windows.Controls;usingSystem.Windows.Data;usingSystem.Windows.Documents;usingSystem.Windows.Input;usingSystem.Windows.Media;usingSystem.Windows.Media.Imaging;usingSystem.Windows.Navigation;usingSystem.Windows.Shapes;usingSystem.IO;publicpartialclassThemaininterfaceofsystem{///CoerceItembeforeitisselected.internalFuncT,TCoerceItemCallback{get{returnthis.coerceItem;}set{this.coerceItem=value;}}///TrueifthereisaSelectionChangecurrentlyinprogress.privateboolIsActive{get{returnthis.isActive;}}///Commitselectionchanges.internalvoidEnd(){//Debug.Assert(_owner.CheckAccess());Debug.Assert(this.isActive,TheremustbeaselectionchangeactivewhenyoucallSelectionChange.End());varisRealSelectionChangePending=this.removeFromSelection.Count0||this.addToSelection.Count0;vare=this.BuildSelectionChangedEventArgs();钢化玻璃屏强度测试软件源代码2if(isRealSelectionChangePending&&canChangeSelection!=null){if(canChangeSelection(e)){this.Cancel();return;}}this.InitFlags();this.SynchronizeInternalSelection();if(isRealSelectionChangePending){this.InvokeSelectionChangedEvent(e);}}internalSystem.Windows.Controls.SelectionChangedEventArgsBuildSelectionChangedEventArgs(){#ifWPFreturnnewSelectionChangedEventArgs(System.Windows.Controls.Primitives.Selector.SelectionChangedEvent,this.removeFromSelection.ToList(),this.addToSelection);#elsereturnnewSystem.Windows.Controls.SelectionChangedEventArgs(this.removeFromSelection.ToList(),this.addToSelection);#endif}internalvoidAddJustThis(Titem){this.Begin();intcount=this.Items.Count;for(inti=0;icount;i++){TitemInCollection=this.Items[i];if(itemInCollection.Equals(item)){continue;}else{Remove(itemInCollection);}}if(!this.Items.Contains(item)){Add(item);}钢化玻璃屏强度测试软件源代码3this.End();}///Begintrackingselectionchanges.internalvoidBegin(){//Debug.Assert(_owner.CheckAccess());Debug.Assert(!this.isActive,CannotbeginanewSelectionChangewhenanotheroneisactive.);this.isActive=true;this.addToSelection.Clear();this.removeFromSelection.Clear();}///CancelsthecurrentlyactiveSelectionChanger.internalvoidCancel(){//Debug.Assert(_owner.CheckAccess());this.InitFlags();if(this.addToSelection.Count0){this.addToSelection.Clear();}if(this.removeFromSelection.Count0){this.removeFromSelection.Clear();}}protectedoverridevoidClearItems(){base.ClearItems();this.addToSelection.Clear();this.removeFromSelection=newWeakReferenceListT();if(this.internalSelection!=null){foreach(variteminthis.internalSelection){removeFromSelection.Add(item);}}this.internalSelection.Clear();if(!this.isActive){this.InvokeSelectionChangedEvent();}}protectedoverridevoidInsertItem(intindex,Titem){钢化玻璃屏强度测试软件源代码4if(this.isActive){this.Select(item);}else{this.Begin();this.Select(item);this.End();}}protectedoverridevoidRemoveItem(intindex){TchangedItem=base[index];if(this.isActive){this.Unselect(changedItem);}else{this.Begin();this.Unselect(changedItem);this.End();}}protectedoverridevoidSetItem(intindex,Titem){//Clearoldselect/unselectcollectionsthis.Begin();ToldItem=base[index];//AddoldItemtounselectedcollectionthis.removeFromSelection.Add(oldItem);//AddoldItemtounselectedcollectionthis.addToSelection.Add(item);//Replacetheolditem//andfiresCollectionChangedeventwith//actionReplacebase.SetItem(index,item);//InvokeSelectionChangedeventthis.InvokeSelectionChangedEvent();//Canceltheoperationbecausethechangeisalreadydone//CollectionChangedandSelectionChangedeventsarefired//withthecorrecteventargs.//IfwecallEnd()methodwewilltriggerCollectionChangedevent//withactionAddedafterCollectionChangedeventwithActionReplace.this.Cancel();}钢化玻璃屏强度测试软件源代码5///Queuesomethingtobeaddedtotheselection.///Doesnothingiftheitemisalreadyselected.privatevoidSelect(Titem){//Debug.Assert(_owner.CheckAccess());Debug.Assert(this.isActive,NoSelectionChangeisactive.);//TosupportUnselect(item)/Select(item)whereitemisalreadyselected.if(this.removeFromSelection.Remove(item)){return;}//ifitemisalreadyinselectqueue,ignorethisoperationif(this.addToSelection.Contains(item)){return;}if(!this.internalSelection.Contains(item)){this.AddToSelection(item);}}///Queuesomethingtoberemovedfromtheselection.///Doesnothingiftheitemisnotalreadyselected.privatevoidUnselect(Titem){//Debug.Assert(_owner.CheckAccess());Debug.Assert(this.isActive,NoSelectionChangeisactive.);//TosupportSelect(item)/Unselect(item)whereitemisnotalreadyselected.if(this.addToSelection.Remove(item)){return;}//ifitemisalreadyinunselectqueue,ignorethisoperationif(this.removeFromSelection.Contains(item)){return;}if(this.internalSelection.Contains(item)){this.RemoveFromSelection(item);}}///Selectjustthisitem;allotheritemsinSelectionwillberemoved.钢化玻璃屏强度测试软件源代码6privatevoidSelectJustThisItem(Titem){this.Begin();if(this.Items.Count0){this.Clear();}try{if(item!=null){if(this.removeFromSelection.Contains(item)){this.re
本文标题:4钢化玻璃屏强度测试软件源代码
链接地址:https://www.777doc.com/doc-2926838 .html