using System.ComponentModel;
using System.Threading;
using System.Windows.Forms;
using app.Viewer.ViewModels;
using Bedrock.Winform; namespace app.Viewer.Views
{
/// <summary>
/// 帧频显示控件类
/// </summary>
public partial class FrqView : PartialView
{
#region "Field"
private FrqViewModel _frqViewModel;
private SynchronizationContext _context;
#endregion #region "Constructor"
public FrqView(FrqViewModel model)
{
_frqViewModel = model;
DataContext = model;
InitializeComponent();
Dock = DockStyle.Top; _context = SynchronizationContext.Current;
_frqViewModel.PropertyChanged += _frqViewModel_PropertyChanged;
}
#endregion #region "PropertyChanged" void _frqViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
switch (e.PropertyName)
{
case "Frq":
_context.Post(o =>
{
FRdata.Text = _frqViewModel.Frq.ToString("f1");
Refresh();
},null);
break;
}
}
#endregion
}
}
 using System.ComponentModel;
using System.Windows.Forms;
using app.Main.Graph;
using app.KeyBoards.Events; namespace app.Measure.Actions
{
/// <summary>
/// 操作接口
/// </summary>
public interface IToolAction : IActor, INotifyPropertyChanged
{
/// <summary>
/// 鼠标事件处理
/// </summary>
/// <param name="sender"></param>
/// <param name="eventArgs">鼠标事件参数</param>
void MouseEventHandle(object sender, MouseEventArgs eventArgs); /// <summary>
/// 功能键按键事件处理
/// </summary>
/// <param name="eventArgs">功能键事件参数</param>
void KeyBoardEventHandle(KeyBoardEventArgs eventArgs);
///// <summary>
///// 按键事件处理
///// </summary>
///// <param name="keyEventArgs">按键事件参数</param>
//void KeyEventHandle(KeyEventArgs keyEventArgs);
}
}
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using app.Configuration.Models;
using app.Configuration.Services;
using app.Lib;
using app.Lib.Graph;
using app.Measure.Events;
using app.Measure.Models;
using app.Measure.ViewModels;
using app.Measure.Actions;
using Bedrock.Events;
using Microsoft.Practices.Unity;
using app.Main;
using app.Main.Graph;
using app.KeyBoards.Events; namespace app.Measure.Tools
{
//椭圆测量工具
public class _2DEllipse : PropertyChangedBase,IToolAction
{
private readonly IEventAggregator _eventAggregator;
private readonly IConfigService _configService;
private readonly MeasureData _measureData; //存放绘图工具的ID private readonly List<Point> _points; //绘制椭圆的坐标集
private readonly Measurement _measurement; //该测量环境的XML配置
private readonly Brush _plotBrush; //绘制圆点的对象
private readonly Pen _linePen; //绘制曲线的对象
private readonly int _widthOfPlot; //圆点半径
private ICoordinate _coordinate; //坐标系对象
private readonly List<MeasureResultItem> _resultItems; //存放测量值的列表
private int _resultIndex; //测量值索引
private double _width; //椭圆的长半轴长
private double _height; //椭圆的短半轴长
private readonly CalculationFomula _calculationFomula; // 计算公式
private readonly MeasureToolType _measuretooltype; //读取工具XML的配置,初始化绘图工具
public _2DEllipse(IUnityContainer unityContainer, IEventAggregator eventAggregator)
{
Logger.Log("_2DEllipse Start Initial", Level.Info);
MeasureTool tool;
var unityContainer1 = unityContainer;
_eventAggregator = eventAggregator;
_configService = unityContainer1.Resolve<IConfigService>();
_measureData = unityContainer1.Resolve<MeasureData>(); _resultItems = new List<MeasureResultItem>
{
new MeasureResultItem("LAxis", "mm", ),
new MeasureResultItem("SAxis", "mm", ),
new MeasureResultItem("Cir", "mm", ),
new MeasureResultItem("Area", "mm2", )
};
_resultIndex = ; _calculationFomula = new CalculationFomula();
_points = new List<Point>();
if (_measureData.IsGenericTool == false)
{
_measurement = _configService.GetMeasurementId(_measureData.MeasurementId);
tool = _configService.GetMeasureToolId(_measureData.ToolId);
}
else
{
_measurement = _configService.GetMeasurementId(_measureData.GenericToolItem[_measureData.GenericToolIndex].MeasurementId);
tool = _configService.GetMeasureToolId(_measureData.GenericToolItem[_measureData.GenericToolIndex].ToolId);
}
_plotBrush = new SolidBrush(Common.IntToColor(tool.ColorOfPlot));
_widthOfPlot = tool.WidthOfPlot;
_measuretooltype = tool.MeasureToolType;
_linePen = new Pen(Common.IntToColor(tool.ColorOfLine), tool.WidthOfLine) {DashStyle = tool.Dashstype};
_eventAggregator.GetEvent<PubSubEvent<string>>().Subscribe(EventHandle, true);
Logger.Log("_2DEllipse End Initial", Level.Info);
} //绘图
public void Draw(Graphics graphics, ICoordinate coordinate)
{
//ToolDraw.DrawFromToolData(graphics, coordinate, _MeasureData.GetToolPositionDataItem); if (coordinate != null)
{
_coordinate = coordinate;
if (_isInViewRegion == false)
{
return;
}
} if (_points.Count < )
{
foreach (var p in _points)
{
graphics.FillEllipse(_plotBrush, new Rectangle(p.X - _widthOfPlot, p.Y - _widthOfPlot, _widthOfPlot * , _widthOfPlot * ));
}
} if (_points.Count != ) return;
_width = 0.5 * Math.Sqrt((_points[].X - _points[].X) * (_points[].X - _points[].X) + (_points[].Y - _points[].Y) * (_points[].Y - _points[].Y));
var p1 = new PointD((_points[].X + _points[].X) / 2.0, y: (_points[].Y + _points[].Y) / 2.0);
_height = Math.Sqrt((p1.X - _points[].X) * (p1.X - _points[].X) + (p1.Y - _points[].Y) * (p1.Y - _points[].Y));
if (coordinate != null)
graphics.DrawEllipse(_linePen, (int)coordinate.ViewRegionD.Min.X, (int)coordinate.ViewRegionD.Min.Y, (int)_height * , (int)_width * );
} //计算结果
private void CaculateResult()
{
if (_coordinate == null)
{
return;
}
var p = new PointD((_points[].X + _points[].X) / 2.0, (_points[].Y + _points[].Y) / 2.0);
p = _coordinate.ViewToWorld(p);
var p1 = _coordinate.ViewToWorld(_points[]);
var p2 = _coordinate.ViewToWorld(_points[]);
var p3 = _coordinate.ViewToWorld(_points[]);
_width = 0.5 * _calculationFomula.Distance(p1, p3);
_height = _calculationFomula.Distance(p, p2);
_resultItems[].Result = _width > _height ? * _width : * _height;//椭圆长轴长
_resultItems[].Result = _width < _height ? * _width : * _height; //椭圆短轴长 //椭圆周长
_resultItems[].Result = _calculationFomula.EllipseCirculation(_resultItems[].Result, _resultItems[].Result);
//椭圆面积
_resultItems[].Result = _calculationFomula.EllipseArea(_resultItems[].Result, _resultItems[].Result);
} /// <summary>
/// 功能键、旋钮处理
/// </summary>
/// <param name="eventArgs"></param>
public void KeyBoardEventHandle(KeyBoardEventArgs eventArgs)
{ } private MousePointEvent _mousePointEvent;
private bool _isInViewRegion;
private double _distance; //获取鼠标坐标
private Point _mousePoint;
private PointD _mousePointInView;
public void MouseEventHandle(object sender, MouseEventArgs eventArgs)
{
_mousePoint = eventArgs.Location;
if (_coordinate != null)
{
_mousePointInView = _coordinate.DisplayToView(_mousePoint);
_isInViewRegion = _coordinate.ViewRegionD.Contains(_mousePointInView);
_distance = _calculationFomula.Distance(_coordinate.ViewToWorld(_mousePoint),
_coordinate.ViewToWorld(_coordinate.CenterPointD));
}
_mousePointEvent = new MousePointEvent(_distance, _isInViewRegion);
_eventAggregator.GetEvent<PubSubEvent<MousePointEvent>>().Publish(_mousePointEvent); if (eventArgs.Button == MouseButtons.Left && eventArgs.Clicks == )
{
MouseClick();
}
} //响应按键,收集坐标,commit后结果值在结果窗口中显示出来
public void MouseClick()
{
if (_points.Count == && _measurement.AutoNext == false)
{
return;
}
if (_points.Count >= )
{
_points.Clear();
_points.Add(_mousePoint);
}
else
{
_points.Add(_mousePoint);
}
if (_points.Count == )
{
//if (_measurement.AutoNext == false)
//{
// return;
//}
CaculateResult(); for (_resultIndex = _resultItems.Count - ; _resultIndex >= ; _resultIndex--)
{
_eventAggregator.GetEvent<MeasureToolEvent>()
.Publish(new MeasureEventArgs(MessureEventType.MessureToolCommit,
_resultItems[_resultIndex].Clone()));
}
}
NotifyPropertyChanged(OperateState.MeasureRepaint);
} bool _isCalc;
private void EventHandle(string e) //重绘,显示结果等事件处理
{
switch (e)
{
case EventNames.MeasureToolpaint:
NotifyPropertyChanged(OperateState.MeasureRepaint);
break;
case EventNames.MeasureToolRepaint:
_points.Clear();
NotifyPropertyChanged(OperateState.MeasureRepaint);
break;
case EventNames.MeasureToolCalcResult:
MeasureToolType measuretooltype = _configService.GetMeasureToolId(_measureData.ToolId).MeasureToolType;
if (_measurement.AutoCaculate == false && _isCalc == false && _points.Count == && measuretooltype == _measuretooltype)
{
_isCalc = true;
CaculateResult();
for (_resultIndex = _resultItems.Count - ; _resultIndex >= ; _resultIndex--)
{
_eventAggregator.GetEvent<MeasureToolEvent>()
.Publish(new MeasureEventArgs(MessureEventType.MessureToolCommit, _resultItems[_resultIndex].Clone()));
}
}
break;
case EventNames.MeasureToolNextPaint:
if (_measurement.AutoNext == false)
{
_points.Clear();
_isCalc = false;
}
NotifyPropertyChanged(OperateState.MeasureRepaint);
break;
}
}
}
}
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using app.Configuration.Models;
using app.Configuration.Services;
using app.Lib;
using app.Lib.Graph;
using app.Measure.Events;
using app.Measure.Models;
using app.Measure.ViewModels;
using app.Measure.Actions;
using Bedrock.Events;
using Microsoft.Practices.Unity;
using System.Drawing.Drawing2D;
using app.Main;
using app.Main.Graph;
using app.KeyBoards.Events;
using app.Main.ViewModels; namespace app.Measure.Tools
{
//轨迹/区域测量工具
public class _2DTrace : PropertyChangedBase,IToolAction
{
private readonly IEventAggregator _eventAggregator;
private readonly IConfigService _configService;
private readonly MeasureData _measureData; //存放绘图工具的ID private List<Point> _points; //轨迹/区域的坐标集
private List<List<Point>> _tempPoints;
private readonly MeasureTool _tool; //绘图工具的配置信息
private readonly Measurement _measurement; //该测量环境的XML配置
private readonly Font _textFont; //文本格式对象
private readonly Brush _textBrush; //绘制文本的对象
private ICoordinate _coordinate; //坐标系对象
private readonly List<MeasureResultItem> _resultItems; //存放测量值的列表
private readonly CalculationFomula _calculationFomula; // 计算公式
private readonly MeasureToolType _measuretooltype; private readonly SystemStateModel _systemStateModel;
private readonly string[] _promptString = { "Place the first point of the closed trace", "Trace the area boundary" }; //读取工具XML的配置,初始化绘图工具
public _2DTrace(IUnityContainer unityContainer, IEventAggregator eventAggregator)
{
Logger.Log("_2DTrace Start Initial", Level.Info);
var unityContainer1 = unityContainer;
_eventAggregator = eventAggregator;
_configService = unityContainer1.Resolve<IConfigService>();
_measureData = unityContainer1.Resolve<MeasureData>();
_systemStateModel = unityContainer1.Resolve<SystemStateModel>();
_coordinate = MeasureAction.GetCoordinate(); _resultItems = new List<MeasureResultItem>
{
new MeasureResultItem("TCir", "mm", ),
new MeasureResultItem("TArea", "mm2", )
}; _calculationFomula = new CalculationFomula();
_points = new List<Point>();
_tempPoints = new List<List<Point>>();
if (_measureData.IsGenericTool == false)
{
_measurement = _configService.GetMeasurementId(_measureData.MeasurementId);
_tool = _configService.GetMeasureToolId(_measureData.ToolId);
}
else
{
_measurement = _configService.GetMeasurementId(_measureData.GenericToolItem[_measureData.GenericToolIndex].MeasurementId);
_tool = _configService.GetMeasureToolId(_measureData.GenericToolItem[_measureData.GenericToolIndex].ToolId);
}
_measuretooltype = _tool.MeasureToolType;
_textFont = new Font("Consolas", 10.5F, FontStyle.Bold, GraphicsUnit.Point, );
_textBrush = new SolidBrush(Common.IntToColor(_tool.ColorOfLine));
_eventAggregator.GetEvent<PubSubEvent<string>>().Subscribe(EventHandle, true); if (_measureData.GetToolPositionDataItem == null)
{
var toolDataList = new List<ToolPositionDataItem>();
_measureData.GetToolPositionDataItem = toolDataList;
}
if (_measureData.GetMeasureResultData == null)
{
var toolDataList = new List<MeasureResultData>();
_measureData.GetMeasureResultData = toolDataList;
} _pen = new Pen(Color.Green, _tool.WidthOfLine) {DashStyle = DashStyle.Dash};
Logger.Log("_2DTrace End Initial", Level.Info);
} private ToolPositionDataItem _toolPositionDataItem;
private List<Point> _fillEllipse;
private List<DrawCurvePoint> _drawCurve; private readonly Pen _pen;//旋钮旋转重绘的颜色
private bool _isRotatebuttonRepaintFirstTime = true;//旋钮旋转重绘,该情况下是否第一次调用Draw函数 //绘图
public void Draw(Graphics graphics, ICoordinate coordinate)
{
if (coordinate != null)
{
_coordinate = coordinate;
}
else
{
return;
} if (false == _measureData.IsRotatingButtonRePaint)
{
ToolDraw.DrawFromToolData(graphics, coordinate, _measureData.GetToolPositionDataItem, _currentsender); switch (_keynum%)
{
case :
if (_isInViewRegion)
{
MeasureAction.Cursortype = CursorType.CursorAreaPicture;
}
break;
case :
if (_isInViewRegion == false)
{
UserControl temp = _measureData.MouseEventSender as UserControl;
if (null != temp)
Cursor.Clip = temp.RectangleToScreen(Rectangle.Round(_coordinate.DisplayRegion));
}
else
{
MeasureAction.Cursortype = CursorType.CursorPicture;
}
break;
default:
MeasureAction.Cursortype = MeasureAction.AutoNextMeasure == false ? CursorType.CursorEmptyPicture : CursorType.CursorAreaPicture;
break;
}
}
else
{
if (_isInViewRegion == false)
{
UserControl temp = _measureData.MouseEventSender as UserControl;
if (null != temp)
Cursor.Clip = temp.RectangleToScreen(Rectangle.Round(_coordinate.DisplayRegion));
}
MeasureAction.Cursortype = CursorType.CursorPicture; _isRotatebuttonRepaintFirstTime = _measureData.IsFirsttimeRotatePaint; _tempPoints.Clear();
ToolDraw.RotateRepaintFromToolData(graphics, coordinate, _measureData.GetToolPositionDataItem,
_measureData.RotatingButtonSelectedPointNum, _measureData.RotatingButtonSelectedIndex, ref _tempPoints,
_mousePoint, _pen, _isRotatebuttonRepaintFirstTime, _isInViewRegion, _measureData.MouseEventSender);
_measureData.IsFirsttimeRotatePaint = false;
_points = _tempPoints[];
}
} //计算结果
private void CaculateResult()
{
if (_coordinate == null)
{
return;
}
var pointds = new List<PointD>();
pointds.Clear();
for (var i = ; i < _points.Count - ; i++)
{
var p1 = _coordinate.ViewToWorld(_points[i]);
pointds.Add(p1);
}
//trace的周长计算
_resultItems[].Result = _calculationFomula.TraceCirculation(pointds);
//trace的面积
_resultItems[].Result = _calculationFomula.TraceArea(pointds);
} /// <summary>
/// 功能键、旋钮处理
/// </summary>
/// <param name="eventArgs"></param>
public void KeyBoardEventHandle(KeyBoardEventArgs eventArgs)
{ } private MousePointEvent _mousePointEvent;
private bool _isInViewRegion;
private double _distance;
private object _currentsender; //获取鼠标坐标
private Point _mousePoint;
private PointD _mousePointInView;
public void MouseEventHandle(object sender, MouseEventArgs eventArgs)
{
_currentsender = sender;
_measureData.MouseEventSender = sender;
_mousePoint = eventArgs.Location;
if (_coordinate != null)
{
_mousePointInView = _coordinate.DisplayToView(_mousePoint);
_isInViewRegion = _coordinate.ViewRegionD.Contains(_mousePointInView);
_distance = _calculationFomula.Distance(_coordinate.ViewToWorld(_mousePoint),
_coordinate.ViewToWorld(_coordinate.CenterPointD));
} if (_keynum % == )
{
if (_isInViewRegion)
{
if (_points.Count > )
{
double angle = _calculationFomula.AngleOfPoint(_mousePoint, _points[_points.Count - ],
_points[_points.Count - ]);
double distance = _calculationFomula.Distance(_mousePoint, _points[_points.Count - ]);
if (distance > && angle >= )
{
_points.Add(_mousePoint);
//ToolDraw.SetCursorPositon(_mousePoint, sender);
}
else if (distance > && angle < )
{
_points.Remove(_points[_points.Count - ]);
//ToolDraw.SetCursorPositon(_points[_points.Count - 1], sender);
}
}
else
{
_points.Add(_mousePoint);
} if (false == _measureData.IsRotatingButtonRePaint)
{
AddDataItem(_points);
}
} NotifyPropertyChanged(OperateState.MeasureRepaint);
} if (_isInViewRegion)
{
switch (_keynum%)
{
case :
if (_systemStateModel.HintText != _promptString[])
_systemStateModel.HintText = _promptString[];
break;
case :
if (_systemStateModel.HintText != _promptString[])
_systemStateModel.HintText = _promptString[];
break;
default:
if (_systemStateModel.HintText != "")
_systemStateModel.HintText = "";
break;
}
}
else
{
MeasureAction.Cursortype = CursorType.Max;
if (_systemStateModel.HintText != "")
_systemStateModel.HintText = "";
} _mousePointEvent = new MousePointEvent(_distance, _isInViewRegion) {MeasureResultItem = {Name = "Area"}};
NotifyPropertyChanged(OperateState.MeasureRepaint);
_eventAggregator.GetEvent<PubSubEvent<MousePointEvent>>().Publish(_mousePointEvent); if (eventArgs.Button == MouseButtons.Left && eventArgs.Clicks == && _isInViewRegion)
{
if (_measureData.IsRotatingButtonRePaint)
{
Cursor.Clip = Rectangle.Empty;
CaculateResult(); var temp = new MeasureResultData {Name = _measuretooltype.ToString()};
foreach (var t in _resultItems)
{
temp.MeasureResultItem.Add(t.Clone() as MeasureResultItem);
}
_measureData.GetMeasureResultData.Add(temp); _eventAggregator.GetEvent<MeasureToolEvent>()
.Publish(new MeasureEventArgs(MessureEventType.MessureToolCommit, _resultItems[].Clone()));
}
else
{
MouseClick();
}
_measureData.IsRotatingButtonRePaint = false;
}
} private void AddDataItem(List<Point> points)
{
if (_fillEllipse.Count > )
{
_fillEllipse.Remove(_fillEllipse[]);
}
_fillEllipse.Add(points[]); DrawCurvePoint point1 = new DrawCurvePoint();
foreach (Point point in points)
{
point1.CurvePoint.Add(point);
} if (_drawCurve.Count > )
{
_drawCurve.Remove(_drawCurve[]);
}
_drawCurve.Add(point1); if (_measureData.GetToolPositionDataItem.Count > _measureData.MaxMeasureTimes)
{
_measureData.GetToolPositionDataItem.Remove(_measureData.GetToolPositionDataItem[]);
}
} //响应按键,收集坐标,commit后结果值在结果窗口中显示出来
int _keynum; //记录按键次数
public void MouseClick()
{
//if (keynum != 0 && keynum % 3 == 2 && _measurement.AutoNext == false)
if (_keynum != && _keynum % == && MeasureAction.AutoNextMeasure == false)
{
return;
}
_keynum++;
switch (_keynum % )
{
case :
_points.Clear();
_fillEllipse = new List<Point>();
_drawCurve = new List<DrawCurvePoint>();
_toolPositionDataItem = new ToolPositionDataItem(_drawCurve, _fillEllipse)
{
ColorOfLine = _tool.ColorOfLine,
ColorOfPlot = _tool.ColorOfPlot,
WidthOfLine = _tool.WidthOfLine,
WidthOfPlot = _tool.WidthOfPlot,
Dashstype = _tool.Dashstype,
TextBrush = _textBrush,
TextFont = _textFont,
MeasureToolType = _measuretooltype,
ModeType = _measureData.ModelType,
PointNum = ,
ItemNum = _resultItems.Count,
ViewName = (_measureData.MouseEventSender as Control) == null ? "" : ((Control) _measureData.MouseEventSender).Name
};
_measureData.GetToolPositionDataItem.Add(_toolPositionDataItem);
if (_isInViewRegion)
{
_points.Add(_mousePoint); if (false == _measureData.IsRotatingButtonRePaint)
{
AddDataItem(_points);
}
}
break;
case :
if (_drawCurve.Count != )
_drawCurve[].IsFinished = true; if (_measurement.AutoCaculate == false)
{
return;
}
CaculateResult(); var temp = new MeasureResultData {Name = _measuretooltype.ToString()};
foreach (var t in _resultItems)
{
temp.MeasureResultItem.Add(t.Clone() as MeasureResultItem);
}
_measureData.GetMeasureResultData.Add(temp); _eventAggregator.GetEvent<MeasureToolEvent>()
.Publish(new MeasureEventArgs(MessureEventType.MessureToolCommit, _resultItems[].Clone())); _toolPositionDataItem.IsFinished = true;
break;
}
NotifyPropertyChanged(OperateState.MeasureRepaint);
} bool _isCalc;
private void EventHandle(string e) //重绘,显示结果等事件处理
{
switch (e)
{
case EventNames.MeasureToolpaint:
NotifyPropertyChanged(OperateState.MeasureRepaint);
break;
case EventNames.MeasureToolRepaint:
_points.Clear();
_keynum = ;
NotifyPropertyChanged(OperateState.MeasureRepaint);
break;
case EventNames.MeasureToolCalcResult:
var measuretooltype = _configService.GetMeasureToolId(_measureData.ToolId).MeasureToolType;
if (_measurement.AutoCaculate == false && _isCalc == false && _keynum % == && measuretooltype == _measuretooltype)
{
_isCalc = true;
CaculateResult();
for (var i = _resultItems.Count - ; i >= ; i--)
{
_eventAggregator.GetEvent<MeasureToolEvent>()
.Publish(new MeasureEventArgs(MessureEventType.MessureToolCommit, _resultItems[i].Clone()));
}
}
break;
case EventNames.MeasureToolNextPaint:
if (_measurement.AutoNext == false)
{
_keynum = ;
_isCalc = false;
}
NotifyPropertyChanged(OperateState.MeasureRepaint);
break;
}
}
}
}

