public void getfiles(string dir)
    {
        ddFilesMovie.Items.Clear();

        ListItem li1 = new ListItem();
        li1.Text = "-- select --";
        li1.Value = "-1";

        ddFilesMovie.Items.Add(li1);

        ArrayList af = new ArrayList();
        string[] Filesmovie = Directory.GetFiles(dir);
        foreach (string file in Filesmovie)
        {
            string appdir = Server.MapPath("~/App_Uploads_Img/") + ddCatMovie.SelectedValue;
            string filename = file.Substring(appdir.Length + 1);

            if ((!filename.Contains("_svn")) && (!filename.Contains(".svn")))
            {
                if (filename.ToLower().Contains(".mov") || filename.ToLower().Contains(".flv") || filename.ToLower().Contains(".wmv") )
                {
                    ListItem li = new ListItem();
                    li.Text = filename;
                    li.Value = filename;
                    ddFilesMovie.Items.Add(li);
                }
            }
        }
        UpdatePanel1Movie.Update();
    }
Example #2
0
File: HexTile.cs Project: gelum/TBA
    public ArrayList Neighbours( Moveable peep)
    {
        Character peepChar = peep.gameObject.GetComponent<Character> ();
        bool peepCanPathThroughEnemies = peep.canPathThroughEnemies;

        ArrayList neighbourhood = new ArrayList ();
        if (left != null && !peep.unpathables.Contains(left.GetComponent<HexTile>().Type)
            && ( peepCanPathThroughEnemies
            ||   !ArrayListsIntersect( left.GetComponent<HexTile>().occupantTeams, peepChar.enemyTeams)))
            neighbourhood.Add (left);
        if (right != null && !peep.unpathables.Contains(right.GetComponent<HexTile>().Type)
            && ( peepCanPathThroughEnemies
            ||   !ArrayListsIntersect( right.GetComponent<HexTile>().occupantTeams, peepChar.enemyTeams)))
            neighbourhood.Add (right);
        if (up_left != null && !peep.unpathables.Contains(up_left.GetComponent<HexTile>().Type)
            && ( peepCanPathThroughEnemies
            ||   !ArrayListsIntersect( up_left.GetComponent<HexTile>().occupantTeams, peepChar.enemyTeams)))
            neighbourhood.Add (up_left);
        if (up_right != null && !peep.unpathables.Contains(up_right.GetComponent<HexTile>().Type)
            && ( peepCanPathThroughEnemies
            ||   !ArrayListsIntersect( up_right.GetComponent<HexTile>().occupantTeams, peepChar.enemyTeams)))
            neighbourhood.Add (up_right);
        if (down_right != null && !peep.unpathables.Contains(down_right.GetComponent<HexTile>().Type)
            && ( peepCanPathThroughEnemies
            ||   !ArrayListsIntersect( down_right.GetComponent<HexTile>().occupantTeams, peepChar.enemyTeams)))
            neighbourhood.Add (down_right);
        if (down_left != null && !peep.unpathables.Contains(down_left.GetComponent<HexTile>().Type)
            && ( peepCanPathThroughEnemies
            ||   !ArrayListsIntersect( down_left.GetComponent<HexTile>().occupantTeams, peepChar.enemyTeams)))
            neighbourhood.Add (down_left);

        return neighbourhood;
    }
    //type = a:1/10, b:1/100, c:1/1000
    public Auth_GetAutoTokenCommand( string playerId,string secret, CompleteDelegate completeDelegate, ErrorDelegate errorDelegate)
    {
        Hashtable batchHash = new Hashtable ();
        batchHash.Add ("authKey", AuthUtils.generateRequestToken (playerId, secret));

        ArrayList commands = new ArrayList();
        Hashtable command = new Hashtable ();
        command.Add ("action", "auth.getAuthToken");
        command.Add ("time", TimeUtils.UnixTime);
        command.Add ("args", new Hashtable () { { "playerId", playerId }, { "secret", secret }});
        //		command.Add ("expectedStatus","");
        command.Add ("requestId", 123);
        //		command.Add ("token", "");
        commands.Add(command);
        batchHash.Add("commands",commands);
        batch = MiniJSON.jsonEncode(batchHash);

        ////////
        this.onComplete = delegate(Hashtable t){
            //{"requestId":null,"messages":{},"result":"aWeha_JMFgzaF5zWMR3tnObOtLZNPR4rO70DNdfWPvc.eyJ1c2VySWQiOiIyMCIsImV4cGlyZXMiOiIxMzg1NzA5ODgyIn0","status":0}
            Hashtable completeParam = new Hashtable();
            completeParam.Add("result",t["result"]);
            completeDelegate(completeParam);
        };
        /////////
        this.onError = delegate(string err_code,string err_msg, Hashtable data){
            errorDelegate(err_code,err_msg,data);
        };
    }
 public MemberInfo[] GetTestedMethods()
   {
   Type type = typeof(Convert);
   ArrayList list = new ArrayList();
   list.Add(type.GetMethod("ToBoolean", new Type[]{typeof(Byte)}));
   list.Add(type.GetMethod("ToBoolean", new Type[]{typeof(SByte)}));
   list.Add(type.GetMethod("ToBoolean", new Type[]{typeof(Int16)}));
   list.Add(type.GetMethod("ToBoolean", new Type[]{typeof(Int32)}));
   list.Add(type.GetMethod("ToBoolean", new Type[]{typeof(Int64)}));
   list.Add(type.GetMethod("ToBoolean", new Type[]{typeof(UInt16)}));
   list.Add(type.GetMethod("ToBoolean", new Type[]{typeof(UInt32)}));
   list.Add(type.GetMethod("ToBoolean", new Type[]{typeof(UInt64)}));
   list.Add(type.GetMethod("ToBoolean", new Type[]{typeof(String), typeof(IFormatProvider)}));
   list.Add(type.GetMethod("ToBoolean", new Type[]{typeof(String)}));
   list.Add(type.GetMethod("ToBoolean", new Type[]{typeof(Boolean)}));
   list.Add(type.GetMethod("ToBoolean", new Type[]{typeof(Char)}));
   list.Add(type.GetMethod("ToBoolean", new Type[]{typeof(Object)}));
   list.Add(type.GetMethod("ToBoolean", new Type[]{typeof(Object), typeof(IFormatProvider)}));
   list.Add(type.GetMethod("ToBoolean", new Type[]{typeof(Single)}));
   list.Add(type.GetMethod("ToBoolean", new Type[]{typeof(Double)}));
   list.Add(type.GetMethod("ToBoolean", new Type[]{typeof(DateTime)}));
   list.Add(type.GetMethod("ToBoolean", new Type[]{typeof(Decimal)}));
   MethodInfo[] methods = new MethodInfo[list.Count];
   list.CopyTo(methods, 0);
   return methods;
   }
	// Use this for initialization
	void Start () {
        if (IntroScript == null) IntroScript = new ArrayList();
        if (IntroScript != null && IntroScript.Count != 0) IntroScript.Clear();
        if (IntroScript != null && IntroScript.Count == 0) AddScriptToList();

        ContinueButton_Click();
	}
    public static string[] GetCompletionList(string prefixText, int count)
    {
        //連線字串
        //string connStr = @"Data Source=.\SQLEXPRESS;AttachDbFilename="
                     //+ System.Web.HttpContext.Current.Server.MapPath("~/App_Data/NorthwindChinese.mdf") + ";Integrated Security=True;User Instance=True";

        ArrayList array = new ArrayList();//儲存撈出來的字串集合

        //using (SqlConnection conn = new SqlConnection(connStr))
        using (SqlConnection conn = new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString))
        {
            DataSet ds = new DataSet();
            string selectStr = @"SELECT Top (" + count + ") Account_numbers FROM Account_Order_M_View Where Account_numbers Like '" + prefixText + "%'";
            SqlDataAdapter da = new SqlDataAdapter(selectStr, conn);
            conn.Open();
            da.Fill(ds);
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                array.Add(dr["Account_numbers"].ToString());
            }

        }

        return (string[])array.ToArray(typeof(string));
    }
