1空调温度控制软件源代码资料.docx
《1空调温度控制软件源代码资料.docx》由会员分享,可在线阅读,更多相关《1空调温度控制软件源代码资料.docx(161页珍藏版)》请在冰豆网上搜索。
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;
publicpartialclassSoftware{
///Movesthespecifiedoldindex.
///Theoldindex.
///Thenewindex.
publicvoidMove(intoldIndex,intnewIndex)
{
this.MoveItem(oldIndex,newIndex);
}
///Addstherange.
///Theitems.
publicvoidAddRange(paramsT[]items)
this.BeginUpdate();
for(inti=0;i{this.Add(items[i]);}this.EndUpdate();}///Beginstheupdate.publicvoidBeginUpdate(){this.update++;}///Endstheupdate.publicvoidEndUpdate(){this.EndUpdate(true);}internalvirtualvoidEndUpdate(boolnotify){update--;if(update<=0){this.update=0;if(notify){OnCollectionChanged(newNotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));}}}#endregion#regionOverridesprotectedinternalintVersion{get{returnthis.version;}}protectedboolIsInUpdate{get{returnthis.update>0;}}protectedoverridevoidInsertItem(intindex,Titem){base.InsertItem(index,item);this.OnPropertyChanged("Count");this.OnPropertyChanged("Item[]");this.OnCollectionChanged(NotifyCollectionChangedAction.Add,item,index);}protectedoverridevoidSetItem(intindex,Titem){ToldItem=base[index];base.SetItem(index,item);this.OnPropertyChanged("Item[]");this.OnCollectionChanged(NotifyCollectionChangedAction.Replace,oldItem,item,index);}protectedoverridevoidRemoveItem(intindex){Titem=base[index];base.RemoveItem(index);this.OnPropertyChanged("Count");this.OnPropertyChanged("Item[]");this.OnCollectionChanged(NotifyCollectionChangedAction.Remove,item,index);}protectedoverridevoidClearItems(){base.ClearItems();this.OnPropertyChanged("Count");this.OnPropertyChanged("Item[]");this.OnCollectionChanged(NotifyCollectionChangedAction.Reset);}protectedvirtualvoidMoveItem(intoldIndex,intnewIndex){Titem=base[oldIndex];base.RemoveItem(oldIndex);base.InsertItem(newIndex,item);this.OnPropertyChanged("Item[]");this.OnCollectionChanged(NotifyCollectionChangedAction.Move,item,newIndex,oldIndex);}#endregion#regionINotifyCollectionChangedMemberspubliceventNotifyCollectionChangedEventHandlerCollectionChanged;protectedvirtualvoidOnCollectionChanged(NotifyCollectionChangedEventArgsargs){if(this.CollectionChanged!=null&&update==0){this.CollectionChanged(this,args);this.version++;}}privatevoidOnCollectionChanged(NotifyCollectionChangedActionaction){OnCollectionChanged(newNotifyCollectionChangedEventArgs(action));}privatevoidOnCollectionChanged(NotifyCollectionChangedActionaction,objectitem,intindex){OnCollectionChanged(newNotifyCollectionChangedEventArgs(action,item,index));}privatevoidOnCollectionChanged(NotifyCollectionChangedActionaction,objectoldItem,objectitem,intindex){OnCollectionChanged(newNotifyCollectionChangedEventArgs(action,oldItem,item,index));}#endregion#regionINotifyPropertyChangedMemberspubliceventPropertyChangedEventHandlerPropertyChanged;protectedvirtualvoidOnPropertyChanged(PropertyChangedEventArgse){if(this.PropertyChanged!=null){this.PropertyChanged(this,e);}}protectedvoidOnPropertyChanged(stringpropertyName){this.OnPropertyChanged(newPropertyChangedEventArgs(propertyName));}#endregion}} }/******************************************************//**校准设置类//******************************************************/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;publicpartialclassCalibrationsettings{///Baseclassforalllayers.publicabstractclassMapLayer:ItemsControl,ILayer{///IdentifiestheBaseZoomLeveldependencyproperty.publicstaticreadonlyDependencyPropertyBaseZoomLevelProperty=DependencyProperty.RegisterAttached("BaseZoomLevel",typeof(double),typeof(MapLayer),newPropertyMetadata(double.NaN,newPropertyChangedCallback(LocationChangedHandler)));///IdentifiestheHotSpotdependencyproperty.publicstaticreadonlyDependencyPropertyHotSpotProperty=DependencyProperty.RegisterAttached("HotSpot",typeof(HotSpot),typeof(MapLayer),newPropertyMetadata(null,newPropertyChangedCallback(LocationChangedHandler)));///IdentifiestheGeographicalSizedependencyproperty.publicstaticreadonlyDependencyPropertyGeographicalSizeProperty=DependencyProperty.RegisterAttached("GeographicalSize",typeof(Location),typeof(MapLayer),newPropertyMetadata(Location.Empty,newPropertyChangedCallback(GeographicalSizeChangedHandler)));///IdentifiestheLocationdependencyproperty.publicstaticreadonlyDependencyPropertyLocationProperty=DependencyProperty.RegisterAttached("Location",typeof(Location),typeof(MapLayer),newPropertyMetadata(Location.Empty,newPropertyChangedCallback(LocationChangedHandler)));///IdentifiestheMaxScaledependencyproperty.publicstaticreadonlyDependencyPropertyMaxScaleProperty=DependencyProperty.RegisterAttached("MaxScale",typeof(double),typeof(MapLayer),newPropertyMetadata(double.NaN,newPropertyChangedCallback(LocationChangedHandler)));///IdentifiestheMinScaledependencyproperty.publicstaticreadonlyDependencyPropertyMinScaleProperty=DependencyProperty.RegisterAttached("MinScale",typeof(double),typeof(MapLayer),newPropertyMetadata(double.NaN,newPropertyChangedCallback(LocationChangedHandler)));///IdentifiestheZoomRangedependencyproperty.publicstaticreadonlyDependencyPropertyZoomRangeProperty=DependencyProperty.RegisterAttached("ZoomRange",typeof(ZoomRange),typeof(MapLayer),newPropertyMetadata(ZoomRange.Empty,newPropertyChangedCallback(LocationChangedHandler)));privateWeakReferencemapControl=null;///InitializesanewinstanceoftheMapLayerclass.protectedMapLayer(){this.Loaded+=newRoutedEventHandler(this.BaseLayer_Loaded);}///Getsorsetsmapcontrolthislayerbelongsto.publicRadMapMapControl{get{if(this.mapControl!=null&&this.mapControl.IsAlive){returnthis.mapControl.TargetasRadMap;}else{returnnull;}}set{RadMapoldMap=null;if(this.mapControl!=null&&this.mapControl.IsAlive){oldMap=this.mapControl.TargetasRadMap;}this.mapControl=value!=null?newWeakReference(value):null;this.OnMapChanged(oldMap,value);}}///GetsvalueoftheattachableBaseZoomLevelproperty.///TheBaseZoomLevelaffectFrameworkElements(exceptMapShapebasedones.)///Itspecifyzoomlevelwhereframeworkelementintheinformationlayer///haveScaleTransformwithscale=1.Ifthispropertyisset,then///scaletransformationwillbeappliedtotheframeworkelementwhen///wezoomin/outmapcontrol.///Elementtogetvalueofthepropertyfrom.///ValueoftheBaseZoomLevelproperty.publicstaticdoubleGetBaseZoomLevel(DependencyObjectelement){return(double)element.GetValue(BaseZoomLevelProperty);}///GetsvalueoftheattachableHotSpotproperty.///Elementtogetvalueofthepropertyfrom.///ValueoftheHotSpotproperty.publicstaticHotSpotGetHotSpot(DependencyObjectelement){return(HotSpot)element.GetValue(HotSpotProperty);}///GetsvalueoftheattachableGeographicalSizeproperty.///Elementtogetvalueofthepropertyfrom.///ValueoftheGeographicalSizeproperty.publicstaticLocationGetGeographicalSize(DependencyObjectelement){return(Location)element.GetValue(GeographicalSizeProperty);}///GetsvalueoftheattachableLocationproperty.///Elementtogetvalueofthepropertyfrom.///ValueoftheLocationproperty.publicstaticLocationGetLocation(DependencyObjectelement){return(Location)element.GetValue(LocationProperty);}///GetsvalueoftheattachableMaxScaleproperty.///TheMaxScaleaffectFrameworkElements(exceptMapShapebasedones.)///Itspecifymaximumscalefactorwhichwillbeappliedtotheframeworkelementwhen///ithasBaseZoomLevelpropertysetandwezoominmapcontrol.///Elementtogetvalueofthepropertyfrom.///ValueoftheMaxScaleproperty.pub
this.Add(items[i]);
this.EndUpdate();
///Beginstheupdate.
publicvoidBeginUpdate()
this.update++;
///Endstheupdate.
publicvoidEndUpdate()
this.EndUpdate(true);
internalvirtualvoidEndUpdate(boolnotify)
update--;
if(update<=0)
this.update=0;
if(notify)
OnCollectionChanged(newNotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
#endregion
#regionOverrides
protectedinternalintVersion
get
returnthis.version;
protectedboolIsInUpdate
get{returnthis.update>0;}
protectedoverridevoidInsertItem(intindex,Titem)
base.InsertItem(index,item);
this.OnPropertyChanged("Count");
this.OnPropertyChanged("Item[]");
this.OnCollectionChanged(NotifyCollectionChangedAction.Add,item,index);
protectedoverridevoidSetItem(intindex,Titem)
ToldItem=base[index];
base.SetItem(index,item);
this.OnCollectionChanged(NotifyCollectionChangedAction.Replace,oldItem,item,index);
protectedoverridevoidRemoveItem(intindex)
Titem=base[index];
base.RemoveItem(index);
this.OnCollectionChanged(NotifyCollectionChangedAction.Remove,item,index);
protectedoverridevoidClearItems()
base.ClearItems();
this.OnCollectionChanged(NotifyCollectionChangedAction.Reset);
protectedvirtualvoidMoveItem(intoldIndex,intnewIndex)
Titem=base[oldIndex];
base.RemoveItem(oldIndex);
base.InsertItem(newIndex,item);
this.OnCollectionChanged(NotifyCollectionChangedAction.Move,item,newIndex,oldIndex);
#regionINotifyCollectionChangedMembers
publiceventNotifyCollectionChangedEventHandlerCollectionChanged;
protectedvirtualvoidOnCollectionChanged(NotifyCollectionChangedEventArgsargs)
if(this.CollectionChanged!
=null&&update==0)
this.CollectionChanged(this,args);
this.version++;
privatevoidOnCollectionChanged(NotifyCollectionChangedActionaction)
OnCollectionChanged(newNotifyCollectionChangedEventArgs(action));
privatevoidOnCollectionChanged(NotifyCollectionChangedActionaction,objectitem,intindex)
OnCollectionChanged(newNotifyCollectionChangedEventArgs(action,item,index));
privatevoidOnCollectionChanged(NotifyCollectionChangedActionaction,objectoldItem,objectitem,intindex)
OnCollectionChanged(newNotifyCollectionChangedEventArgs(action,oldItem,item,index));
#regionINotifyPropertyChangedMembers
publiceventPropertyChangedEventHandlerPropertyChanged;
protectedvirtualvoidOnPropertyChanged(PropertyChangedEventArgse)
if(this.PropertyChanged!
=null)
this.PropertyChanged(this,e);
protectedvoidOnPropertyChanged(stringpropertyName)
this.OnPropertyChanged(newPropertyChangedEventArgs(propertyName));
//**校准设置类
publicpartialclassCalibrationsettings{
///Baseclassforalllayers.
publicabstractclassMapLayer:
ItemsControl,ILayer
///IdentifiestheBaseZoomLeveldependencyproperty.
publicstaticreadonlyDependencyPropertyBaseZoomLevelProperty=DependencyProperty.RegisterAttached(
"BaseZoomLevel",
typeof(double),
typeof(MapLayer),
newPropertyMetadata(double.NaN,newPropertyChangedCallback(LocationChangedHandler)));
///IdentifiestheHotSpotdependencyproperty.
publicstaticreadonlyDependencyPropertyHotSpotProperty=DependencyProperty.RegisterAttached(
"HotSpot",
typeof(HotSpot),
newPropertyMetadata(null,newPropertyChangedCallback(LocationChangedHandler)));
///IdentifiestheGeographicalSizedependencyproperty.
publicstaticreadonlyDependencyPropertyGeographicalSizeProperty=DependencyProperty.RegisterAttached(
"GeographicalSize",
typeof(Location),
newPropertyMetadata(Location.Empty,newPropertyChangedCallback(GeographicalSizeChangedHandler)));
///IdentifiestheLocationdependencyproperty.
publicstaticreadonlyDependencyPropertyLocationProperty=DependencyProperty.RegisterAttached(
"Location",
newPropertyMetadata(Location.Empty,newPropertyChangedCallback(LocationChangedHandler)));
///IdentifiestheMaxScaledependencyproperty.
publicstaticreadonlyDependencyPropertyMaxScaleProperty=DependencyProperty.RegisterAttached(
"MaxScale",
///IdentifiestheMinScaledependencyproperty.
publicstaticreadonlyDependencyPropertyMinScaleProperty=DependencyProperty.RegisterAttached(
"MinScale",
///IdentifiestheZoomRangedependencyproperty.
publicstaticreadonlyDependencyPropertyZoomRangeProperty=DependencyProperty.RegisterAttached(
"ZoomRange",
typeof(ZoomRange),
newPropertyMetadata(ZoomRange.Empty,newPropertyChangedCallback(LocationChangedHandler)));
privateWeakReferencemapControl=null;
///InitializesanewinstanceoftheMapLayerclass.
protectedMapLayer()
this.Loaded+=newRoutedEventHandler(this.BaseLayer_Loaded);
///Getsorsetsmapcontrolthislayerbelongsto.
publicRadMapMapControl
if(this.mapControl!
=null
&&this.mapControl.IsAlive)
returnthis.mapControl.TargetasRadMap;
else
returnnull;
set
RadMapoldMap=null;
oldMap=this.mapControl.TargetasRadMap;
this.mapControl=value!
=null?
newWeakReference(value):
null;
this.OnMapChanged(oldMap,value);
///GetsvalueoftheattachableBaseZoomLevelproperty.
///TheBaseZoomLevelaffectFrameworkElements(exceptMapShapebasedones.)
///Itspecifyzoomlevelwhereframeworkelementintheinformationlayer
///haveScaleTransformwithscale=1.Ifthispropertyisset,then
///scaletransformationwillbeappliedtotheframeworkelementwhen
///wezoomin/outmapcontrol.
///Elementtogetvalueofthepropertyfrom.
///ValueoftheBaseZoomLevelproperty.
publicstaticdoubleGetBaseZoomLevel(DependencyObjectelement)
return(double)element.GetValue(BaseZoomLevelProperty);
///GetsvalueoftheattachableHotSpotproperty.
///ValueoftheHotSpotproperty.
publicstaticHotSpotGetHotSpot(DependencyObjectelement)
return(HotSpot)element.GetValue(HotSpotProperty);
///GetsvalueoftheattachableGeographicalSizeproperty.
///ValueoftheGeographicalSizeproperty.
publicstaticLocationGetGeographicalSize(DependencyObjectelement)
return(Location)element.GetValue(GeographicalSizeProperty);
///GetsvalueoftheattachableLocationproperty.
///ValueoftheLocationproperty.
publicstaticLocationGetLocation(DependencyObjectelement)
return(Location)element.GetValue(LocationProperty);
///GetsvalueoftheattachableMaxScaleproperty.
///TheMaxScaleaffectFrameworkElements(exceptMapShapebasedones.)
///Itspecifymaximumscalefactorwhichwillbeappliedtotheframeworkelementwhen
///ithasBaseZoomLevelpropertysetandwezoominmapcontrol.
///ValueoftheMaxScaleproperty.
pub
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1