Esempio n. 1
0
 public UdpClientBase(SendType type = SendType.Normal)
 {
     _sendType        = type;
     _isEndConnection = true;
     _callBackFunc    = null;
     useReceiveQueue(null);
 }
        private void AddCallBackFuncNode()
        {
            TreeNode newCBF = new CallBackFunc(parent.ActivatedWorkSpaceData);

            newCBF.AddChild(new DefaultAction(parent.ActivatedWorkSpaceData));
            parent.Insert(newCBF);
        }
Esempio n. 3
0
    public void PlayMoveAni(CallBackFunc callBackFunc = null)
    {
        _callBackFunc = callBackFunc;

        SettingMoveObj();
        _moveTween.enabled = true;
    }
Esempio n. 4
0
 public UdpServerBase(int id = -1, SendType type = SendType.Normal)
 {
     _id              = id;
     _sendType        = type;
     _isEndConnection = true;
     _callBackFunc    = null;
     _functions       = new InterfaceFunctions(this, _queue);
 }
Esempio n. 5
0
    public void PlayMoveAni(CallBackFunc callBackFunc = null)
    {
        _callBackFunc = callBackFunc;

        SettingMoveObj();

        MoveStart2Center();
    }
Esempio n. 6
0
        public TcpClientBase()
        {
            _client            = null;
            _isEndLoop         = true;
            _funcRunInRecvLoop = null;
            _connState         = ConnType.Disconnected;

            errBuffer = new byte[] { 1, 2, 3, 4, 5, 6 };
        }
Esempio n. 7
0
 public UdpClientBase(int id = -1, SendType type = SendType.Normal) : base()
 {
     _id              = id;
     _sendType        = type;
     _isEndConnection = true;
     _callBackFunc    = null;
     _queue           = new BufferQueue();
     _functions       = new InterfaceFunctions(this, _queue);
 }
Esempio n. 8
0
 public TcpServerBase(SendType type = SendType.Normal)
 {
     _listener = null;
     _sendType = type;
     //_sh = null;
     _client          = null;
     _isEndServer     = true;
     _isEndConnection = true;
     _callBackFunc    = null;
 }
Esempio n. 9
0
 public UdpClientBase(int id = -1, SendType type = SendType.Normal) : base()
 {
     _tempRecvBuffer = new byte[1024000];//1MByte
     _id             = id;
     _sendType       = type;
     //_isEndConnection = true;
     _callBackFunc = null;
     _queue        = new BufferQueue();
     _functions    = new InterfaceFunctions(this, _queue);
 }
Esempio n. 10
0
 public Segment(int id, string videoClipPath, string state, bool protagonist, bool loop, string overallstate = null, CallBackFunc callback = null)
 {
     this.ID            = id;
     this.VideoClipPath = videoClipPath;
     this.State         = state;
     this.Protagonist   = protagonist;
     this.Loop          = loop;
     this.OverallState  = overallstate;
     this.Callback      = callback;
 }
Esempio n. 11
0
        public UdpServerBase(int id, SendType type = SendType.Normal)
        {
            _tempRecvBuffer = new byte[1024000];//1MByte

            _id              = id;
            _sendType        = type;
            _isEndConnection = true;
            _callBackFunc    = null;
            _functions       = new InterfaceFunctions(this, _queue);
        }
Esempio n. 12
0
 public void ShowMsg(string msg, CallBackFunc joinFunc, CallBackFunc cancelFunc, CallBackFunc ignorAllFunc, CallBackFunc timeOutFunc)
 {
     mLbText.text   = msg;
     mJoinFunc     += joinFunc;
     mCancelFunc   += cancelFunc;
     mIgnorAllFunc += ignorAllFunc;
     mTimeOutFunc  += timeOutFunc;
     Show();
     mTimer.Second      = 60.0;
     mTimer.ElapseSpeed = -1;
 }
Esempio n. 13
0
    IEnumerator CheckVideoFinish(CallBackFunc callback = null)
    {
        float time = (float)m_VideoPlayer.clip.length;

        yield return(new WaitForSeconds(time));

        if (callback != null)
        {
            callback();
        }
    }