Example #7
0
 /// <summary>
 /// Puts an array of OscMessages into a packet (byte[]).
 /// </summary>
 /// <param name="messages">An ArrayList of OscMessages.</param>
 /// <param name="packet">An array of bytes to be populated with the OscMessages.</param>
 /// <param name="length">The size of the array of bytes.</param>
 /// <returns>The length of the packet</returns>
 public static int OscMessagesToPacket(ArrayList messages, byte[] packet, int length)
 {
     int index = 0;
       if (messages.Count == 1)
     index = OscMessageToPacket((OscMessage)messages[0], packet, 0, length);
       else
       {
     // Write the first bundle bit
     index = InsertString("#bundle", packet, index, length);
     // Write a null timestamp (another 8bytes)
     int c = 8;
     while (( c-- )>0)
       packet[index++]++;
     // Now, put each message preceded by it's length
     foreach (OscMessage oscM in messages)
     {
       int lengthIndex = index;
       index += 4;
       int packetStart = index;
       index = OscMessageToPacket(oscM, packet, index, length);
       int packetSize = index - packetStart;
       packet[lengthIndex++] = (byte)((packetSize >> 24) & 0xFF);
       packet[lengthIndex++] = (byte)((packetSize >> 16) & 0xFF);
       packet[lengthIndex++] = (byte)((packetSize >> 8) & 0xFF);
       packet[lengthIndex++] = (byte)((packetSize) & 0xFF);
     }
       }
       return index;
 }
	/**
	 * Controle la balle avec des deplacements gauche,
	 * droite et profondeur
	 * return listFloat
	 */
	ArrayList StyleJeuSimple(){
		Frame frame = controller.Frame();
		Hand hand = frame.Hands.Rightmost;
		handPosition = hand.PalmPosition;
		ArrayList listFloat = new ArrayList();
		float moveSimpleX = 0;
		float moveSimpleZ = 0;

		export.AddRow();
		export["Time in ms"] = Time.timeSinceLevelLoad;
		export["Pos hand in x"] = handPosition.x;
		export["Pos hand in z"] = handPosition.z;
		
		if(hand.IsValid){
			if(moveSimpleX == (handPosition.x)/10 * Time.deltaTime * 3){
				moveSimpleX = 0;
			}else{
				moveSimpleX = (handPosition.x)/10 * Time.deltaTime * 3;
			}
			
			if (moveSimpleZ == (-handPosition.z) / 10 * Time.deltaTime * 3){
				moveSimpleZ = 0;
			}else{
				moveSimpleZ = (-handPosition.z) / 10 * Time.deltaTime * 3;
			}
		}
		listFloat.Add(moveSimpleX);
		listFloat.Add(moveSimpleZ);
		
		return listFloat;
	}
