Inheritance: MonoBehaviour
Example #1
0
        /// <summary>
        /// Add a action with no argument.
        /// </summary>
        public void AddAction(Action<GameObject> action)
        {
            Notify notify = new Notify();
            notify.action = action;

            m_actions.Add(notify);
        }
Example #2
0
 void GenerateEvent()
 {
     var n = new Notify(PinDriver.UPDATE_EVENT_NAME, PinDriver.DRIVER_NAME);
     n.AddParameter(PinDriver.PIN_PARAM_NAME, "punch");
     n.AddParameter(PinDriver.VALUE_PARAM_NAME, newValue.ToString());
     uOS.gateway.Notify(n, uOS.gateway.currentDevice);
 }
 //Create object.
 public static void create_object()
 {
     PSI = new ProcessInformation();
     TMD = new TrackMetadata();
     notify = new Notify();
     notify.createGrowlObject();
 }
Example #4
0
 void GenerateRepetitionsEvent()
 {
     var n = new Notify(PinDriver.UPDATE_EVENT_NAME, PinDriver.DRIVER_NAME);
     n.AddParameter(PinDriver.PIN_PARAM_NAME, "repetitions");
     n.AddParameter(PinDriver.VALUE_PARAM_NAME, 20.ToString());
     uOS.gateway.Notify(n, uOS.gateway.currentDevice);
     Debug.Log("Repetitions event");
 }
Example #5
0
        private IPattern ChoosePattern(INotifyAction action, string senderName, Notify.Engine.NotifyRequest request)
        {
            if (action == NotifyConstants.Event_ShareDocument
                || action == NotifyConstants.Event_UpdateDocument)
                return ActionPatternProvider.GetPattern(action, senderName);

            return null;
        }
Example #6
0
 public FullView(MainWindow main)
 {
     InitializeComponent();
     this.main = main;
     StartPosition = FormStartPosition.CenterScreen;
     notify = note;
     progresser = updateProgress;
 }
Example #7
0
 private IPattern ChoosePattern(INotifyAction action, string senderName, Notify.Engine.NotifyRequest request)
 {
     if (action == NotifyConstants.Event_NewCommentForMessage)
     {
         var tag = request.Arguments.Find(tv => tv.Tag.Name == "EventType");
         if (tag != null) return ActionPatternProvider.GetPattern(new NotifyAction(Convert.ToString(tag.Value), ""), senderName);
     }
     return null;
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        SortedDictionary<string, string> sPara = GetRequestGet();

        if (sPara.Count > 0)//判断是否有带返回参数
        {
            Notify aliNotify = new Notify();
            bool verifyResult = aliNotify.Verify(sPara, Request.QueryString["notify_id"], Request.QueryString["sign"]);

            if (verifyResult)//验证成功
            {
                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //请在这里加上商户的业务逻辑程序代码

                //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                //获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表

                //商户订单号

                string out_trade_no = Request.QueryString["out_trade_no"];

                //支付宝交易号

                string trade_no = Request.QueryString["trade_no"];

                //交易状态
                string trade_status = Request.QueryString["trade_status"];

                if (Request.QueryString["trade_status"] == "WAIT_SELLER_SEND_GOODS")
                {
                    //判断该笔订单是否在商户网站中已经做过处理
                    //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                    //如果有做过处理,不执行商户的业务程序
                }
                else
                {
                    Response.Write("trade_status=" + Request.QueryString["trade_status"]);
                }

                //打印页面
                Response.Write("验证成功<br />");

                //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
            }
            else//验证失败
            {
                Response.Write("验证失败");
            }
        }
        else
        {
            Response.Write("无返回参数");
        }
    }
Example #9
0
 public Replay(Race race,Renderer renderer,Notify updateStatistics, Notify updateTime)
 {
     _renderer = renderer;
     race.SetReplayTimes();
     _updateStatistics = updateStatistics;
     _updateTime = updateTime;
     _race = race;
     LoadBoats();
     _renderer.Initialize(this);
     Reset();
 }
Example #10
0
 public void Add(Notify fun)
 {
     lock (this)
     {
         if (!this.closed)
         {
             this.myList.Add(fun);
             this.available.Set();
         }
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        SortedDictionary<string, string> sPara = GetRequestGet();

        if (sPara.Count > 0)//判断是否有带返回参数
        {
            Notify aliNotify = new Notify();
            bool verifyResult = aliNotify.Verify(sPara, Request.QueryString["notify_id"], Request.QueryString["sign"]);

            if (verifyResult)//验证成功
            {
                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //请在这里加上商户的业务逻辑程序代码

                //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                //获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表
                string trade_no = Request.QueryString["trade_no"];              //支付宝交易号
                string order_no = Request.QueryString["out_trade_no"];	        //获取订单号
                string total_fee = Request.QueryString["total_fee"];            //获取总金额
                string subject = Request.QueryString["subject"];                //商品名称、订单名称
                string body = Request.QueryString["body"];                      //商品描述、订单备注、描述
                string buyer_email = Request.QueryString["buyer_email"];        //买家支付宝账号
                string trade_status = Request.QueryString["trade_status"];      //交易状态

                if (Request.QueryString["trade_status"] == "TRADE_FINISHED" || Request.QueryString["trade_status"] == "TRADE_SUCCESS")
                {
                    //判断该笔订单是否在商户网站中已经做过处理
                    //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                    //如果有做过处理,不执行商户的业务程序
                }
                else
                {
                    Response.Write("trade_status=" + Request.QueryString["trade_status"]);
                }

                //打印页面
                Response.Write("验证成功<br />");
                Response.Write("trade_no=" + trade_no);

                //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
            }
            else//验证失败
            {
                Response.Write("验证失败");
            }
        }
        else
        {
            Response.Write("无返回参数");
        }
    }
Example #12
0
    //Constructor for NameChangeTracker
    public NameChangeTracker(ToastForm myForm)
    {
        NameChangeTracker.myForm = myForm;
        psi = new ProcessInformation();
        tmd = new TrackMetadata();
        notify = new Notify();
        //Console.WriteLine(psi.getSpotifyPID());

        // Listen for name change changes for spotify(check pid!=0).
        hWinEventHook = SetWinEventHook(0x0800c, 0x800c, IntPtr.Zero, procDelegate, Convert.ToUInt32(psi.getSpotifyPID()), 0, 0);
        // Listen for create window event across all processes/threads on current desktop.(check pid=0)
        hWinEventHook_start = SetWinEventHook(0x00008000, 0x00008000, IntPtr.Zero, procDelegate_start, 0, 0, 0);
    }
        public SoundPlayer(Control owner, PullAudio pullAudio, short channels)
        {
            this.channels = channels;
            this.pullAudio = pullAudio;

            this.soundDevice = new Device();
            this.soundDevice.SetCooperativeLevel(owner, CooperativeLevel.Priority);

            // Set up our wave format to 44,100Hz, with 16 bit resolution
            WaveFormat wf = new WaveFormat();
            wf.FormatTag = WaveFormatTag.Pcm;
            wf.SamplesPerSecond = 44100;
            wf.BitsPerSample = 16;
            wf.Channels = channels;
            wf.BlockAlign = (short)(wf.Channels * wf.BitsPerSample / 8);
            wf.AverageBytesPerSecond = wf.SamplesPerSecond * wf.BlockAlign;

            this.samplesPerUpdate = 512;

            // Create a buffer with 2 seconds of sample data
            BufferDescription bufferDesc = new BufferDescription(wf);
            bufferDesc.BufferBytes = this.samplesPerUpdate * wf.BlockAlign * 2;
            bufferDesc.ControlPositionNotify = true;
            bufferDesc.GlobalFocus = true;

            this.soundBuffer = new SecondaryBuffer(bufferDesc, this.soundDevice);

            Notify notify = new Notify(this.soundBuffer);

            fillEvent[0] = new AutoResetEvent(false);
            fillEvent[1] = new AutoResetEvent(false);

            // Set up two notification events, one at halfway, and one at the end of the buffer
            BufferPositionNotify[] posNotify = new BufferPositionNotify[2];
            posNotify[0] = new BufferPositionNotify();
            posNotify[0].Offset = bufferDesc.BufferBytes / 2 - 1;
            posNotify[0].EventNotifyHandle = fillEvent[0].Handle;
            posNotify[1] = new BufferPositionNotify();
            posNotify[1].Offset = bufferDesc.BufferBytes - 1;
            posNotify[1].EventNotifyHandle = fillEvent[1].Handle;

            notify.SetNotificationPositions(posNotify);

            this.thread = new Thread(new ThreadStart(SoundPlayback));
            this.thread.Priority = ThreadPriority.Highest;

            this.Pause();
            this.running = true;

            this.thread.Start();
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        SortedDictionary<string, string> sPara = GetRequestPost();

        if (sPara.Count > 0)//判断是否有带返回参数
        {
            Notify aliNotify = new Notify();
            bool verifyResult = aliNotify.Verify(sPara, Request.Form["notify_id"], Request.Form["sign"]);

            if (verifyResult)//验证成功
            {
                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //请在这里加上商户的业务逻辑程序代码

                //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表

                //获取批次号
                string batch_no = Request.Form["batch_no"];

                //获取批量退款数据中转账成功的笔数
                string success_num = Request.Form["success_num"];

                //获取批量退款数据中的详细信息
                string result_details = Request.Form["result_details"];
                //格式:第一笔交易#第二笔交易#第三笔交易
                //第N笔交易格式:交易退款信息
                //交易退款信息格式:原付款支付宝交易号^退款总金额^处理结果码^结果描述

                //判断是否在商户网站中已经做过了这次通知返回的处理(可参考“集成教程”中“3.4返回数据处理”)
                    //如果没有做过处理,那么执行商户的业务程序
                    //如果有做过处理,那么不执行商户的业务程序

                Response.Write("success");  //请不要修改或删除

                //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
            }
            else//验证失败
            {
                Response.Write("fail");
            }
        }
        else
        {
            Response.Write("无通知参数");
        }
    }
Example #15
0
        public DirectSound(Control mainForm, int device,
            int samplesPerSecond, short bitsPerSample, short channels,
            int bufferSize, int bufferCount)
        {
            _fillQueue = new Queue(bufferCount);
            _playQueue = new Queue(bufferCount);
            for (int i = 0; i < bufferCount; i++)
                _fillQueue.Enqueue(new byte[bufferSize]);

            _bufferSize = bufferSize;
            _bufferCount = bufferCount;
            _zeroValue = bitsPerSample == 8 ? (byte)128 : (byte)0;

            _device = new Device();
            _device.SetCooperativeLevel(mainForm, CooperativeLevel.Priority);

            WaveFormat wf = new WaveFormat();
            wf.FormatTag = WaveFormatTag.Pcm;
            wf.SamplesPerSecond = samplesPerSecond;
            wf.BitsPerSample = bitsPerSample;
            wf.Channels = channels;
            wf.BlockAlign = (short)(wf.Channels * (wf.BitsPerSample / 8));
            wf.AverageBytesPerSecond = (int)wf.SamplesPerSecond * (int)wf.BlockAlign;

            // Create a buffer
            BufferDescription bufferDesc = new BufferDescription(wf);
            bufferDesc.BufferBytes = _bufferSize * _bufferCount;
            bufferDesc.ControlPositionNotify = true;
            bufferDesc.GlobalFocus = true;

            _soundBuffer = new SecondaryBuffer(bufferDesc, _device);

            _notify = new Notify(_soundBuffer);
            BufferPositionNotify[] posNotify = new BufferPositionNotify[_bufferCount];
            for (int i = 0; i < posNotify.Length; i++)
            {
                posNotify[i] = new BufferPositionNotify();
                posNotify[i].Offset = i * _bufferSize;
                posNotify[i].EventNotifyHandle = _fillEvent.SafeWaitHandle.DangerousGetHandle();
            }
            _notify.SetNotificationPositions(posNotify);

            _waveFillThread = new Thread(new ThreadStart(waveFillThreadProc));
            _waveFillThread.IsBackground = true;
            _waveFillThread.Name = "Wave fill thread";
            _waveFillThread.Priority = ThreadPriority.Highest;
            _waveFillThread.Start();
        }
Example #16
0
    // Use this for initialization
    void Start()
    {
        instance = this;

        notifyGuiImage = Resources.Load<Sprite>("Sprites/Notify");
        textMaterial = Resources.Load<Material>("Fonts/HelveticaNeue");
        textFont = Resources.Load<Font>("Fonts/HelveticaNeue");

        width = notifyGuiImage.bounds.size.x;
        height = notifyGuiImage.bounds.size.y;

        worldScreenHeight = Camera.main.orthographicSize * 1.0f;
        worldScreenWidth = Camera.main.orthographicSize * 1.0f / Screen.height * Screen.width;

        notifyGuiScale = new Vector3(worldScreenWidth / width , worldScreenHeight / height / 4 , 1);
    }
Example #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Dictionary<string, string> sPara = GetRequestGet();

        if (sPara.Count > 0)//判断是否有带返回参数
        {
            Notify aliNotify = new Notify();
            bool verifyResult = aliNotify.VerifyReturn(sPara, Request.QueryString["sign"]);

            if (verifyResult)//验证成功
            {
                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //请在这里加上商户的业务逻辑程序代码

                //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                //获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表

                //商户订单号
                string out_trade_no = Request.QueryString["out_trade_no"];

                //支付宝交易号
                string trade_no = Request.QueryString["trade_no"];

                //交易状态
                string result = Request.QueryString["result"];

                //判断是否在商户网站中已经做过了这次通知返回的处理
                //如果没有做过处理,那么执行商户的业务程序
                //如果有做过处理,那么不执行商户的业务程序

                //打印页面
                Response.Write("验证成功<br />");

                //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
            }
            else//验证失败
            {
                Response.Write("验证失败");
            }
        }
        else
        {
            Response.Write("无返回参数");
        }
    }
