Beispiel #1
0
        static void Main(string[] args)
        {
            try{
                //初始化构造函数
                Common.GetAccessToken();
            }
            catch (MyException err) {
                throw err;
            }

            baidu = new BaiduWebHelper();
            baidu.GetResult();

            Handle   handle = new Handle(RefreshCatch);
            TimeTick tick   = new TimeTick(60000);

            tick.Start(handle);

            server = new HttpServer();
            server.AddDomain("http://*:1234/");

            Log.WriteLine(Common.GetTime() + "服务器已启动: http://localhost:1234/");
            try{
                server.Start();
                server.WaitRequest();
            }
            catch (MyException err)
            {
                Log.WriteLine(Common.GetTime() + err.Message);
            }
            finally{
                server.Stop();
            }
        }
Beispiel #2
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     Area = new Area(Output.Width, Output.Height);
     Draw = new Draw(Area);
     UpdPicter.Start();
     TimeTick.Start();
 }
Beispiel #3
0
    public TimeTick AddTimeTick(float interval, TimeTick.TickDelegate tickFunc)
    {
        TimeTick timeTick = new TimeTick();

        timeTick.Interval       = interval;
        timeTick.LeftTimeToTick = interval;
        timeTick.OnTick         = tickFunc;
        m_TimeTickList.Add(timeTick);
        return(timeTick);
    }
 private void frmQryResumenBanco_Load(object sender, EventArgs e)
 {
     try
     {
         TimeTick.Start();
         TimeTick.Enabled = true;
         CargarDatos();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 private void btnCancelar_Click(object sender, EventArgs e)
 {
     try
     {
         TimeTick.Stop();
         TimeTick.Enabled = false;
         this.Dispose();
         this.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #6
0
        private static void OneTimeStarted()
        {
            if (TimeTick == null)
            {
                TimeTick = new OneTickTimer();
            }

            if (TimeMillisecond == null)
            {
                TimeMillisecond = new OneMilliTimer();
            }

            if (TimeSecond == null)
            {
                TimeSecond = new OneSecTimer();
            }

            if (TimeMinute == null)
            {
                TimeMinute = new OneMinTimer();
            }

            if (TimeHour == null)
            {
                TimeHour = new OneHourTimer();
            }

            if (TimeDay == null)
            {
                TimeDay = new OneDayTimer();
            }

            TimeTick.Start();
            TimeMillisecond.Start();
            TimeSecond.Start();
            TimeMinute.Start();
            TimeHour.Start();
            TimeDay.Start();
        }
Beispiel #7
0
    public void OutputData()
    {
        BeatMap outputBM;
        //		float outputT=0;
        //		Note outputNode;
        TimeTick outputTimeTick;

        outputBM = new BeatMap();
        InputField[] inpF;
        inpF = mainCanvas.GetComponentsInChildren <InputField>();
        for (int i = 0; i < inpF.Length; i++)
        {
            if (inpF [i].name == "InputName")
            {
                if (inpF [i].text != "")
                {
                    outputBM.name = inpF [i].text;
                }
                else
                {
                    outputBM.name = inpF [i].placeholder.GetComponent <Text> ().text;
                }
                inpF [i].interactable = false;
            }

            else if (inpF [i].name == "InputAuthor")
            {
                if (inpF [i].text != "")
                {
                    outputBM.author = inpF [i].text;
                }
                else
                {
                    outputBM.author = inpF [i].placeholder.GetComponent <Text> ().text;
                }
                inpF [i].interactable = false;
            }

            else if (inpF [i].name == "InputMusic")
            {
                if (inpF [i].text != "")
                {
                    outputBM.music = inpF [i].text;
                }
                else
                {
                    outputBM.music = inpF [i].placeholder.GetComponent <Text> ().text;
                }
                inpF [i].interactable = false;
            }
        }


        List <TimeTick> outputMap;

        outputTimeTick = new TimeTick();
        outputMap      = new List <TimeTick> ();
        for (int i = 0; i < noteList.Count; i++)
        {
            if (i != noteList.Count - 1)
            {
                Debug.Log(i + " " + noteList.Count);
                if ((noteList [i].time - noteList [i + 1].time) < 0.001f && (noteList [i].time - noteList [i + 1].time) > -0.001f)
                {
                    outputTimeTick.notes = new Note[2];

                    for (int p = 0; p < 2; p++)
                    {
                        outputTimeTick.notes[p]       = new Note();
                        outputTimeTick.notes [p].type = noteList [i + p].type;
                        outputTimeTick.notes [p].x    = noteList [i + p].pos.x;
                        outputTimeTick.notes [p].y    = noteList [i + p].pos.y;
                        outputTimeTick.notes [p].z    = noteList [i + p].pos.z;
                        outputTimeTick.t = noteList [i + p].time;
                    }
                    i++;
                }
                else
                {
                    Debug.Log(i + " " + noteList.Count + " SecF");
                    outputTimeTick.notes    = new Note[1];
                    outputTimeTick.notes[0] = new Note();
//					Debug.Log(if(outputTimeTick.notes[0]));
                    Debug.Log(outputTimeTick.notes[0].type);
                    outputTimeTick.notes[0].type =
                        noteList[i].type;
                    outputTimeTick.notes[0].x = noteList[i].pos.x;
                    outputTimeTick.notes[0].y = noteList[i].pos.y;
                    outputTimeTick.notes[0].z = noteList[i].pos.z;
                    outputTimeTick.t          = noteList [i].time;
                }
            }
            else
            {
                Debug.Log(i + " " + noteList.Count + " " + noteList[i].time + " Sec");
                outputTimeTick.notes         = new Note[1];
                outputTimeTick.notes[0]      = new Note();
                outputTimeTick.notes[0].type = noteList[i].type;
                outputTimeTick.notes[0].x    = noteList[i].pos.x;
                outputTimeTick.notes[0].y    = noteList[i].pos.y;
                outputTimeTick.notes[0].z    = noteList[i].pos.z;
                outputTimeTick.t             = noteList [i].time;
            }
            outputMap.Add(outputTimeTick);
            outputTimeTick = new TimeTick();
        }
        outputBM.map = new TimeTick[outputMap.Count];
        for (int i = 0; i < outputMap.Count; i++)
        {
            outputBM.map[i] = outputMap[i];
        }

        Debug.Log(JsonUtility.ToJson(outputBM, true));
        //File.WriteAllText
        using (FileStream fs = new FileStream(dirPath + "/" + beatmapJson, FileMode.Create)){
            using (StreamWriter writer = new StreamWriter(fs)){
                writer.Write(JsonUtility.ToJson(outputBM, true));
            }
        }
    }
Beispiel #8
0
 /// <summary>
 /// Overrides this method to handle the behavior when the time tick event comes.
 /// If base.OnTick() is not called, the event 'TimeTick' will not be emitted.
 /// </summary>
 /// <param name="time">The received TimeEventArgs to get the time information.</param>
 /// <since_tizen> 4 </since_tizen>
 protected virtual void OnTick(TimeEventArgs time)
 {
     TimeTick?.Invoke(this, time);
 }
Beispiel #9
0
 /// <summary>
 /// Overrides this method if want to handle behavior.
 /// </summary>
 protected virtual void OnTimeTick(TimeTickEventArgs e)
 {
     Log.Debug("NUI", "OnTimeTick() is called!");
     TimeTick?.Invoke(this, e);
 }
Beispiel #10
0
 public void RemoveTimeTick(TimeTick timeTick)
 {
     m_TimeTickList.Remove(timeTick);
 }
Beispiel #11
0
 private void timerLeft_Tick(object sender, EventArgs e)
 {
     TimeTick?.Invoke();
 }
    /// <summary>
    /// 加载计时器
    /// </summary>
    private void AttachTickScriptObj()
    {
        TimeTick tickObj = TimeTick.Instances;

        DontDestroyOnLoad(tickObj);
    }