Example #9
0
    /*
    ============================================================================
    Data handling functions
    ============================================================================
    */
    public Hashtable GetData(Hashtable ht)
    {
        if(this.active)
        {
            ArrayList s = new ArrayList();
            ht.Add("distance", this.distance.ToString());
            ht.Add("layermask", this.layerMask.ToString());
            if(this.ignoreUser) ht.Add("ignoreuser", "true");

            ht = this.mouseTouch.GetData(ht);

            ht.Add("rayorigin", this.rayOrigin.ToString());
            VectorHelper.ToHashtable(ref ht, this.offset);
            if(TargetRayOrigin.USER.Equals(this.rayOrigin))
            {
                s.Add(HashtableHelper.GetContentHashtable(TargetRaycast.CHILD, this.pathToChild));
                if(!this.mouseTouch.Active())
                {
                    VectorHelper.ToHashtable(ref ht, this.rayDirection, "dx", "dy", "dz");
                }
            }
            s.Add(HashtableHelper.GetContentHashtable(TargetRaycast.TARGETCHILD, this.pathToTarget));
            VectorHelper.ToHashtable(ref ht, this.targetOffset, "tx", "ty", "tz");
            if(s.Count > 0) ht.Add(XMLHandler.NODES, s);
        }
        return ht;
    }