Esempio n. 14
0
 public UdpClientBase(Byte[] tempRecvBuffer, SendType type = SendType.Normal, int id = -1)
     : base()
 {
     _tempRecvBuffer = tempRecvBuffer;
     _id             = id;
     _sendType       = type;
     //_isEndConnection = true;
     _callBackFunc = null;
     _queue        = new BufferQueue();
     _functions    = new InterfaceFunctions(this, _queue);
 }
Esempio n. 15
0
 public TcpClientBase(int id = -1, SendType type = SendType.Normal)
 {
     _id       = id;
     _sendType = type;
     //_sh = null;
     _client                   = null;
     _isEndConnection          = true;
     _callBackFunc             = null;
     _connectionTimer          = new System.Timers.Timer();
     _connectionTimer.Interval = 1000;
     _connectionTimer.Elapsed += new Timers.ElapsedEventHandler(_connectionTimer_Elapsed);
 }
Esempio n. 16
0
    /// <summary>
    /// ��ͨ�öԻ���
    /// </summary>
    /// <param name="titletxt">�����ı�</param>
    /// <param name="callbackfunc">��ť�����Ļص�����</param>
    /// <param name="tipsId">tipsdataId</param>
    /// <returns></returns>
    public static bool OpenCustomDialogWithTimer(uint tipsId, uint timersecond, CallBackFunc callbackfunc)
    {
        TipsData tdata = CCsvDataManager.Instance.TipsDataMgr.GetTipsData(tipsId);

        if (tdata == null)
        {
            return(false);
        }

        if (CustomDialogObj == null)
        {
            AssetBundle bd = AssetBundleManager.GetAssetBundle(GameDefine.HallAssetbundleName);
            if (bd == null)
            {
                return(false);
            }
            CustomDialogObj = GameMain.instantiate(bd.LoadAsset("Tips_Dialog") as Object) as GameObject;
        }
        DialogFuncCallBack = callbackfunc;
        //����
        Text titleText = CustomDialogObj.transform.Find("ImageBG").Find("TextTop").gameObject.GetComponent <Text>();

        titleText.text = tdata.TipsTitle;
        //����
        Text contentText = CustomDialogObj.transform.Find("ImageBG").Find("ImageBG_01").
                           Find("TextContent").gameObject.GetComponent <Text>();

        DialogTipsDataString = tdata.TipsText;
        string formatstr = string.Format(tdata.TipsText, timersecond);

        contentText.text = formatstr;

        DialogTimer = new CTimerPersecondCall(timersecond, DialogTimerCallback);
        xTimeManger.Instance.RegisterTimer(DialogTimer);


        //��ť
        GameObject okBtn = CustomDialogObj.transform.Find("ImageBG").Find("ButtonOk").gameObject;

        XPointEvent.AutoAddListener(okBtn, OnDialogUIBtnClick, 1);

        GameObject cancelBtn = CustomDialogObj.transform.Find("ImageBG").Find("ButtonCancel").gameObject;

        XPointEvent.AutoAddListener(cancelBtn, OnDialogUIBtnClick, 0);

        Transform canvastf = GameObject.Find("Canvas_1/Root").transform;

        CustomDialogObj.transform.SetParent(canvastf, false);
        CustomDialogObj.transform.SetAsLastSibling();
        CustomDialogObj.SetActive(true);

        return(true);
    }
Esempio n. 17
0
 public TcpServerBase(int id, SendType type = SendType.Normal)
 {
     _id       = id;
     _listener = null;
     _sendType = type;
     //_sh = null;
     _client          = null;
     _isEndServer     = true;
     _isEndConnection = true;
     _callBackFunc    = null;
     _queue           = new BufferQueue();
     _functions       = new InterfaceFunctions(this, _queue);
 }
