示例#1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (TestNum != 0)
            {
                hash ^= TestNum.GetHashCode();
            }
            if (TestFloat != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(TestFloat);
            }
            if (TestString.Length != 0)
            {
                hash ^= TestString.GetHashCode();
            }
            if (TestBool != false)
            {
                hash ^= TestBool.GetHashCode();
            }
            hash ^= testList_.GetHashCode();
            hash ^= TestDic.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
示例#2
0
        public string DoWork(int length)
        {
            string s = "";

            for (int i = 0; i < length; ++i)
            {
                s += TestNum.ToString();
            }
            return(s);
        }
示例#3
0
            // Start is called before the first frame update
            public void Start()
            {
                TestNum num = new TestNum();


                string json = LitJson.JsonMapper.ToJson(num);


                var testNum = LitJson.JsonMapper.ToObject <TestNum>(json);

                Console.WriteLine(testNum.a);
            }
示例#4
0
 /*
  * Searches the database based on which test is selected in the drop down boxes
  * Parameter Test: this should be one of the predefined test types, (I.E. 'HgA1C')
  * */
 void databaseSearch(TestNum test)
 {
     if (id != null)
     {
         //graphName = test.toString();
         //chart1.Series.Add(graphName);//not working, cannot add a same series twice
         connection.Open();
         string testSearch = "Select * FROM " + test.getTestType() + " Where PatientID =" + id + " ORDER BY DateOfTest;";
         Console.WriteLine(testSearch);
         MySqlCommand    cmd    = new MySqlCommand(testSearch, connection);
         MySqlDataReader reader = cmd.ExecuteReader();
         chart1.Series[graphName].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
         while (reader.Read())
         {
             chart1.Series[graphName].Points.AddY(reader.GetDouble(test.getDouble()));
         }
         chart1.Series[graphName].ChartArea = "ChartArea1";
         reader.Close();
         connection.Close();
     }
 }
示例#5
0
        private static void Main(string[] args)
        {
            AutofacIoc.Register();
            Test.Write();

            const int          numberOfCycles     = 10;
            var                node               = new Uri("http://localhost:9200");
            ConnectionSettings connectionSettings = new ConnectionSettings(
                node);
            ConnectionSettings settings = connectionSettings.DefaultIndex("people");
            var client = new ElasticClient(settings);

            // var searchResults = client.Search<Person>(s => s
            //    .From(0)
            //    .Size(10)
            //    .Query(q => q
            //         .Term(p => p.Firstname, "martijn")
            //    )
            // );
            // var client = ElasticSearchBulk.GetElasticClient();
            // var indexName = "people";//索引名称小写
            // var createSuccess = ElasticSearchBulk.CreateIndex<TestNum>(client, indexName);
            // if (createSuccess)
            // {
            // }
            var list = new List <TestNum>();

            for (var i = 5; i < numberOfCycles; i++)
            {
                var item = new TestNum {
                    Id = i, Name = $"中国人民: {i} ", Age = 10 * i
                };
                list.Add(item);
            }

            // client.IndexMany<TestNum>(list);
            ElasticSearchBulk.BulkAll(client, "people", list);
            Console.Read();
        }
示例#6
0
    // Use this for initialization
    void Awake()
    {
        TestNum num = new TestNum();

        Dispatcher.Instance.AddListener(listEvent, OnEvent);
    }