摘要: Element to element binding:Data binding一种情况是前台元素与后台data object,第二种是前台元素之间的binding。(ElementSource:第一种拿Source的方法)1: Xaml的binding表达用markup extension,target property一定要是DP。2:我们一般set最基本的两个binding属性,Source property用Path属性(写DT的时候经常省略,并且不要写ElementName或者Source), Source Object 用ElementName属性.3:只写{Binding}表示bi 阅读全文
posted @ 2013-03-18 11:51 若愚Shawn 阅读(331) 评论(0) 推荐(0) 编辑
摘要: Style1:styles是一组setter和trigger的单个object,常被定义为资源使用。用来设置target元素的一组属性。Setter用来决定那个属性需要有那个值。属性必须为DP。2:TargetType可以是任何type,甚至是custom type和derived type。如果TargetType是Button则代表只能应用于<Button>或者任何继承自<Button>的元素,否则抛出异常。(TargetType虽然不强制写,但是指定特定的元素应用style对代码维护有好处)。3:style一般需要TargetType属性来表达应用到的元素的类型。 阅读全文
posted @ 2013-03-11 10:51 若愚Shawn 阅读(237) 评论(0) 推荐(0) 编辑
摘要: ContentControl<Button>,<ScrollViewer>,<Label>,<CheckBox>,<RadioButton>,<ToolTip>1:ContentControl class 有一个类型是object的Content属性,可以是任何东西。eg:button控件的content可以是任何形式的element:(text,text+image, image)和一个ContentTemplate属性可以接收DataTemplate类型的控件。2:ContentControl的Content属性可以隐 阅读全文
posted @ 2013-03-11 03:46 若愚Shawn 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 本章共计51个示例,全都在VS2008下.NET3.5测试通过,点击这里下载: Controls.rar关于在VS2008新建WPF类库时,有Custom Control和User Control两个选择。User Control类库会在工程中建立一个XAML文件及其绑定后台代码,前者以<UserControl开头,后者是一个派生自UserControl的类。Custom Control类库则在工程中创建派生自Control基类的CustomControl1控件,并在构造函数中为CustomControl1指定依赖属性DefaultStyleKeyProperty:Custom Cont 阅读全文
posted @ 2013-03-09 04:57 若愚Shawn 阅读(781) 评论(0) 推荐(0) 编辑
摘要: 1:写xaml的时候写在multiply line里(使用Xaml Styler插件会自动转行)。2:Naming ConventientResources以文件名.key的形式写:InputPageOilSwellResources.DesignNameColumnStyle,若已经在本层的话就不用写文件名了。x:Name应该用'_master'的形式,同coding的private命名resources的时候either是style或者Template写成 DesignNameColumnStyle, DesignNameColumnTemplate,中间没有其他的连字符。 阅读全文
posted @ 2013-03-07 06:54 若愚Shawn 阅读(268) 评论(0) 推荐(0) 编辑
摘要: DOM Core节点操作查找节点:$()插入节点:append(), appendTo(), prepend(),prependTo(),after(), insertAfter(), before(), insertBefore()删除节点:remove(), empty()复制节点:clone()替换节点:replaceWith(), replaceAll()包裹节点:wrapAll(), wrap(),wrapinner()属性操作get/set属性:attr('属性')删除属性:removeAttr()class操作get class:attr('class&# 阅读全文
posted @ 2013-02-14 06:56 若愚Shawn 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 1:选择器一般前面是$(something),$()内部会自动使用loop寻找参数指定的元素Selector type CSS jQuery What it does Tag name p{} $('p') selects all 'p' in the document ID #some-id {} $('#some-id') selects the single element in the document that has as ID of ... 阅读全文
posted @ 2013-02-12 00:10 若愚Shawn 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 3 ways to define a JavaScript classIntroductionJavaScript is a very flexible object-oriented language when it comes to syntax. In this article you can find three ways of defining and instantiating an object. Even if you have already picked your favorite way of doing it, it helps to know some alterna 阅读全文
posted @ 2013-02-08 05:45 若愚Shawn 阅读(357) 评论(0) 推荐(0) 编辑
摘要: ScriptingAre you using the right algorithm? Selecting the right algorithm for a task yields much better optimization than any other code tweaking you might do. Note that the best algorithm is not always the one with the lowest average complexity. For small datasets, it is often better to use a slow 阅读全文
posted @ 2013-02-08 03:23 若愚Shawn 阅读(463) 评论(0) 推荐(0) 编辑
摘要: Unity内部的脚本,是通过附加自定义脚本对象到游戏物体组成的。在脚本对象内部不同的函数被特定的事件调用。最常用的列在下面:Awake: 在MonoBehavior创建后就立刻调用Start: 将在MonoBehavior创建后在该帧Update之前,在该Monobehavior.enabled == true的情况下执行。当MonoBehavior没有定义[ExecuteInEditMode]时 总结:我们尽量将其他Object的reference设置等事情放在Awake处理。然后将这些reference的Object的赋值设置放在Start()中来完成。当MonoBehavior有定义[. 阅读全文
posted @ 2013-02-08 03:14 若愚Shawn 阅读(299) 评论(0) 推荐(0) 编辑
摘要: http://forum.unity3d.com/threads/44911-2-cameras-running-the-same-time1: 2个camera同时显示在一个屏幕里It is certainly possible to have multiple cameras at once. There are a couple things to know that will help with this:- Cameras have a "depth" property. This determines which order the cameras will d 阅读全文
posted @ 2013-02-07 23:49 若愚Shawn 阅读(266) 评论(0) 推荐(0) 编辑
摘要: Unity3D + C#: Cloning the Content of a Serializable ClassFound a pretty simple and neat method for cloning the contents of a serializable class from one to another:http://stackoverflow.com/questions/78536/cloning-objects-in-c-sharpHere's a copy of the script (for Unity use), to make your life ea 阅读全文
posted @ 2013-02-07 23:37 若愚Shawn 阅读(266) 评论(0) 推荐(0) 编辑
摘要: C# Object Clone WarsCloning C# objects is one of those things that appears easy but is actually quite complicated with many "gotchas." This article describes the most common ways to clone a C# object.Shallow vs. Deep CloningThere are two types of object cloning: shallow and deep. A shallow 阅读全文
posted @ 2013-02-07 23:35 若愚Shawn 阅读(1290) 评论(0) 推荐(0) 编辑
摘要: How to make a mini map for your scene in Unity3d This is my first tutorial on Unity, kinda nervous writing it... Anyway have you guys ever play Hitman, Dynasty Warrior, Starcraft or any RTS games? Usually at the bottom left of those games, there's a 2d map showing where the players are and where 阅读全文
posted @ 2013-02-07 23:25 若愚Shawn 阅读(1058) 评论(0) 推荐(0) 编辑
摘要: 水果类(fruits):西红柿tomato菠萝pineapple西瓜watermelon香蕉banana柚子shaddock(pomelo)橙子orange苹果apple柠檬lemon樱桃cherry桃子peach梨pear枣Chinesedate(去核枣pitteddate)椰子coconut草莓strawberry树莓raspberry蓝莓blueberry黑莓blackberry葡萄grape甘蔗sugarcane芒果mango木瓜pawpaw或者papaya杏子 apricot油桃nectarine柿子persimmon石榴pomegranate榴莲jackfruit槟榔果arecan 阅读全文
posted @ 2013-02-06 11:07 若愚Shawn 阅读(628) 评论(0) 推荐(0) 编辑
摘要: position有四种relative, absolute, static(默认), fixed, 其中relative不长用来对block element定位,但是relative和absolute用来标识其contain 的子是按照他们的位置做references的。Relative:1: 一般用法<style> div#outer { position: relative; width: 750px; height: 500px; margin: 0px auto; background-color: #369;... 阅读全文
posted @ 2013-02-05 06:49 若愚Shawn 阅读(304) 评论(0) 推荐(0) 编辑
摘要: Dynamic Texture2D in UnityUICreate Texture2D and assign image to it through a script//需要在最上级Asset folder下建一个Resources folder,然后里面放要dynamic attach的textureusing UnityEngine;using System.Collections;public class TearApartControl : MonoBehaviour { public Texture2D handCursor; // Use this for initi... 阅读全文
posted @ 2013-01-29 06:48 若愚Shawn 阅读(278) 评论(0) 推荐(0) 编辑
摘要: Customise mousehover cursorCustom Mouse CursorMouse over change texture项目中我用的方法using UnityEngine;using System.Collections;public class TearApartControl : MonoBehaviour { public Texture2D handCursor; private bool _hitOBject = false; // Use this for initialization void Start () { { ... 阅读全文
posted @ 2013-01-29 06:44 若愚Shawn 阅读(322) 评论(0) 推荐(0) 编辑
摘要: Get children gameobjects arrayGet references to all gameobjects that are tagged with a particular tag?Sort an ArrayList of game objects...GameObject assetBundle = GameObject.FindGameObjectWithTag("main"); //找到parent gameobjectTransform[] parts = assetBundle.GetComponentsInChildren<Trans 阅读全文
posted @ 2013-01-29 06:38 若愚Shawn 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 使用enum propertyBOM2 项目中需要有一个单独的script控制mode的切换,其他scipt根据这个mode切换到哪一个enum来决定该mode下的一些功能的开启。一开 始我用的是inspector的方法,在enum的script里控制enum选择的值,然后在需要做判断的script里创建一个public变量来接 受enum值的变化。后来我改为完全用类的enum方法实现。//ModeSelector.csusing UnityEngine;using System.Collections; public enum ModeEnum { Assembly... 阅读全文
posted @ 2013-01-29 06:30 若愚Shawn 阅读(373) 评论(0) 推荐(0) 编辑
摘要: 为什么要reset不同的broswer对css属性有不同的初始默认值,如果css里没有overwrite默认的css属性,浏览器使用初始值赋值这些css属性。所以写css之前,我们需要对所有浏览器首先来一次清盘,reset css,以便日后不会出现某明其妙的问题。Common Reset Propertymargin, padding, border, font-size- line-heightHow to reset in CSS注意一定要放在css文本的最前面,It's important these styles are the first styles your browse 阅读全文
posted @ 2013-01-21 04:52 若愚Shawn 阅读(328) 评论(0) 推荐(0) 编辑
摘要: 预备知识CDN-hosted & FontSquirrelfontsquirrel如何设置font-faceWeb Fonts的知识项目总结:在实际项目中置入MyriadPro Cond字体。这里可以下载到convert好的MyriadPro字体。1:Good structure for the saved fonts:最好把调用font-face的css和字体放在同一个文件夹下: 或者 2:检查调用字体的css里是否有写font-face@charset "UTF-8";@font-face { font-family: 'MyriadPro Cond&# 阅读全文
posted @ 2013-01-19 00:57 若愚Shawn 阅读(333) 评论(0) 推荐(0) 编辑
摘要: 官方文档在这里用的是params加new UnityObject2({ params: params })的方法。BOM2项目中我一度怎么调试customize prograss bar都不出。后来找到原因是我用的另外一个结构(config包含params的方法),本该是params的参数写到了config里了。网页中<script>里正确设置参数的方法:var config = { width : 960, height : 370, params : { disableContextMenu : true, disableFullscreen ... 阅读全文
posted @ 2013-01-13 13:30 若愚Shawn 阅读(541) 评论(0) 推荐(0) 编辑
摘要: 制作Unity3d的prograss bar:Unity3d在网页下有2种prograss bar:,初次打开unity时的plugin bar(少于1秒,可以简单的custmize 背景颜色和bar的样式)和之后自己可以加入的换场景bar(自己可以选择任意样式的bar),burgzerg网站有视频实例。以下例子是开始的时候loading unity plugin和第一个场景(空场景带一个button),如果build时选的streamed,load完第一个空场景,会继续在后面loading 队列里的其他level。如果没有选择streamed则直接loading完第一个场景后等待用户clic 阅读全文
posted @ 2013-01-12 03:13 若愚Shawn 阅读(330) 评论(0) 推荐(0) 编辑
摘要: Event:(Unity3d中的event是用来取代SendMessage机制的)c#的event定义,1:首先需要一个delegate,相当于事件的响应,c#自带了一个EventHandler,接受sender这个object,以及事件参数EventArgs(c#自带的事件参数类型)。你也可以自己写delegate,传自己想传的参数,无需用c#自带的EventHandler和EventArgs。1 public delegate void MyEventHandler(Event evt); 2:其次需要定义一个event,并将事件与你定义的delegate绑定。1 public even. 阅读全文
posted @ 2013-01-02 07:26 若愚Shawn 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 脚本概览Unity内部的脚本,是通过附加自定义脚本对象到游戏物体组成的。在脚本对象内部不同的函数被特定的事件调用。最常用的列在下面:Update:这个函数在渲染第一帧之前被调用,这里是大部分游戏行为代码被执行的地方,除了物理代码。FixedUpdate:这个函数在每个物理时间被调用一次,这是处理基于物理游戏的地方。在任何函数之外的代码在物体被加载的时候运行,这个可以用来初始化脚本状态。你也能定义事件句柄,它们的名称都以On开始,(例如OnCollisionEnter)。常用操作大多数游戏物体的操作是通过游戏物体的Transform或Rigidbody来做的,在行为脚本内部它们可以分别通过tra 阅读全文
posted @ 2013-01-02 06:29 若愚Shawn 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 转载:http://blog.csdn.net/jjiss318/article/details/7441824Unity3D博客http://www.dapp.com.br/byDapphttp://www.m2h.nl/unity/byM2Hhttp://www.everyday3d.com/blog/byBartekdrozdzhttp://www.untoldentertainment.com/blog/category/blog/http://unity3dstore.com/byunity3dstorehttp://thecodebook.wordpress.com/bytheco 阅读全文
posted @ 2013-01-02 05:58 若愚Shawn 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 协同的理解http://blog.163.com/hj_0467/blog/static/74252563201011711845180/http://wg2009perfect.blog.163.com/blog/static/127997663201211111222126/摘要下:1.coroutine, 中文翻译“协程”。这个概念可能有点冷门,不过百度之,说是一种很古老的编程模型了,以前的操作系统里进程调度里用到过,现在操作系统的进程调度都是根据 时间片和优先级来进行轮换,以前是要程序自己来释放cpu的控制权,一直不释放一直也就占用着cpu,这种要求程序自己来进行调度的编程模型应该就叫 阅读全文
posted @ 2013-01-01 13:16 若愚Shawn 阅读(3506) 评论(2) 推荐(1) 编辑
摘要: About these tipsThese tips are not all applicable to every project.They are based on my experience with projects with small teams from 3 to 20 people.There’s is a price for structure, re-usability, clarity, and so on — team size and project size determine whether that price should be paid.Many tips 阅读全文
posted @ 2013-01-01 01:53 若愚Shawn 阅读(461) 评论(0) 推荐(0) 编辑
摘要: 初识枚举 1、枚举其实可以理解为一个恒量的结合,又或者可以认为它是一种类型。比如以下枚举定义:1 publicenum MicrosoftTechnology2 {3 CSharp,4 ASPNETMVC,5 SQLServer,6 WCF,7 SilverLight,8 }此枚举默认为int型,当然我们可以根据需要指定枚举的数据类型。比如 public enum MicrosoftTechnology: long{....} 等。MicrosoftTechnology枚举int值分别为 Csharp:0;ASPNETMVC:1;SQLServer:2;WCF:3;Silv... 阅读全文
posted @ 2012-12-30 14:51 若愚Shawn 阅读(1167) 评论(0) 推荐(0) 编辑
摘要: 一位台湾码农的心路历程作者: superbcde来源: tech2ipo.com发布时间: 2012-12-22 23:00阅读: 4226 次推荐: 24 原文链接 [收藏]前言:台湾的 IT 环境是什么样的,我们很少关注过。本文作者 superbcde 是一位台湾程序员,他没有显赫的教育背景,从 IT 培训学校开始,一步一步走向自己的奋斗目标。他告诫年轻人:要趁着年轻多学习,下定决心,自己不懂什么学什么,最好到硅谷去,因为那里才是 IT 人士的天堂,并透露了台湾的创业环境比较差。本文最初来自 PTT 论坛,INDIDE 做了二次整理,原标题:软体人的心路历程分享,TECH2IPO 稍作修改 阅读全文
posted @ 2012-12-27 05:38 若愚Shawn 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 理解boxinner content width: border + padding + width(如果没有margin在的情况下inner content超过outer container的时候,会sacrifice outter padding, 用overflow控制)inner containner width: margin + border + padding + width(如果当有margin在的情况下inner containner超过outer container的时候,会sacrifice inner magrin, 用overflow控制)verticle margi 阅读全文
posted @ 2012-12-22 04:32 若愚Shawn 阅读(443) 评论(0) 推荐(0) 编辑
摘要: Fundamentals of HTML<head>:html tag的第一大项,里面用来放<meta><title><link><script><style>等向浏览器描述文件用。<head> <meta charset="UTF-8" /> <title> HTML Meta Information </title> <link rel="stylesheet" type="text/css" href=& 阅读全文
posted @ 2012-12-09 10:41 若愚Shawn 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Char ArrayChar Array储存string data。有两个方法建立StringBuilder和Character array【Character array】用来存储character data,比如字母和数字好处:array element被储存在内存中的一块,避免了存储于分开的对象所带来的内存消耗。Char是基本的变量类型,她不是存储reference而是存储在内存本身。建立char array:using System;class Program{ static void Main() { char[] array1 = { 's', 'a' 阅读全文
posted @ 2012-11-30 23:26 若愚Shawn 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 今天记录一下前端项目中使用DataTemplateSelector的步骤。首先看项目目录:这里有一个FiledType.cs文件,还有一个RefineSearch.xaml以及其后台程序。FiledType.cs里是关于要使用的类的属性的定义,里面有一个类的构造,这里可以看到FiledType的类的构造函数,里面的参数是我们后面要做的ComboBox里面items类型所有的属性。即ComboBox里每一项都是一个复杂的FiledType类型,而且里面包含如下这些属性信息。FieldType(int sortOrder, string readableName, string internalN 阅读全文
posted @ 2012-11-26 22:59 若愚Shawn 阅读(340) 评论(0) 推荐(0) 编辑
摘要: 同一个对象(特指System.Windows.DependencyObject的子类)的同一种属性(特指DependencyProperty)只能拥有一个binding。这一点可以通过设置binding对象的方法名得知:public static BindingExpressionBase SetBinding( DependencyObject target, DependencyProperty dp, BindingBase binding)方法名是SetBinding而不是AddBinding。如果想要验证一下,也可以在listView1_SelectionChanged事件方法中增加 阅读全文
posted @ 2012-11-15 12:28 若愚Shawn 阅读(383) 评论(0) 推荐(0) 编辑
摘要: WPF基础知识快速学习绝不是从零学起的,良好的基础是快速入手的关键,下面先为大家摞列以下自己总结的学习WPF的几点基础知识:1)C#基础语法知识(或者其他.NET支持的语言):这个是当然的了,虽然WPF是XAML配置的,但是总还是要写代码的,相信各位读者应该也都有这个基础了。2)HTML语言:虽然WPF是窗体程序但是由于使用的XAML语言,如果以前接触过HTML、XHTML、ASP.NET之路的东西的话会,接受这些标签会很有帮助的,如果以前一直是从事win form开的人来说可能就要适应一下了。3)对C#中的代理、事件要做到熟练掌握,在.NET 3.0 版本后有增加了Routed Events 阅读全文
posted @ 2012-11-15 12:26 若愚Shawn 阅读(1657) 评论(0) 推荐(0) 编辑
摘要: 商学院启示:什么样的人适合读EMBA启示1: 对于读EMBA的目的,非管理科班出生的管理者来总结过去,全面系统地学习理论知识就记者采访的EMBA学生来看,绝大多数都不是管理科班出身,而是从技术层开始做起,一步步走上领导岗位,他们的管理经验,是凭借自己的悟性和自学,在长期的实践工作中积累起来的。面对日趋激烈的市场竞争,这些经验显得不够。所以,回炉成了必要。启示2: 选择EMBA看师资,关键是学员不是来学语言的各个学校宣传EMBA时,师资是非常重要的一方面,而国际化是用来形容师资优秀最常用的一个词。那么是不是老外越多,就是国际化程度越高,学员学习的效果就越好呢? 学员们的想法并不尽然。接受采访的学 阅读全文
posted @ 2012-11-14 13:48 若愚Shawn 阅读(418) 评论(0) 推荐(0) 编辑
摘要: 帮忙Steve写有关数据库的程序,需要一个AdvancedSearch的功能,使用xaml和C#实现ComboBox的数据录入AdvancedSearch.xaml: 1 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 阅读全文
posted @ 2012-11-14 13:46 若愚Shawn 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 程序员干到30岁,好不容易从码奴混到了白领,却再也干不动了,还时时面临失业的危险。30岁,是一个程序员伤不起的年龄。明天,何去何从? 一.30岁现象 在官场上,曾经有一个59岁现象,就是官员们会在59岁时,会使劲捞上一把。很明显嘛,权力过期作废,再不捞就要退休了,没有机会了。 在程序员的圈子里,也有一个30岁现象。当然,如果你有铁饭碗,比如在国企或政府机关,那你是无法理解底层劳动人民的感受的。同时也要恭喜你成为体制内的一员,可以一直干到退休无忧。 30岁现象人人都明白,但要给出一个定义并不容易。列举几个表现,也许你会觉得心有戚戚焉。 " 面临职业瓶颈,程序写不动,上升又困难。 ... 阅读全文
posted @ 2012-11-10 16:10 若愚Shawn 阅读(336) 评论(0) 推荐(0) 编辑