Example #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SortedDictionary<string, string> sPara = GetRequestPost();

        if (sPara.Count > 0)//判断是否有带返回参数
        {
            Notify aliNotify = new Notify();
            bool verifyResult = aliNotify.Verify(sPara, Request.Form["notify_id"], Request.Form["sign"]);

            if (verifyResult)//验证成功
            {
                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //请在这里加上商户的业务逻辑程序代码

                //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表

                //商户网站唯一订单号
                string out_trade_no = Request.Form["out_trade_no"];
                //对应商户网站的订单系统中的唯一订单号

                //交易状态
                string trade_status = Request.Form["trade_status"];
                //交易目前所处的状态(例如:TRADE_SUCCESS)

                //判断是否在商户网站中已经做过了这次通知返回的处理
                //如果没有做过处理,那么执行商户的业务程序
                //如果有做过处理,那么不执行商户的业务程序

                Response.Write("success");  //请不要修改或删除

                //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
            }
            else//验证失败
            {
                Response.Write("fail");
            }
        }
        else
        {
            Response.Write("无通知参数");
        }
    }
Example #19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SortedDictionary<string, string> sPara = GetRequestGet();

        if (sPara.Count > 0)//判断是否有带返回参数
        {
            Notify aliNotify = new Notify();
            bool verifyResult = aliNotify.Verify(sPara, Request.QueryString["notify_id"], Request.QueryString["sign"]);

            if (verifyResult)//验证成功
            {
                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //请在这里加上商户的业务逻辑程序代码

                //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                //获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表

                //支付宝用户号
                string user_id = Request.QueryString["user_id"];

                //授权令牌
                string token = Request.QueryString["token"];

                //判断是否在商户网站中已经做过了这次通知返回的处理
                //如果没有做过处理,那么执行商户的业务程序
                //如果有做过处理,那么不执行商户的业务程序

                //打印页面
                Response.Write("验证成功<br />");

                //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
            }
            else//验证失败
            {
                Response.Write("验证失败");
            }
        }
        else
        {
            Response.Write("无返回参数");
        }
    }
Example #20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SortedDictionary<string, string> sPara = GetRequestPost();

        if (sPara.Count > 0)//判断是否有带返回参数
        {
            Notify aliNotify = new Notify();
            bool verifyResult = aliNotify.Verify(sPara, Request.Form["notify_id"], Request.Form["sign"]);

            if (verifyResult)//验证成功
            {
                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //请在这里加上商户的业务逻辑程序代码

                //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表

                //批量付款数据中转账成功的详细信息
                string success_details = Request.Form["success_details"];

                //批量付款数据中转账失败的详细信息
                string fail_details = Request.Form["fail_details"];

                //判断是否在商户网站中已经做过了这次通知返回的处理
                //如果没有做过处理,那么执行商户的业务程序
                //如果有做过处理,那么不执行商户的业务程序

                Response.Write("success");  //请不要修改或删除

                //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
            }
            else//验证失败
            {
                Response.Write("fail");
            }
        }
        else
        {
            Response.Write("无通知参数");
        }
    }
