public override void OnButtoneClickAction(MyEventArgs arg)
    {
        rui2 = new RefreshUI();
        print(arg.id);
        switch (arg.id)
        {
        case 1:
            ChangeTextTo10();
            JudgeBtnFunc(1);
            break;

        case 2:
            ChangeTextTo10();
            JudgeBtnFunc(2);
            break;

        case 3:
            ChangeTextTo10();
            JudgeBtnFunc(3);
            break;

        case 4:
            UIManager.Instance.PopUIPanel();
            UIManager.Instance.PushUIPanel("MainSceneMainPanel");
            break;

        default:
            break;
        }
    }
Exemple #2
0
        private void ExecuteRefresh(object sender, EventArgs e)
        {
            NuGetUIThreadHelper.JoinableTaskFactory.Run(UpdateErrorBarAsync);

            // raise RefreshUI event to refresh the manager ui
            RefreshUI?.Invoke(this, EventArgs.Empty);
        }
Exemple #3
0
        private void btnAddTextbook_Click(object sender, EventArgs e)
        {
            RefreshUI    RefreshUI       = new RefreshUI(this.RefreshUI);
            TextbookForm addTextbookForm = new TextbookForm(this.TextbookList, this.ITextbookFormReq, this.CurrentlCourse.Id, RefreshUI);

            addTextbookForm.ShowDialog();
        }
        public void TaskCompleted(IAsyncResult R)
        {
            AsyncTransfer transfer = (AsyncTransfer)R.AsyncState;

            try {
                transfer.Delegatee.EndInvoke(R);
                RefreshUI refreshUI = new RefreshUI(populateStayedListViews);
                Dispatcher.BeginInvoke(refreshUI);
                if (transfer.Mode == 0)
                {
                    MessageBox.Show(transfer.Allomany + " másolása megtörtént.", "Kész", MessageBoxButton.OK);
                }
                else
                {
                    MessageBox.Show(transfer.Allomany + " áthelyezése megtörtént.", "Kész", MessageBoxButton.OK);
                }
            } catch (Exception e)
            {
                if (e is OperationCanceledException)
                {
                    if (transfer.Mode == 0)
                    {
                        MessageBox.Show(transfer.Allomany + " másolása megszakítva.", "Hiba", MessageBoxButton.OK);
                    }
                    else
                    {
                        MessageBox.Show(transfer.Allomany + " áthelyezése megszakítva.", "Hiba", MessageBoxButton.OK);
                    }
                }
                else if (e is IOException)
                {
                    MessageBox.Show(transfer.Allomany + " másolása nem hajtható végre!", "Hiba", MessageBoxButton.OK);
                }
            }
        }
Exemple #5
0
        public TextbookForm(List <Textbook> TextbookSelList, ITextbookFormReq ITextbookFormReq, string currentCourseID, RefreshUI RefreshUI)
        {
            this.TextbookSelList  = TextbookSelList;
            this.ITextbookFormReq = ITextbookFormReq;
            this.currentCourseID  = currentCourseID;
            this.RefreshUI        = RefreshUI;
            InitializeComponent();

            this.initData();
            this.initView();
        }