Example #10
0
    public void refreshItemShow()
    {
        ArrayList lItemList = bagControl.getItemList();
        //Debug.Log(lItemList);
        itemIndexList = lItemList;
        int lItemUIIndex = 0;
        zzIndexTable lItemTypeTable = bagControl
                                        .getItemSystem().getItemTypeTable();

        foreach (int i in lItemList)
        {
            ItemTypeInfo lItemType = (ItemTypeInfo)lItemTypeTable.getData(i);
            itemListUI[lItemUIIndex].setImage(lItemType.getImage());
            itemListUI[lItemUIIndex].setVisible(true);
            ++lItemUIIndex;
        }

        itemNum = lItemUIIndex;

        //Debug.Log(lItemUIIndex);
        //更新选择的位置
        if (showSelected && lItemUIIndex < selectedIndex)
            setSelected(lItemUIIndex);

        //将剩余的图标空间清空
        for (; lItemUIIndex < numOfShowItem; ++lItemUIIndex)
            itemListUI[lItemUIIndex].setVisible(false);
    }
Example #11
0
    // Use this for initialization
    void Start()
    {
        Zoom.OnChangeZoom += OnChangeZoom;
        mg = GameObject.Find ("Manager").GetComponent<Manager> ();
        locationList = new ArrayList ();

        locationListScreen = new ArrayList ();

        using (StreamReader reader = new StreamReader(Application.dataPath + "\\"+RouteListPath)) {
            while (!reader.EndOfStream) {
                string line = reader.ReadLine ();

                string[] parts = line.Split (",".ToCharArray ());
                locationList.Add(new double[]{double.Parse(parts[0]),double.Parse(parts[1])});
            }
            reader.Close();
        }

        lineParameter = "&path=color:0xff0030";

        for (int i=0; i< locationList.Count; i++) {
            double[] d_pos = (double[])locationList [i];
            lineParameter += "|" + d_pos [0].ToString () + "," + d_pos [1].ToString ();
            double[] point = {(double)d_pos [1],  (double)d_pos [0]};
            Vector3 pos = mg.GIStoPos (point);
            locationListScreen.Add (pos);
        }
         #if !(UNITY_IPHONE)
        mg.sy_Map.addParameter = lineParameter;
         #endif
    }
Example #12
0
    public void removeBullet(ArrayList prams)
    {
        GameObject scene = objs[0] as GameObject;
        GameObject caller = objs[1] as GameObject;

        GameObject bltObj = prams[0] as GameObject;
        GameObject targetObj = prams[1] as GameObject;

        Destroy(bltObj);
        if(targetObj == null)
        {
            return;
        }
        if(icePrb == null)
        {
            icePrb = Resources.Load("eft/StarLord/SkillEft_STARLORD15A_Ice") as GameObject;
        }

        GameObject ice = Instantiate(icePrb) as GameObject;
        ice.transform.position = targetObj.transform.position + new Vector3(0, 80, targetObj.transform.position.z - (targetObj.transform.position.z + 100));

        StarLord heroDoc = (prams[2] as GameObject).GetComponent<StarLord>();

        Character c = targetObj.GetComponent<Character>();

        SkillDef skillDef = SkillLib.instance.getSkillDefBySkillID("STARLORD15A");

        Hashtable tempNumber = skillDef.activeEffectTable;

        int tempAtkPer = (int)((Effect)tempNumber["atk_PHY"]).num;

        c.realDamage(c.getSkillDamageValue(heroDoc.realAtk, tempAtkPer));
    }
