资源描述
城市级物业运维管理系统 源代码 61
/******************************************************
//**系统登录 类
//******************************************************/
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 System login
{
/// Interface which must be implemented by all
/// classes which produce ranges distribution.
public interface IRangeDistribution
{
/// Creates list of the ranges.
/// <param name="minValue">Minimal value.</param>
/// <param name="maxValue">Maximal value.</param>
/// <param name="tickMarkCount">Number of the ranges.</param>
/// <returns>List of the ranges for given distribution.</returns>
IEnumerable<MapRange> Create(double minValue, double maxValue, int tickMarkCount);
}
}
}
/******************************************************
//**小区录入 类
//******************************************************/
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 Cell entry
{
///
public class RangeBaseAutomationPeer : FrameworkElementAutomationPeer, IRangeValueProvider
{
/// Initializes a new instance of the RangeBaseAutomationPeer class.
/// <param name="owner"></param>
public RangeBaseAutomationPeer(RangeBase owner)
: base(owner)
{
}
///
public bool IsReadOnly
{
get
{
return !this.IsEnabled();
}
}
///
public double LargeChange
{
get
{
return this.OwnerAsRangeBase().LargeChange;
}
}
///
public double Maximum
{
get
{
return this.OwnerAsRangeBase().Maximum;
}
}
///
public double Minimum
{
get
{
return this.OwnerAsRangeBase().Minimum;
}
}
///
public double SmallChange
{
get
{
return this.OwnerAsRangeBase().SmallChange;
}
}
///
public double Value
{
get
{
return this.GetValue();
}
}
///
/// <param name="value"></param>
void IRangeValueProvider.SetValue(double value)
{
this.SetOwnerValue(value);
}
///
/// <param name="oldValue"></param>
/// <param name="newValue"></param>
[MethodImpl(MethodImplOptions.NoInlining)]
internal void RaiseMaximumPropertyChangedEvent(double oldValue, double newValue)
{
this.RaisePropertyChangedEvent(RangeValuePatternIdentifiers.MaximumProperty, oldValue, newValue);
}
///
/// <param name="oldValue"></param>
/// <param name="newValue"></param>
[MethodImpl(MethodImplOptions.NoInlining)]
internal void RaiseMinimumPropertyChangedEvent(double oldValue, double newValue)
{
this.RaisePropertyChangedEvent(RangeValuePatternIdentifiers.MinimumProperty, oldValue, newValue);
}
///
/// <param name="oldValue"></param>
/// <param name="newValue"></param>
[MethodImpl(MethodImplOptions.NoInlining)]
internal void RaiseValuePropertyChangedEvent(double oldValue, double newValue)
{
this.RaisePropertyChangedEvent(RangeValuePatternIdentifiers.ValueProperty, oldValue, newValue);
}
///
/// <param name="oldValue"></param>
/// <param name="newValue"></param>
[MethodImpl(MethodImplOptions.NoInlining)]
internal void RaiseSmallChangePropertyChangedEvent(double oldValue, double newValue)
{
this.RaisePropertyChangedEvent(RangeValuePatternIdentifiers.SmallChangeProperty, oldValue, newValue);
}
///
/// <param name="oldValue"></param>
/// <param name="newValue"></param>
[MethodImpl(MethodImplOptions.NoInlining)]
internal void RaiseLargeChangePropertyChangedEvent(double oldValue, double newValue)
{
this.RaisePropertyChangedEvent(RangeValuePatternIdentifiers.LargeChangeProperty, oldValue, newValue);
}
///
/// <param name="oldValue"></param>
/// <param name="newValue"></param>
[MethodImpl(MethodImplOptions.NoInlining)]
internal void RaiseIsReadOnlyPropertyChangedEvent(bool oldValue, bool newValue)
{
this.RaisePropertyChangedEvent(RangeValuePatternIdentifiers.IsReadOnlyProperty, oldValue, newValue);
}
internal virtual void SetOwnerValue(double value)
{
this.GuarantyEnabled();
RangeBase owner = this.OwnerAsRangeBase();
if ((value < owner.Minimum) || (value > owner.Maximum))
{
throw new ArgumentOutOfRangeException("value");
}
owner.Value = value;
}
internal virtual double GetValue()
{
double result = this.OwnerAsRangeBase().Value;
return result;
}
///
internal void GuarantyEnabled()
{
if (!IsEnabled())
{
throw new ElementNotEnabledException();
}
}
//// implement this method in descendat
////
///////
////
/////// <returns></returns>
////protected override AutomationControlType GetAutomationControlTypeCore()
////{
//// return AutomationControlType.Slider;
////}
///
/// <returns></returns>
private RangeBase OwnerAsRangeBase()
{
RangeBase owner = this.Owner as RangeBase;
if (null == owner)
{
throw new InvalidOperationException("The Owner have to be a RangeBase or a Descendant");
}
return owner;
}
}
}
}
/******************************************************
//**楼宇录入 类
//******************************************************/
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 Building entry
{
/// Represents the common system parameters.
[SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")]
public class SystemParameters2 : INotifyPropertyChanged
{
private readonly Dictionary<WM, List<_SystemMetricUpdate>> UpdateTable;
[ThreadStatic]
private static SystemParameters2 threadLocalSingleton;
private Rect captionButtonLocation;
private double captionHeight;
private Color glassColor;
private SolidColorBrush glassColorBrush;
private bool isGlassEnabled;
private bool isHighContrast;
private MessageWindow messageHwnd;
private Size smallIconSize;
private string uoxThemeColor;
private string uoxThemeName;
private CornerRadius windowCornerRadius;
private Thickness windowNonClientFrameThickness;
private Thickness windowResizeBorderThickness;
/// Prevents a default instance of the SystemParameters2 class from being created.
private SystemParameters2()
{
////This window gets used for calculations about standard caption button locations
////so it has WS_OVERLAPPEDWINDOW as a style to give it normal caption buttons.
////This window may be shown during calculations of caption bar information, so create it at a location that's likely offscreen.
this.messageHwnd = new MessageWindow((CS)0, WS.OVERLAPPEDWINDOW | WS.DISABLED, (WS_EX)0, new Rect(-16000, -16000, 100, 100), string.Empty, this._WndProc);
this.messageHwnd.Dispatcher.ShutdownStarted += (sender, e) => Utility.SafeDispose(ref this.messageHwnd);
////Fixup the default values of the DPs.
this._InitializeIsGlassEnabled();
this._InitializeGlassColor();
this._InitializeCaptionHeight();
this._InitializeWindowNonClientFrameThickness();
this._InitializeWindowResizeBorderThickness();
this._InitializeCaptionButtonLocation();
this._InitializeSmallIconSize();
this._InitializeHighContrast();
this._InitializeThemeInfo();
////WindowCornerRadius isn't exposed by true system parameters, so it requires the theme to be initialized first.
this._InitializeWindowCornerRadius();
this.UpdateTable = new Dictionary<WM, List<_SystemMetricUpdate>>
{
{ WM.THEMECHANGED,
new List<_SystemMetricUpdate>
{
this._UpdateThemeInfo,
this._UpdateHighContrast,
this._UpdateWindowCornerRadius,
this._UpdateCaptionButtonLocation,
}
},
{ WM.SETTINGCHANGE,
new List<_SystemMetricUpdate>
{
this._UpdateCaptionHeight,
this._UpdateWindowResizeBorderThickness,
this._UpdateSmallIconSize,
this._UpdateHighContrast,
this._UpdateWindowNonClientFrameThickness,
this._UpdateCaptionButtonLocation,
}
},
{
WM.DWMNCRENDERINGCHANGED, new List<_SystemMetricUpdate> { this._UpdateIsGlassEnabled } },
{
WM.DWMCOMPOSITIONCHANGED, new List<_SystemMetricUpdate>
{
this._UpdateIsGlassEnabled
}
},
{
WM.DWMCOLORIZATIONCOLORCHANGED, new List<_SystemMetricUpdate>
{
this._UpdateGlassColor
}
},
};
}
private delegate void _SystemMetricUpdate(IntPtr param, IntPtr legParam);
/// Identifies the PropertyChanged event handler.
public event PropertyChangedEventHandler PropertyChanged;
/// Identifies the current instance.
public static SystemParameters2 Current
{
get
{
if (threadLocalSingleton == null)
{
threadLocalSingleton = new SystemParameters2();
}
return threadLocalSingleton;
}
}
/// Identifies the HighContrast property.
public bool HighContrast
{
get
{
return this.isHighContrast;
}
private set
{
if (value != this.isHighContrast)
{
this.isHighContrast = value;
this._NotifyPropertyChanged("HighContrast");
}
}
}
/// Identifies the IsGlassEnabled property.
public bool IsGlassEnabled
{
get
{
////return this.isGlassEnabled;
////It turns out there may be some lag between someone asking this
////and the window getting updated. It's not too expensive, just always do the check.
return Telerik.Windows.Controls.RibbonBar.Shell.Standard.NativeMethodsHelper.NativeMethods.DwmIsCompositionEnabled();
}
private set
{
if (value != this.isGlassEnabled)
{
this.isGlassEnabled = value;
this._NotifyPropertyChanged("IsGlassEnabled");
}
}
}
/// Identifies the SmallIconSize property.
public Size SmallIconSize
{
get
{
return new Size(this.smallIconSize.Width, this.smallIconSize.Height);
}
private set
{
if (value != this.smallIconSize)
{
this.smallIconSize = value;
this._NotifyPropertyChanged("SmallIconSize");
}
}
}
/// Identifies the UxThemeColor property.
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Ux")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ux")]
public string UxThemeColor
{
get
{
return this.uoxThemeColor;
}
private set
{
if (value != this.uoxThemeColor)
{
this.uoxThemeColor = value;
this._NotifyPropertyChanged("UxThemeColor");
}
}
}
/// Identifies the UxThemeName property.
[SuppressMessage("Microsoft.Naming", "CA17
展开阅读全文