Exemple #6
0
        public TeacherForm(List <Teacher> teacherSelList, ITeacherFormReq ITeacherFormReq, string currentCourseID, RefreshUI RefreshUI)
        {
            this.RefreshUI       = RefreshUI;
            this.currentCourseID = currentCourseID;
            this.ITeacherFormReq = ITeacherFormReq;
            this.TeacherSelList  = teacherSelList;
            InitializeComponent();

            this.initData();
            this.initView();
        }
    public event DataHandler DataEvent;                         // 声明事件
    public void UpdateData()
    {
        RefreshUI rui = new RefreshUI();

        this.DataEvent += rui.RefreshMainGold;
        if (DataEvent != null)
        {
            DataEvent(CreateANewVenture.Instance.newRecordData);
        }
        else
        {
            Debug.Log("empty");
        }
    }
    void Start()
    {
        //加载预设体
        LoadAllUIObject();

        freshGold = new RefreshUI();

        //当前卡牌id
        cardId = this.transform.parent.name;

        //升级卡牌id
        string Idnum  = cardId[5].ToString();
        int    change = Convert.ToInt32(Idnum);

        change   += 1;
        newCardId = cardId.Remove(5, 1) + change.ToString();

        //升级
        ShowUpgradeCard();

        //刷新金币数
        string readPrice = this.transform.parent.parent.Find("TieJiangPu_Panel(Clone)").GetChild(1).GetComponentInChildren <Text>().text;

        if (readPrice == "选择想要升级的卡 当前价格:免费")
        {
            this.transform.GetChild(3).GetComponentInChildren <Text>().text = "免费";
        }
        else if (readPrice == "选择想要升级的卡 当前价格:10")
        {
            this.transform.GetChild(3).GetComponentInChildren <Text>().text = "10";
        }
        else if (readPrice == "选择想要升级的卡 当前价格:25")
        {
            this.transform.GetChild(3).GetComponentInChildren <Text>().text = "25";
        }
        else
        {
            this.transform.GetChild(3).GetComponentInChildren <Text>().text = "45";
        }

        //升级按钮
        upgradeBtn = gameObject.transform.Find("UpgradeBtn").GetComponent <Button>();
        upgradeBtn.onClick.AddListener(() => { UpCard(); });

        //关闭界面
        closedBtn = gameObject.transform.Find("ClosedBtn").GetComponent <Button>();
        closedBtn.onClick.AddListener(() => { ClosedCardPanel(); });
    }
    private void Start()
    {
        freshGold = new RefreshUI();

        LoadAllUIObject();

        cardId     = this.transform.parent.name;
        OwnCardNum = ShowCardInfo(out thisCardPrice);

        //购买
        BuyBtn = gameObject.transform.Find("BuyBtn").GetComponent <Button>();
        BuyBtn.onClick.AddListener(() => { BuyCard(); });

        //关闭界面
        closedBtn = gameObject.transform.Find("ClosedBtn").GetComponent <Button>();
        closedBtn.onClick.AddListener(() => { ClosedCardPanel(); });
    }
Exemple #10
0
    // Use this for initialization
    void Start()
    {
        rui     = new RefreshUI();
        ExitBtn = transform.parent.parent.parent.Find("Button").GetComponent <Button>();
        ExitBtn.onClick.AddListener(() => {
            UIManager.Instance.PopUIPanel();
            UIManager.Instance.PushUIPanel("MainSceneMainPanel");
        });
        xntgs  = transform.GetComponentInParent <XianNVToggleGroupScr>();
        toggle = this.transform.GetComponent <Toggle>();
        toggle.onValueChanged.AddListener((bool value) => {
            switch (toggle.name)
            {
            case "Toggle":

                transform.parent.parent.Find("MiaoShu_Text").GetComponent <Text>().text = xntgs.str1;
                JudgeType(xntgs.addValue[0]);
                print("jice");
                //toggle.onValueChanged.RemoveAllListeners();
                break;

            case "Toggle (1)":
                transform.parent.parent.Find("MiaoShu_Text").GetComponent <Text>().text = xntgs.str2;
                JudgeType(xntgs.addValue[1]);
                print("jice");
                //toggle.onValueChanged.RemoveAllListeners();
                break;

            case "Toggle (2)":
                transform.parent.parent.Find("MiaoShu_Text").GetComponent <Text>().text = xntgs.str3;
                JudgeType(xntgs.addValue[2]);
                print("jice");
                //toggle.onValueChanged.RemoveAllListeners();
                break;

            default:
                break;
            }
            toggle.onValueChanged.RemoveAllListeners();
        });
    }