Example #13
0
 public DataTable GetCustomListDt(int modelId)
 {
     DataTable dt = bllModelField.GetList(modelId);
     DataRow dr = dt.NewRow();
     dr["Alias"] = "搜索链接";
     dr["Name"] = "$search$";
     dt.Rows.Add(dr);
     ArrayList erArrayList = new ArrayList();
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         string[] erArray = new string[3];
         DataRow tdr = dt.Rows[i];
         if (tdr["type"].ToString().ToLower() == "erlinkagetype")
         {
             erArray[0] = i.ToString();
             erArray[1] = bllModelField.GetFieldContent(tdr["content"].ToString(), 1, 1);
             erArray[2] = bllModelField.GetFieldContent(tdr["content"].ToString(), 2, 1);
             erArrayList.Add(erArray);
         }
     }
     for (int i = 0; i < erArrayList.Count; i++)
     {
         dr = dt.NewRow();
         string[] tmp = (string[])erArrayList[i];
         dr["Alias"] = tmp[1];
         dr["Name"] = tmp[2];
         int pos = int.Parse(tmp[0]);
         dt.Rows.InsertAt(dr, pos + 1+ i);
     }
     ctmFildCount = dt.Rows.Count;
     return dt;
 }
Example #14
0
    public override IEnumerator Cast(ArrayList objs)
    {
        GameObject scene = objs[0] as GameObject;
        GameObject caller = objs[1] as GameObject;
        GameObject target = objs[2] as GameObject;
        parms = objs;

        Hero drax = caller.GetComponent<Hero>();
        drax.castSkill("Skill15B_a");
        yield return new WaitForSeconds(.34f);
        MusicManager.playEffectMusic("SFX_Drax_Fear_Me_1a");

        yield return new WaitForSeconds(.7f);
        StartCoroutine(ShowStones(stones_a));
        yield return new WaitForSeconds(.46f);
        caller.transform.position = new Vector3(0, 0, StaticData.objLayer);
        drax.castSkill("Skill15B_b");
        if(!drax.isDead){
            Debug.LogError("4343");
            StartCoroutine(ShowStones(stones_b));
            StartCoroutine(ShowGrownLight());
            StartCoroutine(ShowBigHolo());
            ReadData();
            FearMe();
        }
    }
Example #15
0
 public MenuTemplate(string name)
 {
     menuName = name;
     itemTemplates = new ArrayList ();
     mainBackground = Resources.Load ("Textures/MainBackground") as Texture;
     setStyles ();
 }
    //type = a:1/10, b:1/100, c:1/1000
    public Player_PackageUpdateCommand( string playerId,string authToken, CompleteDelegate completeDelegate, ErrorDelegate errorDelegate)
    {
        Hashtable batchHash = new Hashtable ();
        batchHash.Add ("authKey", authToken);

        ArrayList commands = new ArrayList();
        Hashtable command = new Hashtable ();
        command.Add ("action", "player.bpackUpdate");
        command.Add ("time", TimeUtils.UnixTime);
        command.Add ("args", new Hashtable () { { "playerId", playerId },{"bpack", EquipManager.Instance.dumpDynamicData()}});
        command.Add ("requestId", 123);
        commands.Add(command);
        batchHash.Add("commands",commands);

        batch = MiniJSON.jsonEncode(batchHash);

        ////////
        this.onComplete = delegate(Hashtable t){
            completeDelegate(t);
        };
        /////////
        this.onError = delegate(string err_code,string err_msg, Hashtable data){
            errorDelegate(err_code,err_msg,data);
        };
    }