Esempio n. 18
0
 /// <summary>
 /// 构造
 /// </summary>
 /// <param name="win">窗体</param>
 /// <param name="targetName">目标名字</param>
 /// <param name="content">内容</param>
 /// <param name="contentPos">内容位置</param>
 /// <param name="callBack">回调函数</param>
 /// <param name="force">是否强制引导</param>
 /// <param name="allowFail">是否允许失败</param>
 /// <param name="id">ID</param>
 public GuideInfo(LikeWindow win, string targetName, string content = "", ContentPos contentPos = ContentPos.Left, CallBackFunc callBack = null, bool force = true, bool allowFail = false, int id = 0)
 {
     m_Win           = win;
     m_WinComp       = win as Component;
     m_strTargetName = targetName;
     m_strContent    = content;
     m_ContentPos    = contentPos;
     m_CallBackFunc -= callBack;
     m_CallBackFunc += callBack;
     m_bForce        = force;
     m_bAllowFail    = allowFail;
     m_iID           = id;
 }
Esempio n. 19
0
    public void AddTimeImage(Image img, float time, float fill, CallBackFunc fun, Text t = null, bool bHaveBtn = false, string userdata = "", GameObject hideObjOnRemove = null)
    {
        img.fillAmount = fill;

        m_PreRemoveImgList.Remove(img);

        if (!m_TimeImageDict.ContainsKey(img))
        {
            CountdownImgInfo info = new CountdownImgInfo();
            info.time            = time;
            info.callFuc         = fun;
            info.text            = t;
            info.hideObjOnRemove = hideObjOnRemove;
            info.userdata        = userdata;
            if (bHaveBtn)
            {
                Button[] btns = img.transform.parent.GetComponentsInChildren <Button>();
                if (btns.Length > 0)
                {
                    btns[0].onClick.RemoveAllListeners();
                    btns[0].onClick.AddListener(() =>
                    {
                        fun(1, true, img, info.userdata);
                        m_PreRemoveImgList.Add(img);
                    });
                }
                if (btns.Length > 1)
                {
                    btns[1].onClick.RemoveAllListeners();
                    btns[1].onClick.AddListener(() =>
                    {
                        fun(0, true, img, info.userdata);
                        m_PreRemoveImgList.Add(img);
                    });
                }
            }
            m_TimeImageDict.Add(img, info);
        }
        else
        {
            CountdownImgInfo info = m_TimeImageDict[img];
            info.time            = time;
            info.callFuc         = fun;
            info.text            = t;
            info.hideObjOnRemove = hideObjOnRemove;
            info.userdata        = userdata;
            m_TimeImageDict[img] = info;
        }
    }
Esempio n. 20
0
    protected IEnumerator CheckVideoFinish(string overAllState = null, CallBackFunc callback = null)
    {
        float time = (float)m_VideoPlayer.clip.length;

        yield return(new WaitForSeconds(time));

        if (overAllState != null)
        {
            m_UIMonitor.m_GameModel.overAllState = overAllState;
        }
        if (callback != null)
        {
            callback();
        }
    }
Esempio n. 21
0
 public static Message ShowOkBox(string text, CallBackFunc func = null)
 {
     if (mInstance)
     {
         Message msg = new Message();
         msg.mType     = MsgBoxType.Msg_OK;
         msg.mInfotype = MsgInfoType.NoticeOnly;
         msg.mContent  = text;
         msg.mOkFunc   = func;
         mInstance.mMsgs.Add(msg);
         mInstance.ResetMsgBox();
         return(msg);
     }
     return(null);
 }