Exemple #11
0
    void Start()
    {
        //加载预设体
        LoadAllUIObject();

        freshGold = new RefreshUI();

        //当前卡牌id
        cardId = this.transform.parent.name;

        //显示卡牌信息
        ShowCard();

        //刷新交换机会数
        string readChance = this.transform.parent.parent.Find("KaiPaiShouCangJia_Panel(Clone)").GetChild(1).GetComponentInChildren <Text>().text;

        print(readChance);
        if (readChance == "选择想要交换的卡 剩余机会:2")
        {
            this.transform.GetChild(2).GetComponentInChildren <Text>().text = "2";
        }
        else if (readChance == "选择想要交换的卡 剩余机会:1")
        {
            this.transform.GetChild(2).GetComponentInChildren <Text>().text = "1";
        }
        else
        {
            this.transform.GetChild(2).GetComponentInChildren <Text>().text = "0";
        }

        //交换按钮
        upgradeBtn = gameObject.transform.Find("ExchangeBtn").GetComponent <Button>();
        upgradeBtn.onClick.AddListener(() => { ExchangeCard(); });

        //关闭界面
        closedBtn = gameObject.transform.Find("ClosedBtn").GetComponent <Button>();
        closedBtn.onClick.AddListener(() => { ClosedCardPanel(); });
    }