c# 属性改变的更多相关文章

  1. 借助JavaScript中的Dom属性改变Html中Table边框的颜色

    借助JavaScript中的Dom属性改变Html中Table边框的颜色 -------------------- <html> <head> <title>我是页 ...

  2. WPF——数据绑定及属性改变事件

    一.首先需要封装一下文本框的属性,并且在实体类中添加一个实体类的属性改变函数 public class User : INotifyPropertyChanged //INotifyPropertyC ...

  3. silverlight属性改变事件通知

    工作中遇到silverlight本身没有提供的某些属性改变事件,但又需要在属性改变时得到通知,Google搬运stack overflow,原地址 /// Listen for change of t ...

  4. 使用datasest属性改变样式

    使用datasest属性改变样式 传统做法 对于html中的标签我们可以自定义标签中的属性,例如给input加一个aaa属性 <input type="text" aaa=& ...

  5. localstorage 的属性改变问题

    localstorage 得到的是对象,我们打算改对象的某个属性的值,方法是 通过临时变量对象得到,改变临时变量,然后把临时变量给localstorage的方法 var localS  = windo ...

  6. 通过声明Attribute属性改变不同类的输出效果

    ConsoleApplication--控制台应用程序 首先创建基类: using System; using System.Collections.Generic; using System.Lin ...

  7. 使用CSS3的appearance属性改变元素的外观

    昨天在和同事一起完成项目的时候,我使用了appearance来渲染select,但是在firefox下出现问题,不完美,最后去除了.但还是要学习下这个属性.大家都知道每个浏览器对HTML元素渲染都不一 ...

  8. 通过transform属性改变图片的位置大小等信息

    对UIImageView的位置大小方向的改变可以通过改变其transform属性值实现. 位置改变: var transform = CGAffineTransformMakeTranslation( ...

  9. CSS3的appearance属性--改变元素的外观

    CSS3 appearance 属性 CSS 参考手册 实例 使 div 元素看上去像一个按钮: div { appearance:button; -moz-appearance:button; /* ...

  10. C#自定义事件:属性改变引发事件示例

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Cons ...

随机推荐

  1. .net core下简单构建高可用服务集群

    一说到集群服务相信对普通开发者来说肯定想到很复杂的事情,如zeekeeper ,反向代理服务网关等一系列的搭建和配置等等:总得来说需要有一定经验和规划的团队才能应用起来.在这文章里你能看到在.net ...

  2. .net core 使用IIS作为宿主Web服务器,部署常见问题

    ASP.NET Core 使用IIS作为Web服务器,部署在IIS上 所做的步骤部署完毕后,启动网站 出现 An error occurred while starting the applicati ...

  3. 2.4配置的热更新「深入浅出ASP.NET Core系列」

    希望给你3-5分钟的碎片化学习,可能是坐地铁.等公交,积少成多,水滴石穿,谢谢关注. 大家知道通常我们修改网站的配置文件比如,webconfig的时候,网站需要重启才能读取到最新的修改,所谓热更新就是 ...

  4. 搞懂MySQL分区

    一.InnoDB逻辑存储结构 首先要先介绍一下InnoDB逻辑存储结构和区的概念,它的所有数据都被逻辑地存放在表空间,表空间又由段,区,页组成. 段 段就是上图的segment区域,常见的段有数据段. ...

  5. MySQL集群架构:MHA+MySQL-PROXY+LVS实现MySQL集群架构高可用/高性能-技术流ken

    MHA简介 MHA可以自动化实现主服务器故障转移,这样就可以快速将从服务器晋级为主服务器(通常在10-30s),而不影响复制的一致性,不需要花钱买更多的新服务器,不会有性能损耗,容易安装,不必更改现有 ...

  6. javascript小记四则:用JS写一个滚动横条文字,可以根据需要进行修改;

    网页上的一些广告文字,一直会滚动是怎么做到的,今天给大家演示下,非常简单,源码如下(本案例是在.net平台上,但HTML是通用的): <!DOCTYPE html> <html> ...

  7. arcgis api 3.x for js 入门开发系列十五台风轨迹

    前言 关于本篇功能实现用到的 api 涉及类看不懂的,请参照 esri 官网的 arcgis api 3.x for js:esri 官网 api,里面详细的介绍 arcgis api 3.x 各个类 ...

  8. go的生产者-消费者模式

    package main import ( "fmt" "math/rand" "time" ) // 数据生产者 func produce ...

  9. mysql的使用相关问题

    MySQL的使用和密码忘记解决 解决步骤: 1.查看:我的电脑--管理--服务--查看mysql路径---一直到mysql下的bin文件夹     或需转回别的磁盘: G: (C:\Users\Adm ...

  10. Java设计模式视频讲解

    设计模式(JAVA) 视频网址: http://www.qghkt.com/ 设计模式(JAVA)视频地址: https://ke.qq.com/course/318643?tuin=a508ea62 ...