Esempio n. 22
0
    /// <summary>
    /// ��ͨ��ȷ�Ͽ�
    /// </summary>
    /// <param name="tipsId">��ʾdataId</param>
    /// <returns></returns>
    public static bool OpenCustomConfirmUI(uint tipsId, CallBackFunc func = null, object[] values = null)
    {
        if (CustomConfirmObj == null)
        {
            AssetBundle bd = AssetBundleManager.GetAssetBundle(GameDefine.HallAssetbundleName);
            if (bd == null)
            {
                return(false);
            }
            CustomConfirmObj = GameMain.instantiate(bd.LoadAsset("Tips_Confirm") as Object) as GameObject;
        }
        TipsData tdata = CCsvDataManager.Instance.TipsDataMgr.GetTipsData(tipsId);

        if (tdata == null)
        {
            return(false);
        }
        ConfirmFuncCallBack = func;
        //����
        Text titleText = CustomConfirmObj.transform.Find("ImageBG").Find("TextTop").gameObject.GetComponent <Text>();

        titleText.text = tdata.TipsTitle;

        //����
        Text contentText = CustomConfirmObj.transform.Find("ImageBG").Find("ImageBG_01").
                           Find("TextContent").gameObject.GetComponent <Text>();

        if (values != null)
        {
            contentText.text = string.Format(tdata.TipsText, values);
        }
        else
        {
            contentText.text = tdata.TipsText;
        }

        //��ť
        GameObject okBtn = CustomConfirmObj.transform.Find("ImageBG").Find("ButtonOk").gameObject;

        XPointEvent.AutoAddListener(okBtn, CloseCustomConfirmUI, null);

        Transform canvastf = GameObject.Find("Canvas_1/Root").transform;

        CustomConfirmObj.transform.SetParent(canvastf, false);
        CustomConfirmObj.transform.SetAsLastSibling();
        CustomConfirmObj.SetActive(true);
        return(true);
    }
Esempio n. 23
0
        }     // W_AddFrd

        /// <summary>
        /// 单击添加按钮
        /// </summary>
        /// <param name="sender">the sender</param>
        /// <param name="e">the e</param>
        private void btn_add_Click(object sender, EventArgs e)
        {
            // 将要被添加的用户名
            string destName = cmBox_frdList.SelectedItem.ToString();

            // 调用网络服务添加好友
            addFrd.addFrd(userName, destName);

            Thread.Sleep(500);

            User currentUser = User.GetInstance();

            CallBackFunc.noChatSendData("addfrd", userName, destName, currentUser.socket);

            this.DialogResult = DialogResult.OK;
        } // btn_add_Click
Esempio n. 24
0
    /// <summary>
    /// ��ͨ�öԻ���
    /// </summary>
    /// <param name="titletxt">�����ı�</param>
    /// <param name="callbackfunc">��ť�����Ļص�����</param>
    /// <param name="contenttxt">��ʾ����</param>
    /// <returns></returns>
    public static bool OpenCustomDialogUI(string contenttxt, CallBackFunc callbackfunc, string titletxt = null)
    {
        if (CustomDialogObj == null)
        {
            AssetBundle bd = AssetBundleManager.GetAssetBundle(GameDefine.HallAssetbundleName);
            if (bd == null)
            {
                return(false);
            }
            CustomDialogObj = GameMain.instantiate(bd.LoadAsset("Tips_Dialog") as Object) as GameObject;
        }
        DialogFuncCallBack = callbackfunc;
        //����
        Text titleText = CustomDialogObj.transform.Find("ImageBG").Find("TextTop").gameObject.GetComponent <Text>();

        if (titleText == null)
        {
            titleText.text = "��ʾ";
        }
        else
        {
            titleText.text = titletxt;
        }

        //����
        Text contentText = CustomDialogObj.transform.Find("ImageBG").Find("ImageBG_01").
                           Find("TextContent").gameObject.GetComponent <Text>();

        contentText.text = contenttxt;

        //��ť
        GameObject okBtn = CustomDialogObj.transform.Find("ImageBG").Find("ButtonOk").gameObject;

        XPointEvent.AutoAddListener(okBtn, OnDialogUIBtnClick, 1);

        GameObject cancelBtn = CustomDialogObj.transform.Find("ImageBG").Find("ButtonCancel").gameObject;

        XPointEvent.AutoAddListener(cancelBtn, OnDialogUIBtnClick, 0);

        Transform canvastf = GameObject.Find("Canvas_1/Root").transform;

        CustomDialogObj.transform.SetParent(canvastf, false);
        CustomDialogObj.transform.SetAsLastSibling();
        CustomDialogObj.SetActive(true);

        return(true);
    }