Exemple #12
0
        /// <summary>
        /// 子線程更新文件
        /// </summary>
        /// <param name="GroupNo">進程號</param>
        private void RunSendFileByThread(object tbGroup)
        {
            DataTable dtList = (DataTable)tbGroup;

            RefreshUI UI = new RefreshUI(ShowProgress); //創建委託實例
            RefreshView UI_View = new RefreshView(UpdateDone); //創建委託實例
            RefreshButton UI_Button = new RefreshButton(EnableButton);

            //開始遠程拷貝程式
            //多臺ap
            CMDCommad Cmd = new CMDCommad();
            XMLReadWrite xml = new XMLReadWrite();
            int RowNum = 0;

            try
            {
                foreach (DataRow _dr in dtList.Rows)
                {
                    string RemoteHost = _dr["ap_name"].ToString();
                    string UserName = _dr["user_name"].ToString();
                    string PassWord = _dr["pwd"].ToString();
                    string RootPath = _dr["root"].ToString();
                    string AllPath = "\\\\" + RemoteHost + "\\" + _dr["ap_dir"].ToString().Trim().Replace(":", "$") + "\\" + RootPath;
                    string curPath = "";
                    if (FileList.Items.Count != 0)
                    {
                        #region 傳送文件

                        this.BeginInvoke(UI_View, new object[] { _dr["ap_seq"].ToString(), "0" });

                        if (Cmd.Connect(RemoteHost, UserName, PassWord))
                        {
                            this.BeginInvoke(UI_View, new object[] { _dr["ap_seq"].ToString(), "1" });

                            for (int j = 0; j < FileList.Items.Count; j++)
                            {
                                FileInfo fi = new FileInfo(FileList.Items[j].ToString());
                                curPath = AllPath;
                                // 取出子目錄
                                if (fi.DirectoryName.Length > fi.DirectoryName.LastIndexOf(FilePath) + FilePath.Length)
                                    curPath = AllPath + "\\" + fi.DirectoryName.Substring(fi.DirectoryName.LastIndexOf(FilePath) + FilePath.Length + 1, fi.DirectoryName.Length - (fi.DirectoryName.LastIndexOf(FilePath) + FilePath.Length + 1));
                                //創建目錄
                                if (Cmd.CreateDir(curPath))
                                {
                                    //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "檢查或創建" + AllPath + "目錄成功!", "Y");
                                }
                                else
                                {
                                    //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "檢查或創建" + AllPath + "目錄失敗!", "N");
                                    continue;
                                }
                                RowNum = RowNum + 1;
                                //開始拷貝文件
                                try
                                {
                                    File.Copy(FileList.Items[j].ToString(), curPath + "\\" + fi.Name, true);
                                    //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "Copy File " + FileList.Items[j].ToString() + " -- " + AllPath + " 成功!", "Y");
                                }
                                catch(Exception ex)
                                {
                                    WriteLog("RunSendFileByThread", "複製文件:" + FileList.Items[j].ToString() + "到" + curPath + "\\" + fi.Name + "時出錯:" + (ex != null ? ex.Message : ""));
                                    //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "Copy File " + FileList.Items[j].ToString() + " -- " + AllPath + " 失敗!", "N");
                                    continue;
                                }
                                RowNum = RowNum + 1;
                                this.BeginInvoke(UI);//UI線程上異步調用委託
                                //this.BeginInvoke(new ThreadStart(UI));
                            }
                        }
                        else
                        {
                            //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "聯接" + RemoteHost + " AP失敗!", "N");
                            RowNum = RowNum + 1;
                            continue;
                        }
                        #endregion
                    }

                    if (ConfigFiles.Count != 0)
                    {
                        #region "生成配置文件"
                        //ToDoManager.Launcher.exe.config -> [WCF-IP] [LX-IP] [UP-MODE] [AT-MODE] [AD-MODE]
                        //Update.xml -> [UP-IP]
                        //Manifest.ini -> [ROOTDIR] [VERKEY]

                        // 產生當前服務器文件夾
                        string cfPath = ConfigPath + "\\" + _dr["ap_seq"].ToString();
                        if (!Directory.Exists(cfPath))
                        {
                            Directory.CreateDirectory(cfPath);
                        }

                        string cfile = "";

                        #region " 1.處理ToDoManager.Launcher.exe.config "

                        cfile = ConfigFiles.Find(f => f.IndexOf("ToDoManager.Launcher.exe.config") > -1);
                        FileInfo fi = new FileInfo(cfile);
                        //複製到服務器文件夾
                        File.Copy(fi.FullName, cfPath + "\\tmp.config", true);
                        //替換參數
                        string FileContext = "";
                        using (StreamReader reader = new StreamReader(cfPath + "\\tmp.config", Encoding.UTF8))
                        {
                            //[WCF-IP] [LX-IP] [UP-MODE] [AT-MODE] [AD-MODE]
                            FileContext = reader.ReadToEnd();
                            FileContext = FileContext.Replace("[WCF-IP]", _dr["wcf_ip"].ToString());
                            FileContext = FileContext.Replace("[LX-IP]", _dr["lx_ip"].ToString());
                            FileContext = FileContext.Replace("[UP-MODE]", _dr["update_mode"].ToString());
                            FileContext = FileContext.Replace("[AT-MODE]", _dr["attach_mode"].ToString());
                            FileContext = FileContext.Replace("[AD-MODE]", _dr["addin_mode"].ToString());
                        }
                        using (StreamWriter writer = new StreamWriter(cfPath + "\\" + fi.Name, false, Encoding.UTF8))
                        {
                            writer.Write(FileContext);
                            writer.Flush();
                        }
                        //複製到目標
                        //開始拷貝文件
                        try
                        {
                            File.Copy(fi.DirectoryName + "\\" + _dr["ap_seq"].ToString() + "\\" + fi.Name, AllPath + "\\" + fi.Name, true);
                            //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "Copy File " + FileList.Items[j].ToString() + " -- " + AllPath + " 成功!", "Y");
                        }
                        catch(Exception ex)
                        {
                            WriteLog("RunSendFileByThread", "複製文件:" + fi.DirectoryName + "\\" + _dr["ap_seq"].ToString() + "\\" + fi.Name + "到" + AllPath + "\\" + fi.Name + "時出錯:" + (ex != null ? ex.Message : ""));
                        }

                        #endregion

                        #region " 2.處理Update.xml "

                        cfile = ConfigFiles.Find(f => f.IndexOf("Update.xml") > -1);
                        fi = new FileInfo(cfile);
                        //複製到服務器文件夾
                        File.Copy(fi.FullName, cfPath + "\\tmp.xml", true);
                        //替換參數
                        FileContext = "";
                        using (StreamReader reader = new StreamReader(cfPath + "\\tmp.xml", Encoding.UTF8))
                        {
                            //[UP-IP]
                            FileContext = reader.ReadToEnd();
                            FileContext = FileContext.Replace("[UP-IP]", _dr["upsrv_ip"].ToString());
                        }
                        using (StreamWriter writer = new StreamWriter(cfPath + "\\" + fi.Name, false, Encoding.UTF8))
                        {
                            writer.Write(FileContext);
                            writer.Flush();
                        }
                        //複製到目標
                        //開始拷貝文件
                        try
                        {
                            File.Copy(fi.DirectoryName + "\\" + _dr["ap_seq"].ToString() + "\\" + fi.Name, AllPath + "\\" + fi.Name, true);
                            //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "Copy File " + FileList.Items[j].ToString() + " -- " + AllPath + " 成功!", "Y");
                        }
                        catch (Exception ex)
                        {
                            WriteLog("RunSendFileByThread", "複製文件:" + fi.DirectoryName + "\\" + _dr["ap_seq"].ToString() + "\\" + fi.Name + "到" + AllPath + "\\" + fi.Name + "時出錯:" + (ex != null ? ex.Message : ""));
                        }

                        #endregion

                        #region " 3.處理Manifest.ini "

                        cfile = ConfigFiles.Find(f => f.IndexOf("Manifest.ini") > -1);
                        fi = new FileInfo(cfile);
                        //複製到服務器文件夾
                        string m_path = System.IO.Path.Combine(cfPath, fi.Name);
                        File.Copy(fi.FullName, m_path, true);
                        NativeMethods.WritePrivateProfileString("UpdateRootPath", "VALUE", _dr["root"].ToString() + "/", m_path);
                        NativeMethods.WritePrivateProfileString("GUID", "VALUE", VerKey, m_path);

                        ////替換參數
                        //FileContext = "";
                        //using (StreamReader reader = new StreamReader(cfPath + "\\tmp.ini", Encoding.UTF8))
                        //{
                        //    //[ROOTDIR] [VERKEY]
                        //    FileContext = reader.ReadToEnd();
                        //    FileContext = FileContext.Replace("[ROOTDIR]", _dr["root"].ToString());
                        //    FileContext = FileContext.Replace("[VERKEY]", VerKey);
                        //}
                        //using (StreamWriter writer = new StreamWriter(cfPath + "\\" + fi.Name, false, Encoding.UTF8))
                        //{
                        //    writer.Write(FileContext);
                        //    writer.Flush();
                        //}
                        //複製到目標
                        //開始拷貝文件
                        try
                        {
                            File.Copy(fi.DirectoryName + "\\" + _dr["ap_seq"].ToString() + "\\" + fi.Name, AllPath + "\\" + fi.Name, true);
                            //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "Copy File " + FileList.Items[j].ToString() + " -- " + AllPath + " 成功!", "Y");
                        }
                        catch (Exception ex)
                        {
                            WriteLog("RunSendFileByThread", "複製文件:" + fi.DirectoryName + "\\" + _dr["ap_seq"].ToString() + "\\" + fi.Name + "到" + AllPath + "\\" + fi.Name + "時出錯:" + (ex != null ? ex.Message : ""));
                        }

                        #endregion

                        #endregion
                    }

                    this.BeginInvoke(UI_View, new object[] { _dr["ap_seq"].ToString(), "2" });
                }
            }
            catch (Exception ex)
            {
                WriteLog("RunSendFileByThread", "出錯了:" + (ex != null ? ex.Message : ""));
            }
            finally
            {
                // 通知主線程,當前子線程結束
                this.BeginInvoke(UI_Button);

                UI = null;
                UI_View = null;
                UI_Button = null;
            }
        }
