Recursive in C#

public partial class _Default : System.Web.UI.Page { List lst = new List(); int mainnode = 0; protected void Page_Load(object sender, EventArgs e) { if(!Page.IsPostBack) RadTreeView1.Nodes.Insert(0, new RadTreeNode(“Table of Content”)); } protected void Button1_Click(object sender, EventArgs e) { updatemainnode(); lst.Add(“end”); gv1.DataSource = lst; gv1.DataBind(); } public void updatemainnode() { for (int i = 0; i 0) …

System tray menu in MAC OS x application

1. Open interface builder create NSMenu from Tools->Library. And create NSMenuItem “Active” and “Quit”. 2. “Active” select “Sent Action” -> “Window Server” and select “deminiature” action. 3. “Quit” select “Sent Action” -> “Application” and select “terminate” action. 4. “Menu” select “Outlet” ->ServerControll (applcation name control) 5. In “ServerController.h” file IBOutlet NSMenu *menu; NSStatusItem *statusItem; NSImage …

ESC handle by AppleScript

tell application “System Events” tell application “TextEdit” to activate tell application “TextEdit” to run keystroke “s” using {command down} key code 53 end tell ——————- tell application “System Events” tell application “TextEdit” to activate tell application “TextEdit” to run keystroke “s” using {command down} key code 53 –esc –key code 36 — enter –key code …

AppleScript in Cocoa Class

//message= TextEdit:f NSString *string = message; // split the text by the : to get an array containing { “AAA”, “BBB” } NSArray *splitText = [string componentsSeparatedByString:@”:”]; // form a new string of the form “BBB AAA” by using the individual entries in the array NSString *cellText = [NSString stringWithFormat:@”%@ %@”, [splitText objectAtIndex:1], [splitText objectAtIndex:0]]; …