Example #17
0
    // Update is called once per frame
    void Update()
    {
        int cnt = Input.touchCount;
        if (cnt == 0)
            return;

        // event check flag
        bool begin, move, end, stationary;
        begin = move = end = stationary = false;

        // parameter
        ArrayList result = new ArrayList ();

        for (int i=0; i<cnt; i++) {
            Touch touch = Input.GetTouch (i);
            result.Add (touch);
        //			if(touch.phase==TouchPhase.Began&&touchBegin!=null) begin = true;
        //			else if(touch.phase==TouchPhase.Moved&&touchMove!=null) move = true;
        //			else if(touch.phase==TouchPhase.Ended&&touchEnd!=null) end = true;
        //			else if(touch.phase==TouchPhase.Stationary&&touchStationary!=null) stationary = true;
        //
        //			if(begin) touchBegin(result);
        //			else if(end) touchEnd(result);
        //			else if(move) touchMove(result);
        //			else if(stationary) touchStationary(result);
            if (touch.phase == TouchPhase.Stationary && touchStationary != null)
                stationary = true;
            //			else if(touch.phase==TouchPhase.Ended&&touchEnd!=null) end = true;
            if (stationary)
                touchStationary (result);
            if (end) touchEnd(result);
        }
    }
Example #18
0
    //使用winrar压缩文件
    public static void CompressFiles(string rarPath, ArrayList fileArray)
    {
        string rar;
        RegistryKey reg;
        object obj;
        string info;
        ProcessStartInfo startInfo;
        Process rarProcess;
        try
        {
            reg = Registry.ClassesRoot.OpenSubKey("Applications\\WinRAR.exe\\Shell\\Open\\Command");
            obj = reg.GetValue("");
            rar = obj.ToString();
            reg.Close();
            rar = rar.Substring(1, rar.Length - 7);
            info = " a -as -r -EP1 " + rarPath;
            foreach (string filepath in fileArray)
                info += " " + filepath;
            startInfo = new ProcessStartInfo();
            startInfo.FileName = rar;
            startInfo.Arguments = info;
            startInfo.WindowStyle = ProcessWindowStyle.Hidden;
            rarProcess = new Process();
            rarProcess.StartInfo = startInfo;
            rarProcess.Start();
        }
        catch
        {

        }
    }
Example #19
0
    //comes from gui/stats.cs
    public StatType(string statisticType, string statisticSubType, string statisticApplyTo, Gtk.TreeView treeview_stats,
			ArrayList sendSelectedSessions, bool sex_active, int statsJumpsType, int limit, 
			ArrayList markedRows, int evolution_mark_consecutives, GraphROptions gRO,
			bool graph, bool toReport, Preferences preferences)
    {
        //some of this will disappear when we use myStatTypeStruct in all classes:
        this.statisticType = statisticType;
        this.statisticSubType = statisticSubType;
        this.statisticApplyTo = statisticApplyTo;
        this.treeview_stats = treeview_stats ;

        this.markedRows = markedRows;

        this.evolution_mark_consecutives = evolution_mark_consecutives;

        this.graph = graph;
        this.toReport = toReport;

        myStatTypeStruct = new StatTypeStruct (
                statisticApplyTo,
                sendSelectedSessions, sex_active,
                statsJumpsType, limit,
                markedRows, gRO,
                toReport, preferences);

        myStat = new Stat(); //create an instance of myStat

        fakeButtonRowCheckedUnchecked = new Gtk.Button();
        fakeButtonRowsSelected = new Gtk.Button();
        fakeButtonNoRowsSelected = new Gtk.Button();
    }
		public OrderedDictionary (int capacity, IEqualityComparer equalityComparer)
		{
			initialCapacity = (capacity < 0) ? 0 : capacity;
			list = new ArrayList (initialCapacity);
			hash = new Hashtable (initialCapacity, equalityComparer);
			comparer = equalityComparer;
		}
    protected void Button1_Click(object sender, EventArgs e)
    {
        localhostWebService.WebService service = new localhostWebService.WebService();
        localhostWebService.ContactDetails contact = new localhostWebService.ContactDetails();
        phoneFriendList = new ArrayList();
        foreach (ListItem friend in CheckBoxListFriends.Items)
        {
            // רשימה של החברים שאיתם 
            // מעוניינים לשתף חברים
            if (friend.Selected)
            {
               phoneFriendList.Add(friend.Value);
            }
        }
        
        foreach (ListItem contactItem in CheckBoxListContacts.Items)
        { // עבור כל איש קשר ברשימה לשיתוף מעתיק לחבר
            //יצירת רשימה של אנשי הקשר
            if (contactItem.Selected)
            {
                contact = service.GetContactsByID(int.Parse(contactItem.Value));

                for (int i = 0; i < phoneFriendList.Count; i++ )
                {

                    moveContactsToAFriend(contact, phoneFriendList[i].ToString());

                }
            }
        }
    }