Exemple #13
0
 /// <summary>
 /// 更新總進度
 /// </summary>
 private void ShowProgress()
 {
     if (this.prgBar_total.InvokeRequired)
     {
         RefreshUI myUI = new RefreshUI(ShowProgress);
         this.prgBar_total.Invoke(myUI);
     }
     else
     {
         wCurCount++;
         if (wCurCount >= this.prgBar_total.Maximum)
             wCurCount = this.prgBar_total.Maximum;
         this.prgBar_total.Value = wCurCount;
     }
 }
    // Use this for initialization
    void Start()
    {
        //lhc = GameObject.Find("WangYouJiuDian_Panel(Clone)/Hotel").transform.GetComponent<ListHotelCard>();
        first = PlayerPrefs.GetInt("first");
        rui3  = new RefreshUI();
        print("玩家一开始的金钱" + CreateANewVenture.Instance.newRecordData.Gold);
        List <ArrayList> list = new List <ArrayList>();

        list = ShareDataBase.sDb.SelectResultSql(string.Format("select * from Card where ID = '{0}'", this.transform.parent.name));


        transform.Find("BigCard/cardname").GetComponent <Text>().text          = list[0][2].ToString();
        transform.Find("BigCard/cardimg").GetComponent <Image>().sprite        = Resources.Load <Sprite>(list[0][3].ToString());
        transform.Find("BigCard/carddescribe/Text").GetComponent <Text>().text = list[0][4].ToString();
        transform.Find("BigCard/type/Text").GetComponent <Text>().text         = list[0][1].ToString();


        content = GameObject.Find("WangYouJiuDian_Panel(Clone)/Show/Text").GetComponent <Text>();
        if (content.text == "选择想要删除的卡当前价格:10金币")
        {
            transform.Find("fee/Money").GetComponent <Text>().text = "10金币";
        }


        // 确定按钮做的事
        transform.Find("confirmBtn").GetComponent <Button>().onClick.AddListener(() => {
            // 免费的话
            //第一次做的事
            if (first == 1)
            {
                string str = ShareDataBase.sDb.SelectFiledSql(string.Format("select own from Card where id ='{0}'", this.transform.parent.name)).ToString();
                print("有几张" + str);
                int i = int.Parse(str);
                if (i >= 1)
                {
                    i--;
                    print(i);
                    ShareDataBase.sDb.SelectFiledSql(string.Format("update Card set own={0} where id ='{1}'", i, this.transform.parent.name));
                    Destroy(this.transform.parent.gameObject, 1);
                    content.text = "选择想要删除的卡当前价格:10金币";

                    Destroy(this.transform.parent.gameObject);

                    //UIManager.Instance.PopUIPanel();
                    //UIManager.Instance.PushUIPanel("MainSceneMainPanel");
                    //UIManager.Instance.PushUIPanel("WangYouJiuDian_Panel");
                }
                else
                {
                    print("傻逼,没牌了");
                }

                // 更新ui
                PlayerPrefs.SetInt("first", 0);
            }
            else
            {
                //不是第一次做的事
                if (CreateANewVenture.Instance.newRecordData.Gold >= 10)
                {
                    print("不是第一次的");
                    CreateANewVenture.Instance.newRecordData.Gold -= 10;
                    rui3.RefreshMainGold(CreateANewVenture.Instance.newRecordData);
                    Destroy(this.transform.parent.gameObject);
                }
                else
                {
                    // 如果钱不够移除该按钮的监听
                    //this.transform.Find("confirmBtn").GetComponent<Button>().onClick.RemoveAllListeners();
                    print("你的金币不够了");
                }
            }
            AchieveUIManager.Instance.Dispatch(1234, this.name);
        });
        // 关闭按钮做的事
        transform.Find("ClosedBtn").GetComponent <Button>().onClick.AddListener(() => {
            Destroy(this.transform.parent.gameObject);
            //UIManager.Instance.PopUIPanel();
        });
    }
    public void OnEnable()
    {
        RefreshUI rui = new RefreshUI();

        rui.RefreshMainGold(CreateANewVenture.Instance.newRecordData);
    }