상속: System.Web.UI.Page
예제 #1
0
        protected override IntPtr OnCommand(IntPtr hWnd, WM msg, IntPtr wParam, IntPtr lParam)
        {
            BN code = (BN)(wParam.ToInt32() >> 16);

            switch (code)
            {
            case BN.CLICKED:
                OnClick(EventArgs.Empty);
                //if (Click != null)
                //    Click(this, EventArgs.Empty);
                return(IntPtr.Zero);

            case BN.KILLFOCUS:
                OnLostFocus(EventArgs.Empty);
                //if (LostFocus != null)
                //    LostFocus(this, EventArgs.Empty);
                return(IntPtr.Zero);

            case BN.SETFOCUS:
                OnGotFocus(EventArgs.Empty);
                //if (GotFocus != null)
                //    GotFocus(this, EventArgs.Empty);
                return(IntPtr.Zero);

            case BN.DBLCLK:
                OnDoubleClick(EventArgs.Empty);
                //if (DoubleClick != null)
                //    DoubleClick(this, EventArgs.Empty);
                return(IntPtr.Zero);

            default:
                return(base.OnCommand(hWnd, msg, wParam, lParam));
            }
        }
예제 #2
0
        protected override IntPtr OnCommand(IntPtr hWnd, WM msg, IntPtr wParam, IntPtr lParam)
        {
            BN code = (BN)(wParam.ToInt32() >> 16);

            switch (code)
            {
            case BN.CLICKED:
                OnClick(EventArgs.Empty);
                Win32Window.SendMessage(m_hwndControl, (int)BM.SETCHECK, (int)BST.CHECKED, 0);
                return(IntPtr.Zero);

            case BN.KILLFOCUS:
                OnLostFocus(EventArgs.Empty);
                return(IntPtr.Zero);

            case BN.SETFOCUS:
                OnGotFocus(EventArgs.Empty);
                return(IntPtr.Zero);

            case BN.DBLCLK:
                OnDoubleClick(EventArgs.Empty);
                return(IntPtr.Zero);

            default:
                return(Win32Window.CallWindowProc(prevWndProc, hWnd, msg, wParam, lParam));
            }
        }
예제 #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sensitive_input">wi*sensitive的输入</param>
 public void backpropagation(float[] cancha)
 {
     ////不加BN
     //SensitiveValue = F_back(cancha);
     float[] f_out = F_back(cancha);
     SensitiveValue = BN.GetDout(f_out, Xin);
 }
예제 #4
0
        public AllSites(List <District> listDistricts, List <Metro> listMetros, List <ProxyInfo> listProxy) : base(listDistricts, listMetros, listProxy)
        {
            bkn   = new BKN(listDistricts, listMetros, listProxy);
            bn    = new BN(listDistricts, listMetros, listProxy);
            elms  = new ELMS(listDistricts, listMetros, listProxy);
            avito = new Avito(listDistricts, listMetros, listProxy);

            bkn.Filename   = filename;
            bn.Filename    = filename;
            elms.Filename  = filename;
            avito.Filename = filename;
        }
예제 #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="xi_input">wi*xi的输入</param>
        public void forward(float[] xi_input)
        {
            Xin = new float[xi_input.Length];

            for (int i = 0; i < Xin.Length; i++)
            {
                Xin[i] = xi_input[i];
            }
            ////不加BN
            //Xout = F(Xin);
            BN_out = BN.GetX_out(Xin);
            Xout   = F(BN_out);
        }
예제 #6
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //read all baby names on loadup.
            using (var reader = new StreamReader(@"../../../05-babynames.txt"))
            {
                while (!reader.EndOfStream)
                {
                    var line = reader.ReadLine();
                    babyNames.Add(new BabyName(line));
                }
            }

            //create matrix of top 10 baby names pr. decade
            for (int i = 1900; i <= 2000; i += 10)
            {
                //MessageBox.Show("Calculating top 10 names for: " + i);

                //Make placeholder array for top 10 names (boys and girls. 1= place 0 & 10, 2 =1 & 11, etc..)
                BabyName[] top10ofTheDecade = new BabyName[20];
                foreach (BabyName BN in babyNames)
                {
                    int rank = BN.Rank(i);                      //get rank
                    if (rank <= 10 && rank != 0)                //if in top 10
                    {
                        if (top10ofTheDecade[rank - 1] == null) // if first value holder is null.
                        {
                            top10ofTheDecade[rank - 1] = BN;
                        }
                        else
                        {
                            top10ofTheDecade[rank + 10 - 1] = BN;
                        }
                    }
                }
                top10babyNamesByDecade.Add(i, top10ofTheDecade); //add to matrix of top names.

                String[] strings = new String[10];               //create strings containing both boy and girl names.
                for (int j = 0; j < 10; j++)
                {
                    strings[j] = top10ofTheDecade[j].Name + " and " + top10ofTheDecade[j + 10].Name;
                }

                //add to matrix of name strings.
                top10babyNamesStrings.Add(i, strings);
            }
        }
예제 #7
0
    // Update is called once per frame
    void Update()
    {
        int index = -1;

        while (WSNetworkManager.BNQueue.Count > 0)
        {
            string instruction = WSNetworkManager.BNQueue.Dequeue();
            if (instruction.Contains("Destroy"))
            {
            }
            else
            {
                BN n = JsonUtility.FromJson <BN>(instruction);
                index = BNList.FindIndex(BN => BN.GetComponent <TriangleData>().id == n.id);

                if (index >= 0)
                {
                    // Object already in list
                    var bnpos = BNList[index].GetComponent <TriangleData>();
                    var m     = Panel.GetComponent <LocationController>();
                    bnpos.lng = n.lon;
                    bnpos.lat = n.lat;
                    bnpos.alt = n.alt;
                    bnpos.tmp = n.temp;
                    bnpos.UpdateFocus();
                    double xpos = (bnpos.lng - m.lngMinMap) / (m.lngMaxMap - m.lngMinMap) * 40.96 - 20.48;
                    double ypos = (bnpos.lat - m.latMinMap) / (m.latMaxMap - m.latMinMap) * 40.96 - 20.48;
                    BNList[index].transform.localPosition = new Vector3((float)xpos, (float)ypos, bnpos.alt);
                }
                else
                {
                    GameObject nobj = (GameObject)Instantiate(BNPrefab);
                    var        data = nobj.GetComponent <TriangleData>();
                    data.lat         = n.lat;
                    data.lng         = n.lon;
                    data.alt         = n.alt;
                    data.id          = n.id;
                    data.tmp         = n.temp;
                    data.RestManager = NetworkManager;
                    data.Spawner     = Spawner;
                    data.Self        = nobj;
                    data.FocusWindow = FocusWindow;

                    nobj.transform.parent = Spawner.transform;
                    nobj.GetComponent <Transform>().localScale = new Vector3(TriScale * ZoomController.ZoomScale, TriScale * ZoomController.ZoomScale, 1);
                    BNList.Add(nobj);
                    Panel.GetComponent <LocationController>().UpdateMap();
                    terminal.GetComponent <TerminalController>().TerminalColorPrint("New BN object with ID: " + data.id, nobj.GetComponent <SpriteRenderer>().color);
                }
            }
        }

        if (UIFunctions.closeScene)
        {
            foreach (GameObject bn in BNList)
            {
                Destroy(bn);
            }
            BNList.Clear();
        }
    }