Example #22
0
 public GraphSerie(string Title, bool IsLeftAxis, ArrayList SerieData)
 {
     this.Title = 		Title;
     this.IsLeftAxis = 	IsLeftAxis;
     this.SerieData =	SerieData;
     Avg = 0;
 }
Example #23
0
 public Node getNext()
 {
     //transform.position=  new Vector3(0, target[0], target[1]);
     ArrayList list = new ArrayList ();
     ArrayList popularity = new ArrayList ();
     while (true) {
                     int randomNumber = (int)Random.Range (0, 4);
         Debug.Log (randomNumber);
                     if (n != null && randomNumber == 0) {
                             list.Add (n);
                             popularity.Add (n.popularity);
                             return n;
                     }
                     if (e != null&& randomNumber == 1) {
                             list.Add (e);
                             popularity.Add (e.popularity);
                             return e;
                     }
                     if (s != null&& randomNumber == 2) {
                             list.Add (s);
                             popularity.Add (s.popularity);
                             return s;
                     }
                     if (w != null&& randomNumber == 3) {
                             list.Add (w);
                             popularity.Add (w.popularity);
                             return w;
                     }
             }
     return null;
     //perform the algorithm here, biased against turning around
     //for (int i=0; i<list.Count; i++) {
     //}
     //return null;
 }
 private ArrayList GetGotoStation()
 {
     ArrayList ret = new ArrayList();
     try
     {
         IList<ConstValueInfo> list = iReleaseProductIDHold.GetGotoStationList("GoToStationWithUnPack");
         this.cmbGotoStation.Items.Clear();
         this.cmbGotoStation.Items.Add(string.Empty);
         foreach (ConstValueInfo item in list)
         {
             ListItem Info = new ListItem();
             Info.Text = item.name;
             Info.Value = item.value;
             this.cmbGotoStation.Items.Add(Info);
         }
         return ret;
     }
     catch (FisException ex)
     {
         throw new Exception(ex.mErrmsg);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #25
0
    void Update()
    {
        ArrayList list = new ArrayList ();

        DeviceOrientation orientation = Input.deviceOrientation;
        if (_lastOrientation != orientation) {
            switch (orientation) {
            case DeviceOrientation.LandscapeLeft:
            case DeviceOrientation.LandscapeRight:
            case DeviceOrientation.Portrait:
            case DeviceOrientation.PortraitUpsideDown:
                list.Add (new FageScreenEvent (_lastOrientation, Input.deviceOrientation));
                _lastOrientation = orientation;
                break;
            }
        }
        if ((_lastWidth != Screen.width) || (_lastHeight != Screen.height)) {
            list.Add (new FageScreenEvent (_lastWidth, _lastHeight, Screen.width, Screen.height));
            _lastWidth = Screen.width;
            _lastHeight = Screen.height;
        }
        if (_lastDpi != Screen.dpi) {
            list.Add (new FageScreenEvent (_lastDpi, Screen.dpi));
            _lastDpi = Screen.dpi;
        }

        foreach (FageScreenEvent fsevent in list) {
            DispatchEvent(fsevent);
        }
    }
 ArrayList LoadFile(string path,string name)
 {
     //使用流的形式读取
     StreamReader sr =null;
     try{
         sr = File.OpenText(path+"//"+ name);
     }catch(Exception e)
     {
         //路径与名称未找到文件则直接返回空
         return null;
     }
     string line;
     ArrayList arrlist = new ArrayList();
     while ((line = sr.ReadLine()) != null)
     {
         //一行一行的读取
         //将每一行的内容存入数组链表容器中
         arrlist.Add(line);
     }
     //关闭流
     sr.Close();
     //销毁流
     sr.Dispose();
     //将数组链表容器返回
     return arrlist;
 }
 /// <summary>
 /// 指定されたフォルダ以下にあるすべてのファイルを取得する(サブフォルダは含まれない)
 /// </summary>
 /// <param name="folder">ファイルを検索するフォルダ名。</param>
 /// <param name="searchPattern">ファイル名検索文字列
 /// ワイルドカード指定子(*, ?)を使用する。</param>
 /// <param name="files">見つかったファイル名のリスト</param>
 public static void GetDirectoryFiles(string folder, string searchPattern, ref ArrayList files)
 {
     //folderにあるファイルを取得する
     string[] fs = System.IO.Directory.GetFiles (folder, searchPattern);
     //ArrayListに追加する
     files.AddRange (fs);
 }
Example #28
0
    public void fill4(int x, int y, Color32 oldColor, Color32 newColor)
    {
        ArrayList stack = new ArrayList();

        stack.Add(new Vec2i(x,y));

        int emergency = 10000;

        while(stack.Count > 0 && emergency >= 0) {

            Vec2i pixel = (Vec2i)stack[stack.Count - 1];
            stack.RemoveAt(stack.Count - 1);

            if(canvas.GetPixel(pixel.x, pixel.y) == oldColor) {

                canvas.SetPixel(pixel.x, pixel.y, newColor);

                if(pixel.x + 1 < 96 && canvas.GetPixel(pixel.x + 1, pixel.y) == oldColor)
                    stack.Add(new Vec2i(pixel.x + 1, pixel.y));

                if(pixel.x - 1 >= 0 && canvas.GetPixel(pixel.x - 1, pixel.y) == oldColor)
                    stack.Add(new Vec2i(pixel.x - 1, pixel.y));

                if(pixel.y + 1 < 64 && canvas.GetPixel(pixel.x, pixel.y + 1) == oldColor)
                    stack.Add(new Vec2i(pixel.x, pixel.y + 1));

                if(pixel.y - 1 >= 0 && canvas.GetPixel(pixel.x, pixel.y - 1) == oldColor)
                    stack.Add(new Vec2i(pixel.x, pixel.y - 1));

            }

            emergency--;

        }
    }
Example #29
0
 //MDS
 //    GUIMultiDotSlider mds;
 public GUIGridV2(int d,int actId,string inTxt,string bOn,string bOf/*,GUIStyle iOn,GUIStyle iOf*/,GUIInterface o)
     : base(d,actId,inTxt,bOn,bOf/*,iOn,iOf*/,o)
 {
     subItems = new ArrayList();
     //		mds = new GUIMultiDotSlider(1);
     thumbs = new Texture2D[0];
 }
Example #30
0
    public static GameObject GetClosestEnemy(Transform transform, bool onScreen)
    {
        GameObject[] enemies = GameObject.FindGameObjectsWithTag ("Enemy");
        ArrayList offscreenEnemies = new ArrayList();

        // Filter offscreen enemies
        foreach(GameObject enemy in enemies) {
            if(IsOnScreen(enemy) == onScreen) {
                offscreenEnemies.Add(enemy);
            }
        }
        if (offscreenEnemies.Count < 1)
            return null;

        // TODO implement closest logic
        GameObject closestEnemy = enemies[0];
        float dist = Vector3.Distance(transform.position, enemies[0].transform.position);

        for(var i=0;i < enemies.Length; i++) {
            var tempDist = Vector3.Distance(transform.position, enemies[i].transform.position);
            if(tempDist < dist) {
                closestEnemy = enemies[i];
                dist = tempDist;
            }
        }
        return closestEnemy;
    }