Example #21
0
        private void CreateNotifyPositions()
        {
            try
            {
                autoResetEvent = new AutoResetEvent(false);
                notify = new Notify(captureBuffer);
                BufferPositionNotify bufferPositionNotify1 = new BufferPositionNotify();
                bufferPositionNotify1.Offset = bufferSize / 2 - 1;
                bufferPositionNotify1.EventNotifyHandle = autoResetEvent.SafeWaitHandle.DangerousGetHandle();
                BufferPositionNotify bufferPositionNotify2 = new BufferPositionNotify();
                bufferPositionNotify2.Offset = bufferSize - 1;
                bufferPositionNotify2.EventNotifyHandle = autoResetEvent.SafeWaitHandle.DangerousGetHandle();

                notify.SetNotificationPositions(new BufferPositionNotify[] { bufferPositionNotify1, bufferPositionNotify2 });
            }
            catch (Exception ex)
            {
               // MessageBox.Show(ex.Message, "VoiceChat-CreateNotifyPositions ()", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #22
0
        private void FourierSpectrumAnalysis(object o)
        {
            try
            {
                double[][] data = FourierWindows.Calculate(FourierWindows.SplitData(this.Channel, 2048), this.SelectedWindowType, float.Parse(this.Sigma));
                int[]      freq = new int[data.Length];
                for (int i = 0; i < freq.Length; i++)
                {
                    double[] data2 = new double[data[i].Length];
                    for (int j = 0; j < data[i].Length; j++)
                    {
                        if (j != 0)
                        {
                            data2[j] = data[i][j] - 0.94 * data[i][j - 1];
                        }
                        else
                        {
                            data2[j] = data[i][j];
                        }
                    }

                    List <Complex> signal = new List <Complex>();
                    for (int j = 0; j < data2.Length; j++)
                    {
                        signal.Add(new Complex(data2[j], 0));
                    }
                    List <Complex> dft = AMath.CalculateFastTransform(signal, AMath.CalculateWCoefficients(data2.Length, false), 0);
                    dft.RemoveRange(dft.Count / 2, dft.Count / 2);

                    double[] spectrum = new double[dft.Count];
                    for (int j = 0; j < spectrum.Length; j++)
                    {
                        spectrum[j] = Math.Sqrt((dft[j].Re * dft[j].Re) + (dft[j].Im * dft[j].Im));
                    }

                    List <int> max = new List <int>();
                    for (int j = 1; j < spectrum.Length - 1; j++)
                    {
                        if (spectrum[j - 1] < spectrum[j] && spectrum[j + 1] < spectrum[j])
                        {
                            max.Add(j);
                        }
                    }

                    int    globalMax    = 0;
                    double globalMaxVal = 0;
                    for (int j = 0; j < max.Count; j++)
                    {
                        int    index = max[j];
                        double value = spectrum[index];
                        if (value > globalMaxVal)
                        {
                            globalMax    = index;
                            globalMaxVal = value;
                        }
                    }

                    double     border   = 0.2 * globalMaxVal;
                    List <int> bordered = new List <int>();
                    for (int j = 0; j < max.Count; j++)
                    {
                        if (spectrum[max[j]] >= border)
                        {
                            bordered.Add(max[j]);
                        }
                    }

                    double median;
                    if (bordered.Count > 1)
                    {
                        List <double> differences = new List <double>();
                        for (int j = 0; j < max.Count - 1; j++)
                        {
                            for (int k = j + 1; k < max.Count; k++)
                            {
                                differences.Add(Math.Abs(max[j] - max[k]));
                            }
                        }
                        differences.Sort();

                        if (differences.Count != 1)
                        {
                            if (differences.Count % 2 == 0)
                            {
                                median = differences[differences.Count / 2];
                            }
                            else
                            {
                                int half = (differences.Count - 1) / 2;
                                median = (differences[half] + differences[half + 1]) / 2;
                            }
                        }
                        else
                        {
                            median = differences[0];
                        }
                    }
                    else
                    {
                        median = bordered[0];
                    }

                    freq[i] = Convert.ToInt32((this.SampleRate / data[i].Length) * median);
                }
                this.FourierFreq = freq;
            }
            catch (Exception e)
            {
                Notify.Error(e.Message);
            }
        }
Example #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SortedDictionary <string, string> sPara = GetRequestGet();

            if (sPara.Count > 0)//判断是否有带返回参数
            {
                Notify aliNotify    = new Notify();
                bool   verifyResult = aliNotify.Verify(sPara, Request.QueryString["notify_id"], Request.QueryString["sign"]);

                if (verifyResult)//验证成功
                {
                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                    //请在这里加上商户的业务逻辑程序代码


                    //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                    //获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表

                    //商户订单号

                    string out_trade_no = Request.QueryString["out_trade_no"];

                    //支付宝交易号

                    string trade_no = Request.QueryString["trade_no"];

                    //交易状态
                    string trade_status = Request.QueryString["trade_status"];


                    if (Request.QueryString["trade_status"] == "WAIT_SELLER_SEND_GOODS")
                    {
                        //判断该笔订单是否在商户网站中已经做过处理
                        //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                        //如果有做过处理,不执行商户的业务程序
                    }
                    else
                    {
                        Response.Write("trade_status=" + Request.QueryString["trade_status"]);
                    }

                    //打印页面
                    ClassLibrary.BLL.Orders obll = new ClassLibrary.BLL.Orders();

                    obll.Updates("Status='" + ClassLibrary.Common.SysConfig.OrderType.已付款处理中.ToString() + "'", "OrderNumber='" + out_trade_no + "'");

                    Response.Redirect("/success.aspx?order=" + out_trade_no + "&status=true");

                    //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                }
                else//验证失败
                {
                    //lbVerify.Text = "验证失败";
                    Response.Redirect("/success.aspx?order=" + Request.QueryString["out_trade_no"] + "&status=false");
                }
            }
            else
            {
                //lbVerify.Text = "无返回参数";
                Response.Redirect("/success.aspx?order=" + Request.QueryString["out_trade_no"] + "&status=false");
            }
        }
Example #24
0
 /// <summary>Raises the <see cref="Notify" /> event</summary>
 protected virtual void OnNotify(SvnNotifyEventArgs e)
 {
     Notify?.Invoke(this, e);
 }
Example #25
0
 public override int SaveChanges()
 {
     Notify?.Invoke("");
     return(base.SaveChanges());
 }
Example #26
0
 public void RaschetStuff()
 {
     Doxod     = -Stuff.Rasxod;
     allMoney += Doxod;
     Notify?.Invoke($"Added to all money: {Doxod}");
 }
Example #27
0
 bool ShowNotifyYes()
 {
     Notify.Template("NotifyTemplateAutoHide").Show("Action on 'Yes' button click.", customHideDelay: 3f);
     return(true);
 }
Example #28
0
 private void OnRemove(int id)
 {
     Notify?.Invoke(this, new CacheEventArgs(CacheEventArgs.CacheOperation.Remove, id));
 }
Example #29
0
 private void OnAdd(int id)
 {
     Notify?.Invoke(this, new CacheEventArgs(CacheEventArgs.CacheOperation.Add, id));
 }
Example #30
0
        protected override void OnInvoke(RtmpConnection connection, RtmpChannel channel, RtmpHeader header, Notify invoke)
        {
            IServiceCall call = invoke.ServiceCall;

            if (invoke.EventType == EventType.STREAM_DATA)
            {
#if !SILVERLIGHT
                if (Log.IsDebugEnabled)
                {
                    Log.Debug(string.Format("Ignoring stream data notify with header {0}", header));
                }
#endif
                return;
            }

            if (call.ServiceMethodName == "_result" || call.ServiceMethodName == "_error")
            {
                if (call.ServiceMethodName == "_error")
                {
                    call.Status = Messaging.Rtmp.Service.Call.STATUS_INVOCATION_EXCEPTION;
                }
                if (call.ServiceMethodName == "_result")
                {
                    call.Status = Messaging.Rtmp.Service.Call.STATUS_SUCCESS_RESULT;
                }
                //Get the panding call, if any, as HandlePendingCallResult will remove it
                IPendingServiceCall pendingCall = connection.GetPendingCall(invoke.InvokeId);
                HandlePendingCallResult(connection, invoke);

                if (call.IsSuccess && invoke.InvokeId == 1)
                {
                    // Should keep this as an Object to stay compatible with FMS3 etc
                    IDictionary aso = call.Arguments[0] as IDictionary;
                    if (aso != null)
                    {
                        object clientId = null;
                        if (aso.Contains("clientid"))
                        {
                            clientId = aso["clientid"];
                        }
#if !SILVERLIGHT
                        if (Log.IsDebugEnabled)
                        {
                            Log.Debug(string.Format("Client id: {0}", clientId));
                        }
#endif
                        _netConnection.SetClientId(clientId != null ? clientId.ToString() : null);
                    }
                }

                //Notify via NetConnection if no IPendingServiceCallback was defined but the call failed
                if (call.ServiceMethodName == "_error")
                {
                    object[] args      = call.Arguments;
                    ASObject statusAso = null;
                    if ((args != null) && (args.Length > 0))
                    {
                        statusAso = args[0] as ASObject;
                    }
                    bool raiseError = false;
                    if (pendingCall != null)
                    {
                        IPendingServiceCallback[] callbacks = pendingCall.GetCallbacks();
                        if (callbacks == null || callbacks.Length == 0)
                        {
                            raiseError = true;
                        }
                    }
                    else
                    {
                        raiseError = true;
                    }
                    if (raiseError)
                    {
                        if (statusAso != null)
                        {
                            _netConnection.RaiseNetStatus(statusAso);
                        }
                        else
                        {
                            string msg = __Res.GetString(__Res.Invocation_Failed, pendingCall != null ? pendingCall.ServiceMethodName : string.Empty, "Invocation failed");
                            _netConnection.RaiseNetStatus(msg);
                        }
                    }
                }
                return;
            }

            bool onStatus = call.ServiceMethodName.Equals("onStatus") || call.ServiceMethodName.Equals("onMetaData") ||
                            call.ServiceMethodName.Equals("onPlayStatus");
            if (onStatus)
            {
                /*
                 * IDictionary aso = call.Arguments[0] as IDictionary;
                 * // Should keep this as an Object to stay compatible with FMS3 etc
                 * object clientId = null;
                 * if( aso.Contains("clientid") )
                 *  clientId = aso["clientid"];
                 * if (clientId == null)
                 *  clientId = header.StreamId;
                 #if !SILVERLIGHT
                 * if (log.IsDebugEnabled)
                 *  log.Debug(string.Format("Client id: {0}", clientId));
                 #endif
                 * if (clientId != null)
                 * {
                 *  NetStream stream = _connection.GetStreamById((int)clientId) as NetStream;
                 *  if (stream != null)
                 *  {
                 *      stream.OnStreamEvent(invoke);
                 *  }
                 * }
                 */
                NetStream stream = _connection.GetStreamById(header.StreamId) as NetStream;
                if (stream != null)
                {
                    stream.OnStreamEvent(invoke);
                }
                return;
            }

            if (call is IPendingServiceCall)
            {
                IPendingServiceCall psc = call as IPendingServiceCall;

                /*
                 * object result = psc.Result;
                 * object result = psc.Result;
                 * if (result is DeferredResult)
                 * {
                 *  DeferredResult dr = result as DeferredResult;
                 *  dr.InvokeId = invoke.InvokeId;
                 *  dr.ServiceCall = psc;
                 *  dr.Channel = channel;
                 *  connection.RegisterDeferredResult(dr);
                 * }
                 * else
                 * {
                 *  Invoke reply = new Invoke();
                 *  reply.ServiceCall = call;
                 *  reply.InvokeId = invoke.InvokeId;
                 *  channel.Write(reply);
                 * }
                 */
                MethodInfo mi = MethodHandler.GetMethod(_netConnection.Client.GetType(), call.ServiceMethodName, call.Arguments, false, false);
                if (mi != null)
                {
                    ParameterInfo[] parameterInfos = mi.GetParameters();
                    object[]        args           = new object[parameterInfos.Length];
                    call.Arguments.CopyTo(args, 0);
                    TypeHelper.NarrowValues(args, parameterInfos);
                    try
                    {
                        InvocationHandler invocationHandler = new InvocationHandler(mi);
                        object            result            = invocationHandler.Invoke(_netConnection.Client, args);
                        if (mi.ReturnType == typeof(void))
                        {
                            call.Status = Messaging.Rtmp.Service.Call.STATUS_SUCCESS_VOID;
                        }
                        else
                        {
                            call.Status = result == null ? Messaging.Rtmp.Service.Call.STATUS_SUCCESS_NULL : Messaging.Rtmp.Service.Call.STATUS_SUCCESS_RESULT;
                            psc.Result  = result;
                        }
                    }
                    catch (Exception exception)
                    {
                        call.Exception = exception;
                        call.Status    = Messaging.Rtmp.Service.Call.STATUS_INVOCATION_EXCEPTION;
                        //log.Error("Error while invoking method " + call.ServiceMethodName + " on client", exception);
                    }
                }
                else// if (!onStatus)
                {
                    string msg = __Res.GetString(__Res.Invocation_NoSuitableMethod, call.ServiceMethodName, _netConnection.Client.GetType().Name);
                    call.Status    = Messaging.Rtmp.Service.Call.STATUS_METHOD_NOT_FOUND;
                    call.Exception = new FluorineException(msg);
                    _netConnection.RaiseNetStatus(call.Exception);

                    //log.Error(msg, call.Exception);
                }
                if (call.Status == Messaging.Rtmp.Service.Call.STATUS_SUCCESS_VOID || call.Status == Messaging.Rtmp.Service.Call.STATUS_SUCCESS_NULL)
                {
#if !SILVERLIGHT
                    if (Log.IsDebugEnabled)
                    {
                        Log.Debug("Method does not have return value, do not reply");
                    }
#endif
                    return;
                }
                Invoke reply = new Invoke();
                reply.ServiceCall = call;
                reply.InvokeId    = invoke.InvokeId;
                channel.Write(reply);
            }
            else
            {
                IPendingServiceCall pendingCall = connection.RetrievePendingCall(invoke.InvokeId);
                Unreferenced.Parameter(pendingCall);
            }
        }
Example #31
0
        public static void callback_cityhallGuns(Client client, int index)
        {
            try
            {
                switch (index)
                {
                case 0:     //"stungun":
                    Fractions.Manager.giveGun(client, Weapons.Hash.StunGun, "stungun");
                    return;

                case 1:     //"pistol":
                    Fractions.Manager.giveGun(client, Weapons.Hash.Pistol, "pistol");
                    return;

                case 2:     //"assaultrifle":
                    Fractions.Manager.giveGun(client, Weapons.Hash.AdvancedRifle, "assaultrifle");
                    return;

                case 3:     //"gusenberg":
                    Fractions.Manager.giveGun(client, Weapons.Hash.Gusenberg, "gusenberg");
                    return;

                case 4:     //"armor":
                    if (!Manager.canGetWeapon(client, "armor"))
                    {
                        return;
                    }

                    var aItem = nInventory.Find(Main.Players[client].UUID, ItemType.BodyArmor);
                    if (aItem != null)
                    {
                        Notify.Send(client, NotifyType.Error, NotifyPosition.BottomCenter, "У Вас уже есть бронежилет", 3000);
                        return;
                    }
                    nInventory.Add(client, new nItem(ItemType.BodyArmor, 1, 100.ToString()));
                    GameLog.Stock(Main.Players[client].FractionID, Main.Players[client].UUID, "armor", 1, false);
                    Notify.Send(client, NotifyType.Success, NotifyPosition.BottomCenter, $"Вы получили бронежилет", 3000);
                    return;

                case 5:
                    if (!Manager.canGetWeapon(client, "Medkits"))
                    {
                        return;
                    }

                    if (Fractions.Stocks.fracStocks[6].Medkits == 0)
                    {
                        Notify.Send(client, NotifyType.Error, NotifyPosition.BottomCenter, "На складе нет аптечек", 3000);
                        return;
                    }
                    var hItem = nInventory.Find(Main.Players[client].UUID, ItemType.HealthKit);
                    if (hItem != null)
                    {
                        Notify.Send(client, NotifyType.Error, NotifyPosition.BottomCenter, "У Вас уже есть аптечка", 3000);
                        return;
                    }
                    Fractions.Stocks.fracStocks[6].Medkits--;
                    Fractions.Stocks.fracStocks[6].UpdateLabel();
                    nInventory.Add(client, new nItem(ItemType.HealthKit, 1));
                    GameLog.Stock(Main.Players[client].FractionID, Main.Players[client].UUID, "medkit", 1, false);
                    Notify.Send(client, NotifyType.Success, NotifyPosition.BottomCenter, $"Вы получили аптечку", 3000);
                    return;

                case 6:
                    if (!Manager.canGetWeapon(client, "PistolAmmo"))
                    {
                        return;
                    }
                    Fractions.Manager.giveAmmo(client, ItemType.PistolAmmo, 12);
                    return;

                case 7:
                    if (!Manager.canGetWeapon(client, "SMGAmmo"))
                    {
                        return;
                    }
                    Fractions.Manager.giveAmmo(client, ItemType.SMGAmmo, 30);
                    return;

                case 8:
                    if (!Manager.canGetWeapon(client, "RiflesAmmo"))
                    {
                        return;
                    }
                    Fractions.Manager.giveAmmo(client, ItemType.RiflesAmmo, 30);
                    return;
                }
            }
            catch (Exception e) { Log.Write("Govgun: " + e.Message, nLog.Type.Error); }
        }
Example #32
0
        public static void interactPressed(Client player, int interact)
        {
            switch (interact)
            {
            case 3:
                if (Main.Players[player].FractionID == 6 && Main.Players[player].FractionLVL > 1)
                {
                    Doormanager.SetDoorLocked(player.GetData("DOOR"), !Doormanager.GetDoorLocked(player.GetData("DOOR")), 0);
                    string msg = "Вы открыли дверь";
                    if (Doormanager.GetDoorLocked(player.GetData("DOOR")))
                    {
                        msg = "Вы закрыли дверь";
                    }
                    Notify.Send(player, NotifyType.Success, NotifyPosition.BottomCenter, msg, 3000);
                }
                return;

            case 4:
                SafeMain.OpenSafedoorMenu(player);
                return;

            case 5:
                if (player.IsInVehicle)
                {
                    return;
                }
                if (player.HasData("FOLLOWING"))
                {
                    Notify.Send(player, NotifyType.Error, NotifyPosition.BottomCenter, $"Вас кто-то тащит за собой", 3000);
                    return;
                }
                if (player.Position.Z < 50)
                {
                    NAPI.Entity.SetEntityPosition(player, CityhallCheckpoints[3] + new Vector3(0, 0, 1.12));
                    Main.PlayerEnterInterior(player, CityhallCheckpoints[3] + new Vector3(0, 0, 1.12));
                }
                else
                {
                    NAPI.Entity.SetEntityPosition(player, CityhallCheckpoints[2] + new Vector3(0, 0, 1.12));
                    Main.PlayerEnterInterior(player, CityhallCheckpoints[2] + new Vector3(0, 0, 1.12));
                }
                return;

            case 62:
                if (Main.Players[player].FractionID != 6)
                {
                    Notify.Send(player, NotifyType.Error, NotifyPosition.BottomCenter, $"Вы не сотрудник полиции", 3000);
                    return;
                }
                if (!NAPI.Data.GetEntityData(player, "ON_DUTY"))
                {
                    Notify.Send(player, NotifyType.Error, NotifyPosition.BottomCenter, $"Вы должны начать рабочий день", 3000);
                    return;
                }
                if (!Stocks.fracStocks[6].IsOpen)
                {
                    Notify.Send(player, NotifyType.Error, NotifyPosition.BottomCenter, $"Склад закрыт", 3000);
                    return;
                }
                if (!Manager.canUseCommand(player, "openweaponstock"))
                {
                    return;
                }
                player.SetData("ONFRACSTOCK", 6);
                GUI.Dashboard.OpenOut(player, Stocks.fracStocks[6].Weapons, "Склад оружия", 6);
                return;
            }
        }
Example #33
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SortedDictionary <string, string> sPara = GetRequestPost();

            if (sPara.Count > 0)//判断是否有带返回参数
            {
                Notify aliNotify    = new Notify();
                bool   verifyResult = aliNotify.Verify(sPara, Request.Form["notify_id"], Request.Form["sign"]);

                if (verifyResult)//验证成功
                {
                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                    //请在这里加上商户的业务逻辑程序代码


                    //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                    //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表

                    //商户订单号

                    string out_trade_no = Request.Form["out_trade_no"];

                    //支付宝交易号

                    string trade_no = Request.Form["trade_no"];

                    //交易状态
                    string trade_status = Request.Form["trade_status"];


                    if (Request.Form["trade_status"] == "TRADE_FINISHED")
                    {
                        //判断该笔订单是否在商户网站中已经做过处理
                        //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                        //如果有做过处理,不执行商户的业务程序

                        //注意:
                        //退款日期超过可退款期限后(如三个月可退款),支付宝系统发送该交易状态通知
                    }
                    else if (Request.Form["trade_status"] == "TRADE_SUCCESS")
                    {
                        //判断该笔订单是否在商户网站中已经做过处理
                        //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                        //如果有做过处理,不执行商户的业务程序

                        //注意:
                        //付款完成后,支付宝系统发送该交易状态通知
                    }
                    else
                    {
                    }

                    //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                    Response.Write("success");  //请不要修改或删除

                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                }
                else//验证失败
                {
                    Response.Write("fail");
                }
            }
            else
            {
                Response.Write("无通知参数");
            }
        }
Example #34
0
 public void Updated()
 {
     Notify.Invoke();
 }
Example #35
0
 public void ShowNotifyAutohide()
 {
     Notify.Template("NotifyTemplateAutoHide").Show("Achievement unlocked. Hide after 3 seconds.", customHideDelay: 3f);
 }
Example #36
0
        private static void OnWowProcessStartup(object wowProcess)
        {
            try
            {
                WowProcess process = (WowProcess)wowProcess;
                log.Info($"{process} Attaching...");
                for (int i = 0; i < 600; i++)
                {
                    Thread.Sleep(100);
                    if (process.MainWindowHandle != IntPtr.Zero)
                    {
                        if (Settings2.Instance.WoWCustomizeWindow)
                        {
                            Task.Run(() =>
                            {
                                Thread.Sleep(1000); // because sometimes pause is needed
                                try
                                {
                                    if (Settings2.Instance.WoWCustomWindowNoBorder)
                                    {
                                        var styleWow = NativeMethods.GetWindowLong64(process.MainWindowHandle, Win32Consts.GWL_STYLE) & ~(Win32Consts.WS_CAPTION | Win32Consts.WS_THICKFRAME);
                                        NativeMethods.SetWindowLong64(process.MainWindowHandle, Win32Consts.GWL_STYLE, styleWow);
                                    }
                                    NativeMethods.MoveWindow(process.MainWindowHandle, Settings2.Instance.WoWCustomWindowRectangle.X, Settings2.Instance.WoWCustomWindowRectangle.Y,
                                                             Settings2.Instance.WoWCustomWindowRectangle.Width, Settings2.Instance.WoWCustomWindowRectangle.Height, false);
                                    log.Info($"{process} Window style is changed");
                                }
                                catch (Exception ex)
                                {
                                    log.Error($"{process} Window changing failed with error: {ex.Message}");
                                }
                            });
                        }
                        try
                        {
                            Utils.SetProcessPrioritiesToNormal(process.ProcessID); // in case we'are starting from Task Scheduler priorities can be lower than normal
                            process.Memory = new MemoryManager(Process.GetProcessById(process.ProcessID));
                            log.Info($"{process} Memory manager initialized, base address 0x{process.Memory.ImageBase.ToInt64():X}");
                            if (!process.IsValidBuild)
                            {
                                log.Info($"{process} Memory manager: invalid WoW executable");
                                Notify.TrayPopup("Incorrect WoW version", "Injector is locked, please wait for update", NotifyUserType.Warn, true);
                            }
                            WoWProcessReadyForInteraction?.Invoke(process);
                        }
                        catch (Exception ex)
                        {
                            log.Error($"{process} Memory manager initialization failed with error: {ex.Message}");
                        }

                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                Processes.TryRemove((wowProcess as WowProcess).ProcessID, out WowProcess pWowProcess);
                pWowProcess?.Dispose();
                log.Error($"{(wowProcess as WowProcess)}: {nameof(OnWowProcessStartup)}: general error: " + ex.Message);
            }
        }
Example #37
0
        public PlayerClass(AudioBookConverterMain Caller, string filename)
        {
            if (GetSourceExt(filename) != "mp3")
            {
                return;
            }
            file   = filename;
            Parent = Caller;
            Microsoft.DirectX.DirectSound.WaveFormat format = new Microsoft.DirectX.DirectSound.WaveFormat();

            WmaStream wmastr = new WmaStream(filename);

            format.BlockAlign            = wmastr.Format.nBlockAlign;
            format.Channels              = wmastr.Format.nChannels;
            format.SamplesPerSecond      = wmastr.Format.nSamplesPerSec;
            format.BitsPerSample         = wmastr.Format.wBitsPerSample;
            format.AverageBytesPerSecond = format.BlockAlign * format.SamplesPerSecond;
            wmastr.Dispose();

            BufferDescription desc = new BufferDescription(format);

            desc.ControlPan            = true;
            desc.GlobalFocus           = true;
            desc.BufferBytes           = 262144;
            desc.ControlPositionNotify = true;
            desc.CanGetCurrentPosition = true;
            desc.ControlVolume         = true;
            desc.StickyFocus           = true;
            desc.LocateInSoftware      = true;
            desc.ControlEffects        = false;
            desc.LocateInHardware      = false;
            desc.Control3D             = false;
            //MemoryStream bufferstream = new MemoryStream(262144);

            Device device = new Device();

            device.SetCooperativeLevel(Parent, CooperativeLevel.Priority);

            sound = new SecondaryBuffer(desc, device);
            sound.SetCurrentPosition(1);
            sound.Volume = 0;
            sound.Pan    = 0;

            BufferNotificationEvent = new AutoResetEvent(false);
            BufferNotify            = new Notify(sound);

            BufferPositionNotify[] BufferPositions = new BufferPositionNotify[2];

            BufferPositions[0].Offset            = 0;
            BufferPositions[0].EventNotifyHandle = BufferNotificationEvent.Handle;
            BufferPositions[1].Offset            = (desc.BufferBytes / 2);
            BufferPositions[1].EventNotifyHandle = BufferNotificationEvent.Handle;


            BufferNotify.SetNotificationPositions(BufferPositions);

            DataTransferThread = new Thread(new ThreadStart(WMDataFill));
            //if (GetSourceExt(filename) =="mp4") DataTransferThread = new Thread(new ThreadStart(FaadDataFill));
            //if (GetSourceExt(filename) =="flac") DataTransferThread = new Thread(new ThreadStart(FlacDataFill));
            //if (GetSourceExt(filename) =="ogg") DataTransferThread = new Thread(new ThreadStart(OggDataFill));
            DataTransferThread.Name     = "BufferFill";
            DataTransferThread.Priority = ThreadPriority.Highest;
            DataTransferThread.Start();
        }
Example #38
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SortedDictionary<string, string> sPara = GetRequestPost();

        if (sPara.Count > 0)//判断是否有带返回参数
        {
            Notify aliNotify = new Notify();
            bool verifyResult = aliNotify.Verify(sPara, Request.Form["notify_id"], Request.Form["sign"]);

            if (verifyResult)//验证成功
            {
                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //请在这里加上商户的业务逻辑程序代码

                //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表

                //商户订单号

                string out_trade_no = Request.Form["out_trade_no"];

                //支付宝交易号

                string trade_no = Request.Form["trade_no"];

                //交易状态
                string trade_status = Request.Form["trade_status"];

                if (Request.Form["trade_status"] == "WAIT_BUYER_PAY")
                {//该判断表示买家已在支付宝交易管理中产生了交易记录,但没有付款

                    //判断该笔订单是否在商户网站中已经做过处理
                    //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                    //如果有做过处理,不执行商户的业务程序

                    Response.Write("success");  //请不要修改或删除
                }
                else if (Request.Form["trade_status"] == "WAIT_SELLER_SEND_GOODS")
                {//该判断示买家已在支付宝交易管理中产生了交易记录且付款成功,但卖家没有发货

                    //判断该笔订单是否在商户网站中已经做过处理
                    //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                    //如果有做过处理,不执行商户的业务程序

                    Response.Write("success");  //请不要修改或删除
                }
                else if (Request.Form["trade_status"] == "WAIT_BUYER_CONFIRM_GOODS")
                {//该判断表示卖家已经发了货,但买家还没有做确认收货的操作

                    //判断该笔订单是否在商户网站中已经做过处理
                    //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                    //如果有做过处理,不执行商户的业务程序

                    Response.Write("success");  //请不要修改或删除
                }
                else if (Request.Form["trade_status"] == "TRADE_FINISHED")
                {//该判断表示买家已经确认收货,这笔交易完成

                    //判断该笔订单是否在商户网站中已经做过处理
                    //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                    //如果有做过处理,不执行商户的业务程序

                    Response.Write("success");  //请不要修改或删除
                }
                else
                {
                    Response.Write("success");  //其他状态判断。
                }

                //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
            }
            else//验证失败
            {
                Response.Write("fail");
            }
        }
        else
        {
            Response.Write("无通知参数");
        }
    }
Example #39
0
 public void RaschetMagaz()
 {
     Doxod     = Magazine.Viruchka - Magazine.Rasxod;
     allMoney += Doxod;
     Notify?.Invoke($"Added to all money: {Doxod}");
 }
Example #40
0
        public static NotifyProxy GetNotifyProxy(Notify notify)
        {
            if (notify == null)
                return null;

            NotifyProxy notifyProxy = new NotifyProxy();

            notifyProxy.NotifyID = notify.NotifyID;
            notifyProxy.Content = notify.Content;
            //notifyProxy.Url = notify.Url;
            notifyProxy.PostDate = notify.UpdateDate;
            notifyProxy.UserID = notify.UserID;
            notifyProxy.UpdateDate = notifyProxy.UpdateDate;

            foreach (NotifyAction action in notify.Actions)
            {
                notifyProxy.Actions.Add(new NotifyActionProxy(action.Title, action.Url, action.IsDialog));
            }


            notifyProxy.TypeName = notify.TypeName;
            notifyProxy.ClientID = notify.ClientID;
            notifyProxy.TypeID = notify.TypeID;
            notifyProxy.Keyword = notify.Keyword;
            notifyProxy.IsRead = notify.IsRead;
            notifyProxy.UpdateDate = notify.UpdateDate;

            notifyProxy.DataTable = new List<StringKeyValueProxy>();

            foreach (string key in notify.DataTable.Keys)
            {
                notifyProxy.DataTable.Add(new StringKeyValueProxy(key, notify.DataTable[key]));
            }

            return notifyProxy;
        }
Example #41
0
 protected void OnNotify(Block block, NotifyEventArgs[] notifications)
 {
     Notify?.Invoke(this, new BlockNotifyEventArgs(block, notifications));
 }
 public void NotifyChange(Stock stock)
 {
     Notify?.Invoke(stock);
 }
Example #43
0
 public override void Publish(Button eventParam)
 {
     Notify?.Invoke(eventParam);
 }
Example #44
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Dictionary<string, string> sPara = GetRequestPost();

        if (sPara.Count > 0)//判断是否有带返回参数
        {
            Notify aliNotify = new Notify();
            bool verifyResult = aliNotify.VerifyNotify(sPara, Request.Form["sign"]);

            if (verifyResult)//验证成功
            {
                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //请在这里加上商户的业务逻辑程序代码

                //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表

                //解密(如果是RSA签名需要解密,如果是MD5签名则下面一行清注释掉)
                sPara = aliNotify.Decrypt(sPara);

                //XML解析notify_data数据
                try
                {
                    XmlDocument xmlDoc = new XmlDocument();
                    xmlDoc.LoadXml(sPara["notify_data"]);
                    //商户订单号
                    string out_trade_no = xmlDoc.SelectSingleNode("/notify/out_trade_no").InnerText;
                    //支付宝交易号
                    string trade_no = xmlDoc.SelectSingleNode("/notify/trade_no").InnerText;
                    //交易状态
                    string trade_status = xmlDoc.SelectSingleNode("/notify/trade_status").InnerText;

                    if (trade_status == "TRADE_FINISHED")
                    {
                        //判断该笔订单是否在商户网站中已经做过处理
                        //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                        //如果有做过处理,不执行商户的业务程序

                        //注意:
                        //该种交易状态只在两种情况下出现
                        //1、开通了普通即时到账,买家付款成功后。
                        //2、开通了高级即时到账,从该笔交易成功时间算起,过了签约时的可退款时限(如:三个月以内可退款、一年以内可退款等)后。

                        Response.Write("success");  //请不要修改或删除
                    }
                    else if (trade_status == "TRADE_SUCCESS")
                    {
                        //判断该笔订单是否在商户网站中已经做过处理
                        //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                        //如果有做过处理,不执行商户的业务程序

                        //注意:
                        //该种交易状态只在一种情况下出现——开通了高级即时到账,买家付款成功后。

                        Response.Write("success");  //请不要修改或删除
                    }
                    else
                    {
                        Response.Write(trade_status);
                    }

                }
                catch (Exception exc)
                {
                    Response.Write(exc.ToString());
                }

                //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
            }
            else//验证失败
            {
                Response.Write("fail");
            }
        }
        else
        {
            Response.Write("无通知参数");
        }
    }
Example #45
0
 public UscPastoral(bool selecionavel = true, Notify Selecionar = null)
     : this()
 {
     Cadastro.OnSelecionar = Selecionar;
     Cadastro.Selecionavel = selecionavel;
 }
Example #46
0
        protected void Page_Load(object sender, EventArgs e)
        {
            log.Info("**********************支付宝回调receive**********************");
            //商户订单号
            string out_trade_no = Request.QueryString["out_trade_no"];
            Dictionary <string, string> sPara = GetRequestGet();

            //日志
            log.Info("商户订单号" + out_trade_no + ",参数个数:" + sPara.Count);
            if (sPara.Count > 0)//判断是否有带返回参数
            {
                Notify aliNotify    = new Notify();
                bool   verifyResult = aliNotify.VerifyReturn(sPara, Request.QueryString["sign"]);
                log.Info("是否支付宝发出的验证:" + verifyResult + "参数sPara:" + sPara + "参数sign:" + Request.QueryString["sign"]);
                //日志
                //   Common.Log(out_trade_no + ",回调判断:" + verifyResult, Common.LogLevel.low, "微网站支付宝回调");
                if (verifyResult)//验证成功
                {
                    log.Info("验证成功");
                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                    //请在这里加上商户的业务逻辑程序代码

                    //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                    //获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表

                    //支付宝交易号
                    string trade_no = Request.QueryString["trade_no"];

                    //交易状态
                    string trade_status = Request.QueryString["result"];
                    log.Info("支付宝交易号:" + trade_no + "支付宝交易状态:" + trade_status);
                    //日志
                    //     Common.Log("订单号:" + out_trade_no + ",交易状态:" + trade_status, Common.LogLevel.low, "微网站支付宝回调");
                    /*liufang 修改了原OrderPay类*/
                    GetOutBean op = new GetOutBean();
                    OrderModule.business.OrderDetailsPay.OrderPayBusiness pc = new OrderModule.business.OrderDetailsPay.OrderPayBusiness();

                    if (!string.IsNullOrEmpty(out_trade_no))
                    {
                        op = pc.Get(long.Parse(out_trade_no));
                        log.Info("OrderPay标示:" + op.Bank + op.OrderId + op.PayState + op.ULoginName);
                    }
                    if (trade_status == "success")
                    {
                        //判断该笔订单是否在商户网站中已经做过处理
                        //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                        //如果有做过处理,不执行商户的业务程序
                        //注意:
                        //该种交易状态只在一种情况下出现——开通了高级即时到账,买家付款成功后。
                        //  Common.Log(out_trade_no + "已经进入支付判断", Common.LogLevel.low, "微网站支付宝回调");
                        //如果是蛋糕订单
                        if (op.PayState == "未支付" || op.PayState == "等待发货")
                        {
                            //日志
                            // Common.Log(out_trade_no + "|" + ",蛋糕订单变更结果:" + result + ",充值订单变更结果:" + reResult, Common.LogLevel.low, "微网站支付宝回调");
                            op.PayState = "已支付";
                            op.Bank     = "支付宝";

                            string str = op.Remark;
                            op.Remark = string.Format("{1},由支付宝电子对账单更新{0:yyyy-MM-dd HH:mm:ss},状态为:等待用户确认收货", DateTime.Now, trade_no);
                            UpdateInBean inbean = new UpdateInBean();
                            inbean = (UpdateInBean)CommonUtils.TransObject.OToO(op, inbean);
                            bool re = pc.Update(inbean);
                            log.Info("****************OrderPay状态修改******************" + re);
                            pc.UpdateCompleteStatus((long)op.OrderId);//支付成功修改订单状态
                            log.Info("****************OrderPay状态修改******************" + re);
                        }

                        //打印页面
                        if (op.OrderType == 0)
                        {
                            Response.Redirect(string.Format("~/order-success/{0}", out_trade_no));
                        }
                        //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                        /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                    }
                    else//验证失败
                    {
                        Response.Write("验证失败");
                    }
                }
                else
                {
                    Response.Write("无返回参数");
                }
            }
        }
Example #47
0
        public void Initialize()
        {
#if DEBUG
            // Отключение отладочных сообщений биндинга (тормозит сильно)
            PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Off;
#endif
            try
            {
                AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
                Logger.Log.Info("start Initialize AcadLib");
                StatusBarEx.AddPaneUserGroup();
                PluginStatisticsHelper.StartAutoCAD();
                if (PikSettings.IsDisabledSettings)
                {
                    Logger.Log.Info("Настройки отключены (PikSettings.IsDisabledSettings) - загрузка прервана.");
                    AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
                    return;
                }

                Notify.SetScreenSettings(new NotifyOptions(with: 400));

                CheckUpdates.Start();
                if (Settings.Default.UpgradeRequired)
                {
                    Settings.Default.Upgrade();
                    Settings.Default.UpgradeRequired = false;
                    Settings.Default.Save();
                }

                PaletteSetCommands.Init();
                AllCommandsCommon();

                // Автослоиtest
                AutoLayersService.Init();

                // Загрузка сборок из папки ../Script/Net - без вложенных папок
                LoadService.LoadFromFolder(Path.Combine(PikSettings.LocalSettingsFolder, @"Script\NET"), 1);

                // Обработка чертежей
                DocAuto.Start();

                // Лента
                RibbonBuilder.InitRibbon();
                Logger.Log.Info("end Initialize AcadLib");
                AcadLibAssembly.AcadLoadInfo();
                if (AutocadUserService.User == null)
                {
                    Logger.Log.Warn("Настройки группы пользователя не заданы - открытие окна настроек пользователя.");
                    UserSettingsService.Show();
                }

                // Восстановление вкладок чертежей
                //Utils.Tabs.RestoreTabs.Init(); // Фаталит у Черновой
                Logger.Log.Info("AcadLib Initialize end success.");
            }
            catch (Exception ex)
            {
                $"PIK. Ошибка загрузки AcadLib, версия:{AcadLibVersion} - {ex.Message}.".WriteToCommandLine();
                Logger.Log.Error(ex, "AcadLib Initialize.");
            }
        }
Example #48
0
 public void ShowNotifySticky()
 {
     Notify.Template("NotifyTemplateSimple").Show("Sticky Notification. Click on the × above to close.", customHideDelay: 0f);
 }
Example #49
0
 private void PlayFile(FileInfo FI)
 {
     lock (this)
     {
         if (this.AudioDevice == null)
         {
             this.AudioDevice = new Device();
             AudioDevice.SetCooperativeLevel(this, CooperativeLevel.Normal);
         }
         this.StopPlayback();
         WaveFormat fmt = new WaveFormat();
         fmt.FormatTag = WaveFormatTag.Pcm;
         fmt.Channels = FI.AudioFile.Channels;
         fmt.SamplesPerSecond = FI.AudioFile.SampleRate;
         fmt.BitsPerSample = 16;
         fmt.BlockAlign = (short)(FI.AudioFile.Channels * (fmt.BitsPerSample / 8));
         fmt.AverageBytesPerSecond = fmt.SamplesPerSecond * fmt.BlockAlign;
         BufferDescription BD = new BufferDescription(fmt);
         BD.BufferBytes = this.AudioBufferSize;
         BD.GlobalFocus = true;
         BD.StickyFocus = true;
         if (this.chkBufferedPlayback.Checked)
         {
             BD.ControlPositionNotify = true;
             this.CurrentBuffer = new SecondaryBuffer(BD, this.AudioDevice);
             if (this.AudioUpdateTrigger == null)
             {
                 this.AudioUpdateTrigger = new AutoResetEvent(false);
             }
             int ChunkSize = this.AudioBufferSize / this.AudioBufferMarkers;
             BufferPositionNotify[] UpdatePositions = new BufferPositionNotify[this.AudioBufferMarkers];
             for (int i = 0; i < this.AudioBufferMarkers; ++i)
             {
                 UpdatePositions[i] = new BufferPositionNotify();
                 UpdatePositions[i].EventNotifyHandle = this.AudioUpdateTrigger.SafeWaitHandle.DangerousGetHandle();
                 UpdatePositions[i].Offset = ChunkSize * i;
             }
             Notify N = new Notify(this.CurrentBuffer);
             N.SetNotificationPositions(UpdatePositions);
             this.CurrentStream = FI.AudioFile.OpenStream();
             this.CurrentBuffer.Write(0, this.CurrentStream, this.CurrentBuffer.Caps.BufferBytes, LockFlag.EntireBuffer);
             if (this.CurrentStream.Position < this.CurrentStream.Length)
             {
                 this.AudioUpdateTrigger.Reset();
                 this.AudioUpdateThread = new Thread(new ThreadStart(this.AudioUpdate));
                 this.AudioUpdateThread.Start();
                 this.btnPause.Enabled = true;
                 this.btnStop.Enabled = true;
                 this.AudioIsLooping = true;
             }
             else
             {
                 this.CurrentStream.Close();
                 this.CurrentStream = null;
                 this.AudioIsLooping = false;
             }
         }
         else
         {
             this.CurrentStream = FI.AudioFile.OpenStream(true);
             this.CurrentBuffer = new SecondaryBuffer(this.CurrentStream, BD, this.AudioDevice);
             this.btnPause.Enabled = true;
             this.btnStop.Enabled = true;
         }
         this.CurrentBuffer.Play(0, (this.AudioIsLooping ? BufferPlayFlags.Looping : BufferPlayFlags.Default));
     }
 }
Example #50
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Dictionary <string, string> sPara = GetRequestGet();

            if (sPara.Count > 0)//判断是否有带返回参数
            {
                Notify aliNotify    = new Notify();
                bool   verifyResult = aliNotify.VerifyReturn(sPara, Request.QueryString["sign"]);

                if (verifyResult)//验证成功
                {
                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                    //请在这里加上商户的业务逻辑程序代码


                    //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                    //获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表

                    //商户订单号
                    string out_trade_no = Request.QueryString["out_trade_no"];

                    //支付宝交易号
                    string trade_no = Request.QueryString["trade_no"];

                    //交易状态
                    string result = Request.QueryString["result"];

                    Eyousoft_yhq.BLL.Order OrderType = new Eyousoft_yhq.BLL.Order();
                    var    OrderModel = new Eyousoft_yhq.Model.Order();
                    string res        = string.Empty;
                    if (result == "success")
                    {
                        //纪录充值消费纪录
                        try
                        {
                            string price = Request.QueryString["price"];
                            Eyousoft_yhq.BLL.BConDetaile   service = new Eyousoft_yhq.BLL.BConDetaile();
                            Eyousoft_yhq.Model.MConDetaile con     = new Eyousoft_yhq.Model.MConDetaile();
                            con.JiaoYiHao      = trade_no;
                            con.DingDanBianHao = out_trade_no;
                            con.JinE           = Decimal.Parse(price);
                            con.JiaoYiShiJian  = DateTime.Now;
                            con.XFway          = Eyousoft_yhq.Model.XFfangshi.消费;

                            EyouSoft.Model.SSOStructure.MUserInfo userInfo = Session["HuiYuanInfo"] as EyouSoft.Model.SSOStructure.MUserInfo;
                            con.HuiYuanID = userInfo.UserID;
                            service.Add(con);
                        }
                        catch (Exception)
                        {
                        }

                        OrderModel = OrderType.GetModel(out_trade_no);
                        if (OrderModel.PayState != Eyousoft_yhq.Model.PaymentState.已支付)
                        {
                            string Ra = Eyousoft_yhq.SQLServerDAL.Utils.GetRandomString(12);
                            while (OrderType.Exists(Ra))
                            {
                                Ra = Eyousoft_yhq.SQLServerDAL.Utils.GetRandomString(12);
                            }
                            Eyousoft_yhq.Model.Order OrderInfo = new Eyousoft_yhq.Model.Order()
                            {
                                OrderID     = out_trade_no,
                                PayState    = Eyousoft_yhq.Model.PaymentState.已支付,
                                ConfirmCode = Ra,
                                OrderState  = Eyousoft_yhq.Model.OrderState.已成交
                            };
                            int Sum = OrderType.UpdatePayState(OrderInfo);
                            if (Sum > 0)
                            {
                                Eyousoft_yhq.BLL.Member UM = new Eyousoft_yhq.BLL.Member();
                                bool Mo = UM.GetModel(OrderModel.MemberID).valiUser;
                                if (!Mo)
                                {
                                    #region 短信发送
                                    string code = string.Empty;
                                    IList <Eyousoft_yhq.Model.SMSChannel> channel = Eyousoft_yhq.Web.BsendMsg.CommonProcess.GetSMSChannels();
                                    //code = CreateZxingCode(Ra) + string.Format("下单成功,确认码:{0}!【惠旅游】", Ra);//生成二维码,发送彩信

                                    Eyousoft_yhq.Web.BsendMsg.CommonProcess.SendSMS(OrderModel.MemberTel, code, channel[0], out res);//发送
                                    #endregion
                                    #region  短信日志
                                    Eyousoft_yhq.Model.MsgLog MsLog = new Eyousoft_yhq.Model.MsgLog
                                    {
                                        TelCode  = OrderModel.MemberTel,
                                        MsgText  = code,
                                        ReResult = res
                                    };
                                    new Eyousoft_yhq.BLL.MsgLog().Add(MsLog);
                                    #endregion
                                }
                            }
                        }
                    }


                    Response.Redirect("/AppPage/orderlist.aspx");

                    //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                }
                else//验证失败
                {
                    Response.Write("验证失败");
                }
            }
            else
            {
                Response.Write("无返回参数");
            }
        }
Example #51
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SortedDictionary<string, string> sPara = GetRequestPost();

        if (sPara.Count > 0)//判断是否有带返回参数
        {
            Notify aliNotify = new Notify();
            bool verifyResult = aliNotify.Verify(sPara, Request.Form["notify_id"], Request.Form["sign"]);

            if (verifyResult)//验证成功
            {
                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //请在这里加上商户的业务逻辑程序代码

                //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表

                //商户订单号
                string out_trade_no = Request.Form["out_trade_no"];

                //支付宝交易号
                string trade_no = Request.Form["trade_no"];

                //交易状态
                string trade_status = Request.Form["trade_status"];

                if (Request.Form["trade_status"] == "TRADE_FINISHED")
                {
                    //判断该笔订单是否在商户网站中已经做过处理
                    //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                    //如果有做过处理,不执行商户的业务程序

                    //注意:
                    //退款日期超过可退款期限后(如三个月可退款),支付宝系统发送该交易状态通知
                }
                else if(Request.Form["trade_status"] == "TRADE_SUCCESS")
                {
                    //判断该笔订单是否在商户网站中已经做过处理
                    //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                    //如果有做过处理,不执行商户的业务程序

                    //注意:
                    //付款完成后,支付宝系统发送该交易状态通知
                }
                else
                {
                }

                //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                Response.Write("success");  //请不要修改或删除

                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
            }
            else//验证失败
            {
                Response.Write("fail");
            }
        }
        else
        {
            Response.Write("无通知参数");
        }
    }
Example #52
0
 /// <summary>
 /// This method supports the Fluorine infrastructure and is not intended to be used directly from your code.
 /// </summary>
 /// <param name="connection"></param>
 /// <param name="channel"></param>
 /// <param name="header"></param>
 /// <param name="invoke"></param>
 protected abstract void OnInvoke(RtmpConnection connection, RtmpChannel channel, RtmpHeader header, Notify invoke);
Example #53
0
		/// <summary>
		/// Notifies service using service call object and channel.
		/// </summary>
		/// <param name="serviceCall">Service call object.</param>
		/// <param name="channel">Channel to use.</param>
		public void Notify(IServiceCall serviceCall, byte channel) {
			Notify notify = new Notify();
			notify.ServiceCall = serviceCall;
			GetChannel(channel).Write(notify);
		}
Example #54
0
        // Conducts the NPC search and returns the found items.
        // Also merges results with standard search results for the same name, then drops items containing "Corpse"
        public static List <MapItem> SearchNPC(string searchTerm, int minChance)
        {
            try
            {
                List <MapItem> results = new List <MapItem>();

                using (SqliteDataReader reader = Database.ExecuteQueryNPCSearch(searchTerm, minChance / 100.00, SettingsSearch.searchInterior))
                {
                    // Collect some variables which will always be the same for every result and are required for an instance of MapItem
                    string        signature = ConvertSignature("NPC_", false);
                    List <string> lockTypes = GetPermittedLockTypes();

                    while (reader.Read())
                    {
                        // Sub-query for interior can return null
                        if (reader.IsDBNull(0))
                        {
                            continue;
                        }

                        double spawnChance = Math.Round(reader.GetDouble(2), 2);
                        string name        = reader.GetString(0);

                        results.Add(new MapItem(
                                        Type.NPC,
                                        name,                                 // FormID
                                        name + " [Min " + spawnChance + "%]", // Editor ID
                                        name,                                 // Display Name
                                        signature,
                                        lockTypes,                            // The Lock Types filtered for this set of items.
                                        spawnChance,
                                        reader.GetInt32(1),                   // Count
                                        reader.GetString(3),                  // Cell Display Name/location
                                        reader.GetString(4)));                // Cell editorID
                    }
                }

                // Expand the NPC search, by also conducting a standard search of only NPC_, ignorant of lock filter
                results.AddRange(SearchStandard(searchTerm, SettingsSearch.searchInterior, new List <string> {
                    "NPC_"
                }, GetPermittedLockTypes()));

                /*Copy out search results not containing "corpse", therefore dropping the dead "NPCs"
                 * This isn't perfect and won't catch ALL dead NPCs.
                 * A common pattern seems to be that things prefixed with 'Enc' are dead,
                 * but this isn't a global truth and filtering these out would cause too many false positives*/
                List <MapItem> itemsWithoutCorpse = new List <MapItem>();
                foreach (MapItem item in results)
                {
                    if (item.editorID.Contains("corpse") || item.editorID.Contains("Corpse"))
                    {
                        continue;
                    }
                    else
                    {
                        itemsWithoutCorpse.Add(item);
                    }
                }

                return(itemsWithoutCorpse);
            }
            catch (Exception e)
            {
                Notify.Error("Mappalachia encountered an error while searching the database:\n" +
                             IOManager.genericExceptionHelpText +
                             e);

                return(new List <MapItem>());
            }
        }
        public void Extract(ExtractOptions options, CancellationToken cancellationToken)
        {
            using (var stream = new FileStream(options.SourcePbp, FileMode.Open, FileAccess.Read))
            {
                var pbpStreamReader = new PbpReader(stream);

                if (options.GenerateResourceFolders)
                {
                    var disc = pbpStreamReader.Discs[0];

                    var gameInfo = options.FindGame(disc.DiscID);

                    EnsureResourcePathExists(options, gameInfo);

                    return;
                }

                if (options.ExtractResources)
                {
                    var disc = pbpStreamReader.Discs[0];

                    var gameInfo = options.FindGame(disc.DiscID);

                    EnsureResourcePathExists(options, gameInfo);

                    if (string.IsNullOrEmpty(options.ResourceFoldersPath))
                    {
                        options.ResourceFoldersPath = Path.GetDirectoryName(options.SourcePbp);
                    }

                    ExtractResources(stream, (type, extension) => GetResourcePath(options, gameInfo, type, extension));

                    return;
                }

                var ext = ".bin";

                if (pbpStreamReader.Discs.Count > 1)
                {
                    foreach (var disc in pbpStreamReader.Discs.Where(d => options.Discs.Contains(d.Index)))
                    {
                        var gameInfo = options.FindGame(disc.DiscID);

                        if (gameInfo == null)
                        {
                            //var mainGameId = (string)pbpStreamReader.SFOData.Entries.FirstOrDefault(x => x.Key == SFOKeys.DISC_ID)?.Value;
                            options.FileNameFormat = "%FILENAME%";
                            gameInfo = new GameEntry();
                        }

                        var title = GetFilename(options.FileNameFormat,
                                                options.SourcePbp,
                                                disc.DiscID,
                                                gameInfo.SaveFolderName,
                                                gameInfo.GameName,
                                                gameInfo.SaveDescription,
                                                gameInfo.Format
                                                );

                        Notify?.Invoke(PopstationEventEnum.Info, $"Using Title '{title}'");

                        var discName = options.DiscName.Replace("{0}", disc.Index.ToString());

                        var isoPath = Path.Combine(options.OutputPath, $"{title} {discName}{ext}");

                        ExtractISO(disc, isoPath, options, cancellationToken);

                        if (cancellationToken.IsCancellationRequested)
                        {
                            break;
                        }
                    }
                }
                else
                {
                    var disc = pbpStreamReader.Discs[0];

                    var gameInfo = options.FindGame(disc.DiscID);

                    if (gameInfo == null)
                    {
                        //var mainGameId = (string)pbpStreamReader.SFOData.Entries.FirstOrDefault(x => x.Key == SFOKeys.DISC_ID)?.Value;
                        options.FileNameFormat = "%FILENAME%";
                        gameInfo = new GameEntry();
                    }

                    var title = GetFilename(options.FileNameFormat,
                                            options.SourcePbp,
                                            disc.DiscID,
                                            gameInfo.SaveFolderName,
                                            gameInfo.GameName,
                                            gameInfo.SaveDescription,
                                            gameInfo.Format
                                            );

                    var isoPath = Path.Combine(options.OutputPath, $"{title}{ext}");

                    ExtractISO(disc, isoPath, options, cancellationToken);
                }

                Notify?.Invoke(PopstationEventEnum.ExtractComplete, null);
            }
        }
Example #56
0
    protected void Page_Load(object sender, EventArgs e)
    {
        return;

        //输出获取的参数
        string query = string.Empty;

        for (int i = 0; i < Request.QueryString.Count; i++)
        {
            query += Request.QueryString.Keys[i].ToString() + " = " + Request.QueryString[i].ToString() + ";";
        }
        WeiSha.Common.Log.Debug("Alipay.web_return_url", query);

        SortedDictionary <string, string> sPara = GetRequestGet();

        if (sPara.Count > 0)//判断是否有带返回参数
        {
            //商户订单号
            string out_trade_no = Request.QueryString["out_trade_no"];
            Song.Entities.MoneyAccount maccount = Business.Do <IAccounts>().MoneySingle(out_trade_no);
            if (maccount == null)
            {
                return_para = string.Format(return_para, false, "", "");
                return;
            }
            Notify aliNotify    = new Notify(maccount.Pai_ID);
            bool   verifyResult = aliNotify.Verify(sPara, Request.QueryString["notify_id"], Request.QueryString["sign"]);

            if (verifyResult)//验证成功
            {
                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //请在这里加上商户的业务逻辑程序代码


                //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                //获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表


                //支付宝交易号

                string trade_no = Request.QueryString["trade_no"];

                //交易状态
                string trade_status = Request.QueryString["trade_status"];


                if (Request.QueryString["trade_status"] == "TRADE_FINISHED" || Request.QueryString["trade_status"] == "TRADE_SUCCESS")
                {
                    //判断该笔订单是否在商户网站中已经做过处理
                    //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                    //如果有做过处理,不执行商户的业务程序
                }
                else
                {
                    Response.Write("trade_status=" + Request.QueryString["trade_status"]);
                }

                //付款方与收款方
                maccount.Ma_Buyer  = Request.QueryString["buyer_email"];
                maccount.Ma_Seller = Request.QueryString["seller_email"];
                Business.Do <IAccounts>().MoneyConfirm(maccount);
                return_para = string.Format(return_para, true, maccount.Ma_Money, maccount.Pai_ID);

                //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
            }
            else//验证失败
            {
                return_para = string.Format(return_para, false, maccount.Ma_Money, maccount.Pai_ID);
            }
        }
        else
        {
            Response.Write("无返回参数");
        }
    }
Example #57
0
 /// <summary>
 /// Initialize new instance of class <see cref="NotifyResult"/>.
 /// </summary>
 /// <param name="notify"><see cref="Notify"/></param>
 public NotifyResult(Notify notify)
 {
     Type = notify.Type;
     Messages = notify.Messages.Select(message => new KeyValuePair<string, IList<string>>(Guid.NewGuid().ToString(), new List<string> { message })).ToList();
 }
 private void ProgressEvent(uint bytes)
 {
     Notify.Invoke(PopstationEventEnum.ConvertProgress, bytes);
 }
Example #59
0
 public SerialDevice(string port, Notify notifier)
 {
     _port = port;
     _notifier = notifier;
 }
Example #60
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SortedDictionary <string, string> sPara = GetRequestPost();

            if (sPara.Count > 0)//判断是否有带返回参数
            {
                Notify aliNotify    = new Notify();
                bool   verifyResult = aliNotify.Verify(sPara, Request["notify_id"], Request["sign"]);

                if (verifyResult)//验证成功
                {
                    //商户订单号
                    string out_trade_no = Request["out_trade_no"];

                    //支付宝交易号
                    string trade_no = Request["trade_no"];

                    //交易状态
                    string trade_status = Request["trade_status"];

                    //交易金额
                    string total_fee = Request["total_fee"];

                    if (Request["trade_status"] == "TRADE_FINISHED")
                    {
                        ShareDetialInfo detailInfo = new ShareDetialInfo();
                        detailInfo.OrderID   = out_trade_no;
                        detailInfo.IPAddress = Utility.UserIP;
                        detailInfo.PayAmount = decimal.Parse(total_fee);
                        Message msg = treasurefacade.FilliedOnline(detailInfo, 0);
                        if (!msg.Success)
                        {
                            Response.Write(msg.Content);
                        }
                    }
                    else if (Request["trade_status"] == "TRADE_SUCCESS")
                    {
                        ShareDetialInfo detailInfo = new ShareDetialInfo();
                        detailInfo.OrderID   = out_trade_no;
                        detailInfo.IPAddress = Utility.UserIP;
                        detailInfo.PayAmount = decimal.Parse(total_fee);
                        Message msg = treasurefacade.FilliedOnline(detailInfo, 0);
                        if (!msg.Success)
                        {
                            Response.Write(msg.Content);
                        }
                    }
                    else
                    {
                    }
                    Response.Write("success");//请不要修改或删除
                }
                else//验证失败
                {
                    Response.Write("fail");
                }
            }
            else
            {
                Response.Write("无通知参数");
            }
        }