c# 属性改变
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# 属性改变的更多相关文章
- 借助JavaScript中的Dom属性改变Html中Table边框的颜色
借助JavaScript中的Dom属性改变Html中Table边框的颜色 -------------------- <html> <head> <title>我是页 ...
- WPF——数据绑定及属性改变事件
一.首先需要封装一下文本框的属性,并且在实体类中添加一个实体类的属性改变函数 public class User : INotifyPropertyChanged //INotifyPropertyC ...
- silverlight属性改变事件通知
工作中遇到silverlight本身没有提供的某些属性改变事件,但又需要在属性改变时得到通知,Google搬运stack overflow,原地址 /// Listen for change of t ...
- 使用datasest属性改变样式
使用datasest属性改变样式 传统做法 对于html中的标签我们可以自定义标签中的属性,例如给input加一个aaa属性 <input type="text" aaa=& ...
- localstorage 的属性改变问题
localstorage 得到的是对象,我们打算改对象的某个属性的值,方法是 通过临时变量对象得到,改变临时变量,然后把临时变量给localstorage的方法 var localS = windo ...
- 通过声明Attribute属性改变不同类的输出效果
ConsoleApplication--控制台应用程序 首先创建基类: using System; using System.Collections.Generic; using System.Lin ...
- 使用CSS3的appearance属性改变元素的外观
昨天在和同事一起完成项目的时候,我使用了appearance来渲染select,但是在firefox下出现问题,不完美,最后去除了.但还是要学习下这个属性.大家都知道每个浏览器对HTML元素渲染都不一 ...
- 通过transform属性改变图片的位置大小等信息
对UIImageView的位置大小方向的改变可以通过改变其transform属性值实现. 位置改变: var transform = CGAffineTransformMakeTranslation( ...
- CSS3的appearance属性--改变元素的外观
CSS3 appearance 属性 CSS 参考手册 实例 使 div 元素看上去像一个按钮: div { appearance:button; -moz-appearance:button; /* ...
- C#自定义事件:属性改变引发事件示例
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Cons ...
随机推荐
- .NET Core 的缓存篇之MemoryCache
前言 对于缓存我们都已经很熟悉了,缓存分为很多种,浏览器缓存.试图缓存.服务器缓存.数据库缓存等等一些,那今天我们先介绍一下视图缓存和MemoryCache内存缓存的概念和用法: 视图缓存 在老的版本 ...
- SpringBoot整合Netty并使用Protobuf进行数据传输(附工程)
前言 本篇文章主要介绍的是SpringBoot整合Netty以及使用Protobuf进行数据传输的相关内容.Protobuf会简单的介绍下用法,至于Netty在之前的文章中已经简单的介绍过了,这里就不 ...
- java的spi 的简单应用
1.什么是java的spi SPI 全称为 (Service Provider Interface) ,是JDK内置的一种服务提供发现机制. 目前有不少框架用它来做服务的扩展发现, 简单来说,它就是一 ...
- (转载)IQueryable和IEnumerable
第一篇:https://www.cnblogs.com/zgqys1980/p/4047315.html: 第二篇:https://www.cnblogs.com/shenbing/p/5394228 ...
- C#工具:WPF生成图片验证码
1.使用ImageFormatConvertHelper using System; using System.Collections.Generic; using System.Drawing; u ...
- FTP方式部署Azure Web App
创建部署凭据 在仪表盘中创建或重置部署凭据,在凭据中设置用户名和密码. 通过FTP方式打开Web根目录 在本地资源管理器中打开FTP地址(例如:ftp://cnws-prod-sha-001.ftp. ...
- 一个简易的Python爬虫,将爬取到的数据写入txt文档中
代码如下: import requests import re import os #url url = "http://wiki.akbfun48.com/index.php?title= ...
- Head First设计模式读书笔记
阅读指南: 精读一章内容,手工输入一章代码(注1),与书中描述的思想进行印证,实在搞不懂就放过吧.设计模式绝对不会一次就看懂的. 这本书对于理解设计模式很有帮助,就是例子不太符合中国人的思维模式,但是 ...
- Fragment与Fragment相互切换之间的生命周期方法
Fragment 1 切换到 Fragment 2时生命周期变化 1.通过 add hide show 方式来切换 Fragment Fragment1 的生命周期变化为:onCreate().onC ...
- TTL与非门电路分析
TTL与非门(TTL推挽式与非门)是TTL集成逻辑门的一种,主要由三极管和二极管构成.如图(a)所示,它由输入级,中间级,输出级三部分组成.TTL与非门的优点在于输出阻抗低,带负载能力强,工作速度快. ...