Esempio n. 25
0
    public static Message ShowYNBox(string text, CallBackFunc yesFunc = null, CallBackFunc noFunc = null)
    {
        if (mInstance)
        {
            Message msg = new Message();
            msg.mType     = MsgBoxType.Msg_YN;
            msg.mInfotype = MsgInfoType.NoticeOnly;
            msg.mContent  = text;
            msg.mYesFunc  = yesFunc;
            msg.mNoFunc   = noFunc;
            mInstance.mMsgs.Add(msg);
            mInstance.ResetMsgBox();
            return(msg);
        }

        return(null);
    }
Esempio n. 26
0
 public void ToAddMessagesLabel(UsCtrlExInfors lmp, CallBackFunc CallBack)
 {
     if (lmp.LayerType == ScreenShotCutLib.Enums.EnLayerType.Label)
     {
         if (string.IsNullOrEmpty(lmp.ControlName?.Trim()))
         {
             AddMessagesCallBack = CallBack;
             CtrlExInfor         = lmp;
             Switcher.IsAddingOrEditingMessageLabel = true;
         }
         else
         {
             AddMessagesLable(lmp as UsLabelExInfors);
             CallBack?.Invoke();
         }
     }
     else
     {
         CallBack?.Invoke();
     }
 }
Esempio n. 27
0
        }     // findAddMsg

        /// <summary>
        /// 单击退出按钮
        /// </summary>
        /// <param name="sender"> the sender</param>
        /// <param name="e"> the e</param>
        private void btn_exit_Click(object sender, EventArgs e)
        {
            IMSLogStateChangeClient IsLog = new IMSLogStateChangeClient();
            string loginResault           = IsLog.changeLogState(userName, userPwd, true);
            User   currentUser            = User.GetInstance();

            try
            {
                if (loginResault == "1")
                {
                    // 断开连接
                    if (currentUser.socket == null)
                    {
                        return;
                    }
                    if (!currentUser.socket.Connected)
                    {
                        return;
                    }
                    CallBackFunc.noChatSendData("logout", userName, "", currentUser.socket);
                    Thread.Sleep(2000);
                    SocketHandler.ShutDownConn(currentUser.socket);
                    MessageBox.Show("成功退出");
                    Application.Exit();
                } // if
                else if (loginResault == "0")
                {
                    MessageBox.Show("未登录,无法退出");
                }
                else
                {
                    MessageBox.Show("用户名或密码错误");
                } // else
            }     // try
            catch (System.Exception ex)
            {
                // the last client will be wrong when exit
                Application.Exit();
            }
        } // btn_exit_Click
Esempio n. 28
0
        void init(SendType type, int clients)
        {
            _listener  = null;
            _sendType  = type;
            _totalSize = new int[clients];
            //_sh = null;
            _client          = new TcpClient[clients];
            _recvThreads     = new Thread[clients];
            _isEndServer     = true;
            _isEndConnection = new bool[clients];
            _callBackFunc    = null;
            _queue           = new BufferQueue[clients];
            _functions       = new InterfaceFunctions[clients];

            for (int i = 0; i < clients; i++)
            {
                _client[i]          = null;
                _queue[i]           = new BufferQueue();
                _functions[i]       = new InterfaceFunctions(this, _queue[i]);
                _totalSize[i]       = 0;
                _isEndConnection[i] = false;
            }
        }
Esempio n. 29
0
 public void removeFuncInLoop()
 {
     _callBackFunc = null;
 }
Esempio n. 30
0
 public void setFuncInLoop(CallBackFunc callBackFunc)
 {
     _callBackFunc = callBackFunc;
 }
Esempio n. 31
0
 public void ToAddMessagesLabel(UsCtrlExInfors lmp, CallBackFunc callBack)
 {
     UsCtrlBackGroundImage.ToAddMessagesLabel(lmp, callBack);
 }
Esempio n. 32
0
 public UdpServerBase(SendType type = SendType.Normal)
 {
     _sendType        = type;
     _isEndConnection = true;
     _callBackFunc    = null;
 }
Esempio n. 33
0
 public static extern void RegisterCallBack(CallBackFunc call_back);