// Use this for initialization void Start() { instance = this; playerInstance = (GameObject)Instantiate( player,new Vector3(0f,0f,0f),Quaternion.identity ); playerInstance.transform.parent = playerRoot.transform; }
void Awake() { if (clearPrefs) { PlayerPrefs.SetString("hasUsed", ""); } if (!firstStart) { firstStart = true; Instance = this; ingredientsManager = new IngredientsManager(myIngredientsGrid); favoriteRecipes = new List<string>(); Debug.Log(PlayerPrefs.GetString("favorites")); favorites = PlayerPrefs.GetString("favorites").Split(','); foreach (string s in favorites) { if (s != "") { favoriteRecipes.Add(s); string[] vals = s.Replace("{", "").Replace("}","").Split(';'); favoritesPanel.Instance.drawFavorite(vals[1],vals[0],vals[2]); } } loadCategories(); } if (PlayerPrefs.GetString("hasUsed") == "") { tutorialPanel.SetActive(true); } PlayerPrefs.SetString("hasUsed", "hasUsed"); }
void Awake() { main_ref = this; DontDestroyOnLoad(transform.gameObject); controler_game = new controler_game(this); // }
public Form1(main newPrevWin, int did) { InitializeComponent(); //radioButton1.Click(); deck_id = did; radioButton1.Checked = true; prevWin = newPrevWin; //to return to main menu after done quizzing }
/// <summary> /// 吸附窗体 /// </summary> /// <param name="frm">要吸附的窗体</param> /// <param name="timer">计时器对象</param> public FromHide(main frm) { timer1 = new Timer(); this.frm1 = frm; //this.timer1 = timer; this.frm1.LocationChanged += new EventHandler(frm1_LocationChanged); this.frm1.TopMost = false; this.timer1.Enabled = true; this.timer1.Interval = 100; this.timer1.Tick += new EventHandler(timer1_Tick); this.timer1.Start(); }
public void WriteData(main data) { String line = null; int width, height; StreamWriter wr = new StreamWriter(File.Open(data.FileName, FileMode.Append)); if (!data.IsFromFile) { wr.Close(); wr = new StreamWriter(File.Open(data.FileName, FileMode.Create)); } if (!data.IsFromFile) //zapisz dane wejœciowe { wr.WriteLine("##"); wr.WriteLine(engine.DataInfo); wr.WriteLine("##"); foreach (Rectangle rect in engine.Rectangles) { line = rect.Width + "," + rect.Height; wr.WriteLine(line); } wr.WriteLine("##"); } //zapisz rowi¹zania, które nie sa z pliku foreach (Solution solution in data.Solutions) { if (solution.IsFromFile) continue; line = "#" + solution.Tag; wr.WriteLine(line); foreach (PartOfSolution part in solution.PartsOfSolution) { line = ""; width = part.Xrd - part.Xlu; height = part.Yrd - part.Ylu; line += part.Xlu + "," + part.Ylu + ","; //wersja 1 //line += part.Xrd + "," + part.Yrd; //wersja 2 line += width + "," + height; wr.WriteLine(line); } } wr.Close(); data.IsFromFile = true; }
public LayoutEditor(main newPrevWindow, eFlash.Data.Deck newDeck, bool makeCopy) { InitializeComponent(); prevWindow = newPrevWindow; if (makeCopy) { deck = deepCopy(newDeck); } else { deck = newDeck; } initialize(); }
public controler_game(main main_Ref) { main_ref = main_Ref; _modele_game_ref = new modele_game(); bt = Resources.Load("bt") as GUISkin; txt = Resources.Load("txt") as GUISkin; HowTo = Resources.Load("prefabs/HowTo") as GameObject; HowTo2 = Resources.Load("prefabs/HowTo2") as GameObject; Credit = Resources.Load("prefabs/Credits") as GameObject; PochMenu = Resources.Load("prefabs/Menu") as GameObject; bar1 = Resources.Load("prefabs/graph1") as GameObject; bar2 = Resources.Load("prefabs/graph2") as GameObject; meter = Resources.Load("prefabs/meter") as GameObject; instanceMenu = (GameObject)Object.Instantiate(PochMenu); }
// Start is called before the first frame update void Start() { script = GameObject.Find("Script").GetComponent <main>(); }
void Awake() { _m = this; }
// Use this for initialization void Start() { mainSelected = GameObject.Find ("QUAD").GetComponent<main> (); coffeeThings = GameObject.Find ("playerDot").GetComponent<Coffee> (); epochStart = new System.DateTime(1970, 1, 1, 0, 0, 0, System.DateTimeKind.Utc); }
public addEmailToListSend(main mainForm) { this.mainForm = mainForm; this.Owner = mainForm; InitializeComponent(); }
// Use this for initialization void Start() { nCurs = GetComponent <Curs>(); nCam = GameObject.FindObjectOfType(typeof(cam)) as cam; nMain = GameObject.FindObjectOfType(typeof(main)) as main; }
// Start is called before the first frame update void Start() { script = GameObject.Find("Script").GetComponent <main>(); StartCoroutine(spawner()); }
public WeatherInfo() { this.Weather = new List<weather>(); this.Main = new main(); }
public static void DoCommandLine(string[] args, main win) { //process command line args int i; string str; bool normalLoad = false; str = args[0]; if (str.IndexOf("-a") == -1) { normalLoad = true; } for (i=0; i<args.Length; i++) { str = args[i]; if (normalLoad == false) { if (File.Exists(str)) { bool doItFound = false; Load(str, win); if (normalLoad == false) { foreach(ListViewItem lvi in win.methodBox.Items) { if (lvi.Text == "Do_It") { //move Do_It method to export list ListViewItem export = new ListViewItem(lvi.Text); if (win.exportsType.SelectedIndex == 0) export.SubItems.Add("Cdecl"); else export.SubItems.Add("StdCall"); export.SubItems.Add(lvi.Text); export.SubItems.Add(lvi.SubItems[1].Text); win.exportBox.Items.Add(export); lvi.Remove(); doItFound = true; } } if (doItFound == false) { //Do_It mehod not in dll MessageBox.Show("Do_It method not found!", "dll_tool", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { //save dll as str.new dll.Save(str + ".new", win, true); } } } else { if (str != "-a") MessageBox.Show("*" + str + "*" + "\n\nFile not Found", "dll_tool", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } if (normalLoad == true) { win.Show(); } else { Application.Exit(); } }
public static void DoExe(BinaryWriter bwOut, FileStream fsIn, BinaryReader brIn, main win) { //write out the new exe with net dll swapped FileStream fsExt; BinaryReader brExt; long currPos; //find size of exe header //skip dos stub fsIn.Seek(60, SeekOrigin.Begin); int e_lfanew = brIn.ReadInt32(); //MessageBox.Show(e_lfanew.ToString()); fsIn.Seek(e_lfanew + 4, SeekOrigin.Begin); //IMAGE_FILE_HEADER fsIn.Seek(2, SeekOrigin.Current); int NumberOfSections = brIn.ReadInt16(); fsIn.Seek(16, SeekOrigin.Current); //end of IMAGE_FILE_HEADER //IMAGE_OPTIONAL_HEADER fsIn.Seek(224, SeekOrigin.Current); //end of IMAGE_OPTIONAL_HEADER //section directories int Size = 0; // size of section int Pos = 0; // position of section for (int i=0; i<NumberOfSections; i++) { fsIn.Seek(16, SeekOrigin.Current); Size = brIn.ReadInt32(); Pos = brIn.ReadInt32(); fsIn.Seek(16, SeekOrigin.Current); } //end of section directories fsIn.Seek(Pos+Size, SeekOrigin.Begin); currPos = fsIn.Position; //write exe section fsIn.Seek(0, SeekOrigin.Begin); bwOut.Write(brIn.ReadBytes((int)currPos)); win.log.Items.Add("Wrote exe header"); //write attached files int nameLength = 1; int dataLength; string name; while (nameLength > 0 && nameLength < 50 && fsIn.Position < fsIn.Length) { nameLength = brIn.ReadInt32(); if (nameLength > 0 && nameLength < 50) { name = Encoding.ASCII.GetString(brIn.ReadBytes(nameLength)); dataLength = brIn.ReadInt32(); //write name bwOut.Write(nameLength); bwOut.Write(Encoding.ASCII.GetBytes(name)); if (name == "net_int.dll") { //replace with netDll fsExt = new FileStream(win.netDll + ".new", FileMode.Open); brExt = new BinaryReader(fsExt); //write length bwOut.Write((int) fsExt.Length); //write data bwOut.Write(brExt.ReadBytes((int)fsExt.Length)); //seek over existing dll in exe fsIn.Seek(dataLength, SeekOrigin.Current); brExt.Close(); fsExt.Close(); win.log.Items.Add("Replaced net_int.dll"); } else if (name == "_virtal.dat") { //write displaysettings first bwOut.Write(dataLength); //write display settings bwOut.Write(win.dispMode.SelectedIndex); bwOut.Write(int.Parse(win.dispWidth.Text)); bwOut.Write(int.Parse(win.dispHeight.Text)); bwOut.Write(int.Parse(win.dispDepth.Text)); //seek over settings fsIn.Seek(16, SeekOrigin.Current); //write data bwOut.Write(brIn.ReadBytes(dataLength - 16)); win.log.Items.Add("Wrote _virtual.dat with display settings"); } else { //normal file bwOut.Write(dataLength); bwOut.Write(brIn.ReadBytes(dataLength)); } } } //write extra data fsIn.Seek(-4, SeekOrigin.Current); bwOut.Write(brIn.ReadBytes((int)(fsIn.Length - fsIn.Position))); win.log.Items.Add("wrote extra data"); }
private void Start() { m_main = FindObjectOfType <main> (); Spawn(); }
// Use this for initialization void Start() { mainVar = GameObject.Find ("QUAD").GetComponent<main> (); // audioSource = gameObject.AddComponent<AudioSource> (); // audioSource.clip = Resources.Load ("Audio/8-bit-noise") as AudioClip; }
public static void OldBuild(string FileName, main win) { //build an old style exe. FileStream fsIn = null; BinaryReader brIn = null; FileStream fsOut = null; BinaryWriter bwOut = null; FileStream fsExt = null; BinaryReader brExt = null; bool found; try { fsIn = new FileStream(win.Loaded_ExeName, FileMode.Open); brIn = new BinaryReader(fsIn); File.Copy(Application.StartupPath+"\\expander.dat", FileName, true); fsOut = new FileStream(FileName, FileMode.Append); bwOut = new BinaryWriter(fsOut); //write exe name bwOut.Write(win.Targetexe.Text.Length); bwOut.Write(Encoding.ASCII.GetBytes(win.Targetexe.Text)); //write num of internal files bwOut.Write((byte) win.Intern.Items.Count); //write each internal file to patch foreach (ListViewFileItem itm in win.Intern.Items) { //name bwOut.Write(itm.Text.Length); bwOut.Write(Encoding.ASCII.GetBytes(itm.Text)); //data //check if file is in <exe> or not if (itm.SubItems[1].Text == "<exe>") { //in <exe> fsIn.Seek(itm.Offset, SeekOrigin.Begin); //size bwOut.Write(itm.Size); //data bwOut.Write(brIn.ReadBytes(itm.Size)); } else { //external file //filedata fsExt = new FileStream(itm.SubItems[1].Text,FileMode.Open); brExt = new BinaryReader(fsExt); //size bwOut.Write((int) fsExt.Length); //data bwOut.Write(brExt.ReadBytes((int) fsExt.Length)); brExt.Close(); fsExt.Close(); } } //use md5 checksums? if (win.CheckSum.Checked == true) bwOut.Write((byte) 1); else bwOut.Write((byte) 0); //write num of External files bwOut.Write((byte) win.Extern.Items.Count); string checksum; foreach (ListViewFileItem itm in win.Extern.Items) { //write name bwOut.Write(itm.Text.Length); bwOut.Write(Encoding.ASCII.GetBytes(itm.Text)); //write md5 checksum string if needed if (win.CheckSum.Checked == true) { found = false; if (File.Exists(win.Plugins + itm.Text)) { fsExt = new FileStream(win.Plugins + itm.Text,FileMode.Open); found = true; } if (File.Exists(win.Plugins_user + itm.Text)) { fsExt = new FileStream(win.Plugins_user + itm.Text,FileMode.Open); found = true; } if (File.Exists(win.Effects + itm.Text)) { fsExt = new FileStream(win.Effects + itm.Text,FileMode.Open); found = true; } if (found == true) { //get md5 checksum brExt = new BinaryReader(fsExt); System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider(); byte[] result = md5.ComputeHash(brExt.ReadBytes((int)fsExt.Length)); checksum = BitConverter.ToString(result).Replace("-","").ToLower(); brExt.Close(); fsExt.Close(); //write md5 checksum bwOut.Write(Encoding.ASCII.GetBytes(checksum)); } } } } catch (Exception ex) { MessageBox.Show(ex.ToString(),"Error!",MessageBoxButtons.OK,MessageBoxIcon.Warning); } finally { brIn.Close(); fsIn.Close(); bwOut.Close(); fsOut.Close(); } }
void Init() { d_stage = new Delegate_stage(EnterStage1); d_stage += new Delegate_stage(EnterStage2); _instance = this; _data = new Data(); _mapcreator = new MapCreator(); _bclick = false; _istage_number = 0; Instantiate(_startGameObject); }
// Use this for initialization void Start() { Target = GameObject.Find("/Main"); other = Target.GetComponent<main>(); }
public float playerR = 2; //플레이어가 움직일 반지름 private void Awake() { instance = this; }
// Use this for initialization IEnumerator Start() { // First, check if user has location service enabled mainVar = GameObject.Find ("QUAD").GetComponent<main> (); coffeeThings = GetComponent<Coffee> (); pastCoffeeLocations.Add (21); pastCoffeeLocations.Add (22); pastCoffeeLocations.Add (27); pastCoffeeLocations.Add (24); pastCoffeeLocations.Add (25); epochStart = new System.DateTime(1970, 1, 1, 0, 0, 0, System.DateTimeKind.Utc); if (!Input.location.isEnabledByUser) yield break; // Start service before querying location Input.location.Start(); // Wait until service initializes int maxWait = 20; while (Input.location.status == LocationServiceStatus.Initializing && maxWait > 0) { yield return new WaitForSeconds(1); maxWait--; } // Service didn't initialize in 20 seconds if (maxWait < 1) { // print("Timed out"); yield break; } // Connection has failed if (Input.location.status == LocationServiceStatus.Failed) { // print("Unable to determine device location"); temp = false; yield break; } else { temp = true; // Access granted and location value could be retrieved // latitude = Input.location.lastData.latitude; // longtitude = Input.location.lastData.longitude; // altitude = Input.location.lastData.altitude; // horizontal = Input.location.lastData.horizontalAccuracy; // timestamp = Input.location.lastData.timestamp; // print("Location: " + Input.location.lastData.latitude + " " + Input.location.lastData.longitude + " " + Input.location.lastData.altitude + " " + Input.location.lastData.horizontalAccuracy + " " + Input.location.lastData.timestamp); } // Stop service if there is no need to query location updates continuously // Input.location.Stop(); }
public static string GetBetween(main, first, last = " ") { return main.Split(new string[]{first},StringSplitOptions.None)[1].Split(new string[]{last},StringSplitOptions.None)[0].Trim() }
// Use this for initialization void Start() { CO = GetComponent<ClickObject>(); Main = (GameObject.Find("/Main")).GetComponent<main>(); MD = (GameObject.Find("/Main")).GetComponent<MainData>(); }
/************************透明窗体的属性**************************/ //GradientTime:控件层渐变特效时长(越小越快)。 //MainPosition:窗口在绘图层位置。 //SkinBack:设置或获取绘图层窗口背景。 //SkinMobile:窗体是否可以移动。 //SkinOpacity:设置或获取绘图层窗口透明度(0-255)。 //SkinShowInTaskbar:绘图层是否出现在Windows任务栏中。 //SkinSize:设置或获取绘图层窗口大小。 //SkinTrankColor:绘图层需要透明的颜色。 //SkinWhetherTank:绘图层是否开启位图仿透明。注意(SkinOpacity < 255时,此属性为False可达到背景透明,控件不透明的效果。)。 /************************透明窗体的属性**************************/ #endregion public Secretary(main main) { InitializeComponent(); Main = main; }
public WorkDestination(main f) { f1 = f; InitializeComponent(); }
public LayoutEditor(main newPrevWindow, eFlash.Data.Deck newDeck) : this(newPrevWindow, newDeck, false) { }
public CmApiHandler() { cMApiResolve = new main(); xmlHandler = new XmlHandler(); }
public MoneySettings(main f) { f1 = f; InitializeComponent(); }
//create the functions and their position to the gui box for the output of the rules void GenerateNewSystem(int windowID) { GUI.Label(new Rect(10, 4, 64, 32), "Variables :"); varsText = GUI.TextField(new Rect(104, 4, 200, 32), varsText); // GUI.Label(new Rect(10,50,64,32),"Constants:"); //constsText=GUI.TextField(new Rect(104,50,200,32),constsText); GUI.Label(new Rect(10, 50, 64, 32), "Start :"); startText = GUI.TextField(new Rect(64, 50, 240, 32), startText); GUI.Label(new Rect(10, 90, 64, 32), "Rules :"); ruleText = GUI.TextField(new Rect(64, 90, 240, 32), ruleText); GUI.Label(new Rect(10, 130, 64, 32), "Iterations :"); iterText = GUI.TextField(new Rect(104, 130, 200, 32), iterText); GUI.Label(new Rect(10, 170, 64, 32), "Angle :"); anglText = GUI.TextField(new Rect(104, 170, 200, 32), anglText); //insert the rule to show GUI.Label(new Rect(10, 210, 64, 32), "get rule :"); rule_num = GUI.TextField(new Rect(104, 210, 200, 32), rule_num); //generate the rule inserted if (GUI.Button(new Rect(10, 280, 128, 32), "Generate")) { //change from rule to rule through the gui window if (rule_num[0] - 48 != 0 || rule_num != null) { switch (rule_num[0] - 48) { case 1: varsText = vars_Text1; startText = start_Text1; ruleText = rule_Text1; anglText = angl_Text1; iterText = iter_Text1; break; case 2: varsText = vars_Text2; startText = start_Text2; ruleText = rule_Text2; anglText = angl_Text2; iterText = iter_Text2; break; case 3: varsText = vars_Text3; startText = start_Text3; ruleText = rule_Text3; anglText = angl_Text3; iterText = iter_Text3; break; case 4: varsText = vars_Text4; startText = start_Text4; ruleText = rule_Text4; anglText = angl_Text4; iterText = iter_Text4; break; case 5: varsText = vars_Text5; startText = start_Text5; ruleText = rule_Text5; anglText = angl_Text5; iterText = iter_Text5; break; case 6: varsText = vars_Text6; startText = start_Text6; ruleText = rule_Text6; anglText = angl_Text6; iterText = iter_Text6; break; case 7: varsText = vars_Text7; startText = start_Text7; ruleText = rule_Text7; anglText = angl_Text7; iterText = iter_Text7; break; case 8: varsText = vars_Text8; startText = start_Text8; ruleText = rule_Text8; anglText = angl_Text8; iterText = iter_Text8; break; default: varsText = vars_Text1; startText = start_Text1; ruleText = rule_Text1; anglText = angl_Text1; iterText = iter_Text1; break; } } main paint = (main)this.GetComponent("main"); paint.reset(); parse parse = (parse)this.GetComponent("parse"); parse.initialize(varsText, constsText, startText, ruleText, int.Parse(iterText), float.Parse(anglText)); parse.reset(); } }
// Use this for initialization void Start() { mainVar = GameObject.Find ("QUAD").GetComponent<main> (); // selectedStudent = this.name; }
public MainCropForm(main mainRef) { //set the reference to our main form. mainFormReference = mainRef; //hide our main form, to only allow camera. mainFormReference.Hide(); //setup the colors to use in the form. SetColors(); //set form properties Text = "Cropper"; TopMost = true; //Allocate certain memory. Process.GetCurrentProcess().MaxWorkingSet = (IntPtr)5000000; }
private void opacityTimer_Tick(object sender, EventArgs e) { if (!delayLogo) { if (!reverseFlag && this.Opacity <= 1) { if (this.Opacity == 1) { reverseFlag = !reverseFlag; delayLogo = !delayLogo; } this.Opacity = this.Opacity + 0.01; } else if (reverseFlag && this.Opacity <= 1) { this.Opacity = this.Opacity - 0.01; if (this.Opacity == 0) { var t = (Timer)sender; t.Enabled = false; main Form = new main(); Form.Text = this.Text; Form.StartPosition = FormStartPosition.CenterScreen; TopMost = false; this.Hide(); Form.Show(); } } opacityDebugText.Text = "Opacity: " + this.Opacity.ToString(); } else { if (!checkVersion) { var verCore = Core.Init(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Application.ProductName)); Functions.verCore = verCore; checkVersion = !checkVersion; BassNet.Registration("*****@*****.**", "2X8141823152222"); byte[] byteBassVer = new byte[4]; Int32 ver = Bass.BASS_GetVersion(); byteBassVer[0] = BitConverter.GetBytes(ver)[0]; byteBassVer[1] = BitConverter.GetBytes(ver)[1]; byteBassVer[2] = BitConverter.GetBytes(ver)[2]; byteBassVer[3] = BitConverter.GetBytes(ver)[3]; Functions.verBass = byteBassVer[3].ToString() + "." + byteBassVer[2].ToString() + "." + byteBassVer[1].ToString() + "." + byteBassVer[0].ToString(); string[] arg = Environment.GetCommandLineArgs(); if (arg.Length > 1) { if (arg[1] != "-noDiscord") { Discord.Init(); } } else { Discord.Init(); } } if (delay == 0) { delayLogo = !delayLogo; } if (delay > 0) { delay--; } delayDebugText.Text = "Delay: " + delay.ToString(); } }
// Use this for initialization void Start() { nMain = GameObject.FindObjectOfType(typeof(main)) as main; }
private void LOGINmain() { if (txtUSERNAME.Text == "") { MessageBox.Show("请输入账户!"); return; } if (txtPASSWORD.Text == "") { MessageBox.Show("请输入密码!"); return; } if (ddlMW.SelectedValue.ToString() == "0") { MessageBox.Show("请选择门卫!"); return; } CRM_LoginInfo tokeninfo = crmModels.CRM_Login.Login(txtUSERNAME.Text.Trim(), txtPASSWORD.Text.Trim(), "", "", 1, 0); if (tokeninfo.TokenInfo.access_token == null) { if (tokeninfo.TokenInfo.MSG == "E") { MessageBox.Show(tokeninfo.TokenInfo.MESSAGE); return; } else { MessageBox.Show("用户名或密码错误!"); return; } } else { //登录成功 SSO_TOKEN_USERNAMEDY cxmodel = new SSO_TOKEN_USERNAMEDY(); cxmodel.STAFFID = tokeninfo.TokenInfo.STAFFID; cxmodel.ZHLB = 6; SSO_TOKEN_USERNAMEDY_SELECT data = ssoModels.TOKEN_TOKENIDINFO.USERNAMEDY_SELECT(cxmodel, tokeninfo.TokenInfo.access_token); if (data.MES_RETURN.TYPE == "S") { if (data.SSO_TOKEN_USERNAMEDY.Length > 0) { int ISLOHIN = mainService.CheckMWQX(data.SSO_TOKEN_USERNAMEDY[0].ZHUSERID, ddlMW.SelectedValue.ToString()); if (ISLOHIN == 2) { MessageBox.Show("没有该门卫权限!"); return; } else { ////储存选择的机器到本地 //StreamWriter sw = new StreamWriter WritePrivateProfileString(strSec, "USERNAME", txtUSERNAME.Text, strFilePath); WritePrivateProfileString(strSec, "ddlMW", ddlMW.SelectedValue.ToString(), strFilePath); Appclass.token = tokeninfo.TokenInfo.access_token; Appclass.STAFFID = tokeninfo.TokenInfo.STAFFID; this.Hide(); main Main = new main(ddlMW.SelectedValue.ToString(), data.SSO_TOKEN_USERNAMEDY[0].ZHUSERNAME, loginfun = this.ContentValue); Main.Show(); } } else { MessageBox.Show("没有对应的帐号!"); return; } } else { MessageBox.Show("登录失败!"); return; } } //int ISLOHIN = mainService.LOGIN(txtUSERNAME.Text, txtPASSWORD.Text, ddlMW.SelectedValue.ToString()); //if (ISLOHIN == 1) //{ // MessageBox.Show("用户名或密码错误!"); // return; //} //else if (ISLOHIN == 2) //{ // MessageBox.Show("没有该门卫权限!"); // return; //} //else //{ // WritePrivateProfileString(strSec, "USERNAME", txtUSERNAME.Text, strFilePath); // WritePrivateProfileString(strSec, "ddlMW", ddlMW.SelectedValue.ToString(), strFilePath); // this.Hide(); // main Main = new main(ddlMW.SelectedValue.ToString(), txtUSERNAME.Text); // Main.Show(); //} }
// Use this for initialization void Start() { main = new main(); main.Init(1, 15, server, port); Add("Start"); }
static void Main(string[] args) { main m = new main(); m.ShowDialog(); }
// Use this for initialization void Start() { CO = GetComponent <ClickObject>(); Main = (GameObject.Find("/Main")).GetComponent <main>(); MD = (GameObject.Find("/Main")).GetComponent <MainData>(); }
internal MainStateMachine() { currState = main.sleep; //fill array with functions getNextState = new machine[] { Sleep, Play, Settings, Credits, Exit }; }
private void Personel_ekle_FormClosed(object sender, FormClosedEventArgs e) { main main = new main(); main.Show(); }
internal main update() { return(currState = getNextState[((int)currState)]()); }
void Awake() { mains = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <main>(); }
internal void wake() { currState = sleepState; }
// Use this for initialization void Start() { mainVar = GameObject.Find ("QUAD").GetComponent<main> (); }
internal void goTo(main state) { currState = state; }
// Use this for initialization void Start() { CO = GetComponent<ClickObject>(); Target = GameObject.Find("/Main"); Main = Target.GetComponent<main>(); }
public MyServer(main par) { this.parent = par; }
public WeatherInfo() { this.Weather = new List <weather>(); this.Main = new main(); }
public addImg(main mainForm) { this.mainForm = mainForm; this.Owner = mainForm; InitializeComponent(); }
// Use this for initialization void Start() { myMain = GameObject.Find("Main").GetComponent <main>(); myText = GetComponent <Text>(); myText.text = "#" + myMain.tryNumber + ": " + myMain.PrevNumber.text + " | " + myMain.Strike + "S " + myMain.Ball + "B"; }
ParseOneCall(main, variables);
public static void Save(string fileName, main win, bool Quiet) { //show busy cursor Cursor.Current = Cursors.WaitCursor; //disable build button to prevent building twice win.build.Enabled = false; //find .corflags 0x00000002 and insert .vtfixup after it int i; win.lb.BeginUpdate(); int slot = 1; //current slot number for (i = 0; i < win.lb.Items.Count; i++) { if (win.lb.Items[i].ToString().StartsWith(".corflags 0x00000002")) { //.corflags 0x00000002 found so create VTableFixup table with enough slots for exported methods foreach (ListViewItem lvi in win.exportBox.Items) { win.lb.Items.Insert(i+1, ".vtfixup [1] int32 fromunmanaged at VT_0" + slot.ToString()); win.lb.Items.Insert(i+2, ".data VT_0" + slot.ToString() + " = int32(0)"); slot ++; } } } slot = 1; //.vtentry 1 : 1 //.export [1] as SayHello //for each method in exportBox find it and export it int c; for (c = 0; c < win.exportBox.Items.Count; c++) { for (i = 0; i < win.lb.Items.Count; i++) { if (win.lb.Items[i].ToString() == win.exportBox.Items[c].SubItems[3].Text) { //change method to cdecl string meth = win.lb.Items[i].ToString(); int end = meth.IndexOf("("); if (end > - 1) { int ii = end - 1; while (meth.Substring(ii,1) != " ") ii --; end = ii; meth = meth.Insert(end, " modopt([mscorlib]System.Runtime.InteropServices.CallConv" + win.exportBox.Items[c].SubItems[1].Text + ") "); } win.lb.Items[i] = meth; //found method so export it win.lb.Items.Insert(i+2, ".vtentry " + slot.ToString() + " : 1"); //export method win.lb.Items.Insert(i+3, ".export ["+slot.ToString()+"] as " + win.exportBox.Items[c].SubItems[2].Text); slot ++; //increment slot number } } } //edit il if edit il before build checkbox is checked if (win.editIl.Checked == true) { editIlDialog.editIlasm(win.lb); } //save code in lb FileStream fs = null; StreamWriter sw = null; try { fs = new FileStream(win.TEMP + "_dll.il", FileMode.Create); sw = new StreamWriter(fs); for (i = 0; i < win.lb.Items.Count; i++) sw.WriteLine(win.lb.Items[i].ToString()); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { sw.Close(); fs.Close(); } //add string table to .res file if required if (win.stringCheck.Checked == true && win.stringBox.Items.Count > 0) { BinaryWriter bw = null; try { if (File.Exists(win.TEMP + "_dll.res")) { //if a .res file exists use it fs = new FileStream(win.TEMP + "_dll.res", FileMode.Append); bw = new BinaryWriter(fs); } else { //no .res file so create one fs = new FileStream(win.TEMP + "_dll.res", FileMode.Create); bw = new BinaryWriter(fs); //write empty resource bw.Write((int)0); bw.Write((int)32); bw.Write((ushort)65535); bw.Write((ushort)0); bw.Write((ushort)65535); bw.Write((ushort)0); bw.Write((int)0); bw.Write((int)0); bw.Write((int)0); bw.Write((int)0); } //if the first string table item is not blank insert a blank one as dbpro ignores first string table item if (win.stringBox.Items[0].ToString() != "") win.stringBox.Items.Insert(0,""); int item = 0; //current string table item int total = win.stringBox.Items.Count; //total string table items ushort block = 1; //current string table block (name in header) while (item < total) { //write resource entry header //data size int datasize = 0; //add size of each string in current block to datasize for (i=item; i<item+16; i++) { //get size of each string if (i < win.stringBox.Items.Count) datasize += win.stringBox.Items[i].ToString().Length; } //double datasize as strings in res are unicode datasize *= 2; //add 2bytes for each string table item string length datasize += 32; // 16 * 2 bw.Write(datasize); //header size; bw.Write((int)32); //type bw.Write((ushort)65535); bw.Write((ushort)6); //name bw.Write((ushort)65535); bw.Write(block); block ++; //increase block number for next header //data version bw.Write((int)0); //flags //language bw.Write((int)0); //version bw.Write((int)0); //characteristics bw.Write((int)0); //resource header end //write resource data int times = item + 16; for (i=item; i<times; i++) { //if there is an item in stringBox if (i < win.stringBox.Items.Count) { //write length bw.Write((ushort) (win.stringBox.Items[i].ToString().Length)); //write string bw.Write(Encoding.Unicode.GetBytes(win.stringBox.Items[i].ToString())); //increment item count item ++; } else { //write empty string item bw.Write((ushort) 0); } } } //remove the first blank string table item added earlier if (win.stringBox.Items[0].ToString() == "") win.stringBox.Items.RemoveAt(0); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error!"); } finally { if (bw != null) bw.Close(); if (fs != null) fs.Close(); } } //MessageBox.Show("Dll about to be built"); //build new dll //OUT:HelloWorldDll.dll HelloWorldDll.il /DLL /resource:HelloWorldDll.res Process process = new Process(); process.StartInfo.FileName = "\"" + win.ilasm + "\""; process.StartInfo.Arguments = " /OUT:\"" + fileName + "\"" + " \"" + win.TEMP + "_dll.il\"" + " /DLL /resource:\"" + win.TEMP + "_dll.res\""; if (Quiet == false) { process.StartInfo.UseShellExecute = false; process.StartInfo.CreateNoWindow = true; process.StartInfo.RedirectStandardOutput = true; process.Start(); string result = process.StandardOutput.ReadToEnd(); process.WaitForExit(); if (result.IndexOf("Operation completed successfully") != -1) MessageBox.Show("Build sucessfull!","", MessageBoxButtons.OK, MessageBoxIcon.Information); else { DialogResult dr = MessageBox.Show("Build failed!\n\nSee ilasm output?","Fail!", MessageBoxButtons.YesNo, MessageBoxIcon.Error); if (dr == DialogResult.Yes) { //show ilasm output outputDialog od = new outputDialog(); od.outputText = result; od.ShowDialog(); } } } else { process.StartInfo.CreateNoWindow = true; process.Start(); process.WaitForExit(); } //delete temp files if (File.Exists(win.TEMP + "\\_dll.il")) File.Delete(win.TEMP + "\\_dll.il"); if (File.Exists(win.TEMP + "\\_dll.res")) File.Delete(win.TEMP + "\\_dll.res"); win.lb.EndUpdate(); //show normal cursor Cursor.Current = Cursors.Default; }
private String[] result; // tablica z gotowymi rozwiazaniami, stringi w formacie - "tag/r/n (int,int,int,int/r/n)*" + pierwszy wiersz pusty string "" #endregion Fields #region Constructors public DataLoader(main engine) { this.engine = engine; //do listy rectangle z engine wczytane zostana prostokaty }
public static void Load(string filename, main win) { //show busy cursor Cursor.Current = Cursors.WaitCursor; //delete any old .il and .res files if (File.Exists(Application.StartupPath + "\\_dll.il")) File.Delete(Application.StartupPath + "\\_dll.il"); if (File.Exists(Application.StartupPath + "\\_dll.res")) File.Delete(Application.StartupPath + "\\_dll.res"); //use ildasm to decompile dll to il code Process process = new Process(); process.StartInfo.FileName = "\"" + win.ildasm +"\""; process.StartInfo.Arguments = " /OUT:\"" + win.TEMP + "\\_dll.il\" \"" + filename + "\""; process.StartInfo.UseShellExecute = false; process.StartInfo.RedirectStandardOutput = true; process.StartInfo.RedirectStandardError = true; process.StartInfo.CreateNoWindow = true; process.Start(); process.WaitForExit(); //MessageBox.Show(process.StandardOutput.ReadToEnd()); //check it worked if (! File.Exists(win.TEMP + "\\_dll.il")) { MessageBox.Show("ildasm failed!","Error!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } //enable build button win.build.Enabled = true; win.dllName = filename; //load .il into listbox win.lb.BeginUpdate(); win.lb.Items.Clear(); win.methodBox.BeginUpdate(); win.methodBox.Items.Clear(); win.exportBox.Items.Clear(); win.stringBox.Items.Clear(); FileStream fs = null; StreamReader sr = null; try { fs = new FileStream(win.TEMP + "\\_dll.il", FileMode.Open); sr = new StreamReader(fs); string temp = ""; while ((temp = sr.ReadLine()) != null) { win.lb.Items.Add(temp.Trim()); } } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } finally { sr.Close(); fs.Close(); } //remove comments and blank lines from listview, this makes it easier to parse later //join lines that end in "," //change .corflags 0x00000001 to .corflags 0x00000002 int i; string str = ""; bool corflags = false; for (i = 0; i < win.lb.Items.Count; i++) { str = win.lb.Items[i].ToString(); //strip spaces if (corflags == false) { if (str == ".corflags 0x00000001") { win.lb.Items[i] = ".corflags 0x00000002"; corflags = true; } } if (str.Length == 0) { win.lb.Items.RemoveAt(i); i--; } if (i >= 0) { if (str.StartsWith("//")) { win.lb.Items.RemoveAt(i); i --; } } //if previous line ended with "," stick this line on end if (i > 0) { if (win.lb.Items[i-1].ToString().EndsWith(",")) { win.lb.Items[i-1] = win.lb.Items[i-1].ToString() + str; win.lb.Items.RemoveAt(i); i --; } } } // find methods for (i = 0; i < win.lb.Items.Count; i++) { str = win.lb.Items[i].ToString(); if (str.StartsWith(".method")) { //if next line doesn't start with "{" stick it on the line with .method if (! win.lb.Items[i+1].ToString().StartsWith("{")) { win.lb.Items[i] = win.lb.Items[i].ToString() + " " + win.lb.Items[i+1].ToString(); win.lb.Items.RemoveAt(i+1); //add method to methodBox str = win.lb.Items[i].ToString(); } //don't add constructors or pivoke methods if (str.IndexOf(".ctor()") == -1 && str.IndexOf("pinvokeimpl") == -1) { //get method name int end = str.IndexOf("("); if (end > -1) { int start = str.LastIndexOf(" ",end, end-1) + 1; ListViewItem lvi = new ListViewItem(str.Substring(start,end-start)); lvi.SubItems.Add(str); win.methodBox.Items.Add(lvi); } } } } win.methodBox.EndUpdate(); win.lb.EndUpdate(); //show normal cursor Cursor.Current = Cursors.Default; }
public CurrentWeatherDataModel() { Weather = new List<weather>(); Main = new main(); }