虽然只是玩c#,实现了一件奇怪的事情.
这是代码:
class Program
{
static void Main(string[] args)
{
System.Diagnostics.Debug.Write(string.Empty);
typeof(string)
.GetField("Empty", BindingFlags.Static | BindingFlags.Public)
.SetValue(null, "Tolgahan");
Console.WriteLine(string.Empty);
// output : Tolgahan
}
}
Run Code Online (Sandbox Code Playgroud)
为什么反思让我们改变只读字段?
问题是"为什么允许通过反射设置",而不是"如何做",所以它不是重复我可以使用反射更改C#中的私有只读字段吗?.
有没有办法从TextArea组件的htmlText属性中定义的锚调用动作脚本函数.
谢谢
经过艰苦的努力,我的大脑停止服务..(土耳其时间是晚上11点40分)
我正在做轮换工作:
变量:
_cx = horizontal center of rect
_cy = vertical center of rect
_cos = cos value of current angle
_sin = sin value of current angle
to rotating any point in this rect :
function getx(x, y)
{
return _cx + _cos * (x - _cx) - _sin * (y - _cy);
}
function gety(x, y)
{
return _cy + _sin * (x - _cx) + _cos * (y - _cy);
}
Run Code Online (Sandbox Code Playgroud)
我试图在旋转过程之前调整给定矩形的大小以适应原始边界的最大尺寸..我该怎么办?
谢谢你的进步
编辑:Igor Krivokon的解决方案
这个问题由Igor …