本文整理汇总了C#中data类的典型用法代码示例。如果您正苦于以下问题:C# data类的具体用法?C# data怎么用?C# data使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
data类属于命名空间,在下文中一共展示了data类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EstimateAdvice
protected virtual void EstimateAdvice(application.analysis.workData data,
application.analysis.analysisResult advices,
decimal initCapAmt, decimal priceWeight, decimal feePerc, byte buy2SellInterval,
data.tmpDS.tradeEstimateDataTable toTbl)
{
application.analysis.EstimateAdvice(data,advices, initCapAmt, priceWeight, feePerc, buy2SellInterval, toTbl);
}
示例2: Node
public Node(Node parent, Node left, Node right, data)
{
this.parent = parent;
this.left = left;
this.right = right;
this.data = data
}
示例3: SendToPhp
private int SendToPhp()
{
try
{
data DataObj = new data();
DataObj.df_text1 = sendText1;
DataObj.df_text2 = sendText2;
string JSONString = JsonConvert.SerializeObject(DataObj, Formatting.None);
string url = "http://pj3100.somee.com/cryptLogin.php";
HttpWebRequest newRequest = (HttpWebRequest)WebRequest.Create(url);
newRequest.Method = "POST";
string postData = JSONString;
byte[] pdata = Encoding.UTF8.GetBytes(postData);
newRequest.ContentType = "application/x-www-form-urlencoded";
newRequest.ContentLength = pdata.Length;
Stream myStream = newRequest.GetRequestStream();
myStream.Write(pdata, 0, pdata.Length);
WebResponse myResponse = newRequest.GetResponse();
Stream responseStream = myResponse.GetResponseStream();
StreamReader streamReader = new StreamReader(responseStream);
string result = streamReader.ReadToEnd();
streamReader.Close();
responseStream.Close();
myStream.Close();
if (result.Equals("1"))
{
return 1;
}
else if(result.Equals("2"))
{
return 2;
}
else
{
return 0;
}
}
catch (WebException ex)
{
string _exception = ex.ToString();
Toast error = Toast.MakeText(this, _exception, ToastLength.Long);
error.Show();
Console.WriteLine("--->" + _exception);
return 0;
}
}
示例4: ImportICB_AddToDb
//Add to database
private void ImportICB_AddToDb(data.importDS.icbCodeDataTable tbl, string fldName, bool haveDefitionFld,
data.baseDS.sysCodeDataTable sysCodeTbl,string category,string codeGroupFldName)
{
data.baseDS.sysCodeRow sysCodeRow;
common.myKeyValueItem item;
for (int idx = 0; idx < tbl.Count; idx++)
{
if (tbl[idx].RowState == DataRowState.Deleted) continue;
item = libs.SplitKeyValue(tbl[idx][fldName].ToString()," ");
if (item == null)
{
common.fileFuncs.WriteLog(tbl[idx][fldName].ToString() + " not found.");
continue;
}
if (sysCodeTbl.FindBycategorycode(category, item.Key) == null)
{
sysCodeRow = sysCodeTbl.NewsysCodeRow();
commonClass.AppLibs.InitData(sysCodeRow);
sysCodeRow.category = category;
sysCodeRow.code = item.Key;
sysCodeRow.description1 = item.Value;
sysCodeRow.tag1 = fldName;
if (codeGroupFldName != null) sysCodeRow.inGroup = tbl[idx][codeGroupFldName].ToString();
if (haveDefitionFld && !tbl[idx].IsdefinitionNull()) sysCodeRow.notes = tbl[idx].definition;
sysCodeTbl.AddsysCodeRow(sysCodeRow);
}
tbl[idx][fldName] = item.Key;
}
}
示例5: EstimateAdvice
protected virtual void EstimateAdvice(Data data,
Analysis.AnalysisResult advices,
Analysis.EstimateOptions options,
data.tmpDS.tradeEstimateDataTable toTbl)
{
Analysis.EstimateAdvice(data,advices, options, toTbl);
}
示例6: pictureBox2_Click
private void pictureBox2_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(textBox1.Text))
{
textBox1.Clear();
MessageBox.Show("Nama harus diisi", "WARNING!!!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else
{
data dat = new data(textBox1.Text);
db.OpenConn();
try
{
string sql = string.Concat("INSERT INTO Users " + "([nama]) VALUES " + "('"+textBox1.Text+"')");
db.execQuery(sql);
//MessageBox.Show("Nama Add Sukses");
Test tst = new Test();
this.Close();
tst.Show();
data.cektestbuttonabout = false;
data.cektestbuttoninfo = false;
}
catch (Exception)
{
//MessageBox.Show("Data tidak dimasukkan");
}
db.CloseConn();
}
}
示例7: end
public static void end()
{
// smaller circle
if (state == 2) {
Debug.Log("virk");
state++;
timestampEnd = getMillis();
countEnd = PathTracer.countPixels(Color.white); // slow function creates a delay! Easy solution DONE: calls function when mouse moves out of each inner circle.
dataList[stage] = new data();
dataList[stage].millis = timestampEnd - timestampBeg;
dataList[stage].accuracy = (countStart - countEnd) * 100.0f / countStart ;
dataList[stage].count = countEnd;
Debug.Log("Ending");
Debug.Log("Time: " + (dataList[stage].millis / 1000.0f));
Debug.Log("Accuracy: " + dataList[stage].accuracy);
timeDisplay = dataList[stage].millis / 1000.0f;
PathTracer.displayScore();
Infotoggle.showInfoButton();
Timer.timerFrozen = true;
if(GradiantLamp.lampIsOn==false)
GradiantLamp.skammekrog = true;
}
}
示例8: LoadData
protected override void LoadData(data.tmpDS.stockCodeDataTable toTbl, string[] portfolioCodes)
{
DateTime startTime = DateTime.Now;
LoadStockList(toTbl,portfolioCodes);
UpdateRealTime(toTbl, portfolioCodes);
this.ShowMessage(common.dateTimeLibs.TimeSpan2String(DateTime.Now.Subtract(startTime)));
}
示例9: calcHamma
public static double calcHamma(data raw)
{
double angleGrad = 0;
double buf = (Math.Pow(raw.c, 2) + Math.Pow(raw.a, 2) - Math.Pow(raw.b, 2)) / (2 * raw.a * raw.c);
angleGrad = ToGrad(Math.Acos(buf));
return angleGrad;
}
示例10: GetDataList
/* IEnumerator WaitForRequest(WWW www){
yield return www;
if (www.error == null) {
Debug.Log(www.text);
} else {
Debug.Log("WWW Error: "+ www.error);
}
}
*/
public IEnumerator GetDataList()
{
if (_GameItems == null) {
_GameItems = new List<data> ();
}
if (_GameItems.Count > 0) {
_GameItems.Clear ();
}
WWW getScore = new WWW (display);
yield return getScore;
dataList.AddRange (Regex.Split (getScore.text, ";"));
if (getScore.error != null) {
Debug.Log ("There was an error getting the Leaderboard...");
} else {
for (int i=0; i <= (dataList.Count-1)-3; i+=3) {
data itm = new data();
itm.id = dataList[i].ToString();
itm.name = dataList[i+1].ToString();
itm.score = int.Parse(dataList[i+2].ToString());
_GameItems.Add (itm);
Debug.Log(itm.id + "; " + itm.name + "; " + itm.score);
}
}
}
示例11: SendToPhp
private bool SendToPhp()
{
try
{
data DataObj = new data();
DataObj.navn = sendText;
string JSONString = JsonConvert.SerializeObject(DataObj, Formatting.None);
string url = "http://pj3100.somee.com/getUserInfo.php";
HttpWebRequest newRequest = (HttpWebRequest)WebRequest.Create(url);
newRequest.Method = "POST";
string postData = JSONString;
byte[] pdata = Encoding.UTF8.GetBytes(postData);
newRequest.ContentType = "application/x-www-form-urlencoded";
newRequest.ContentLength = pdata.Length;
Stream myStream = newRequest.GetRequestStream();
myStream.Write(pdata, 0, pdata.Length);
WebResponse myResponse = newRequest.GetResponse();
Stream responseStream = myResponse.GetResponseStream();
StreamReader streamReader = new StreamReader(responseStream);
string result = streamReader.ReadToEnd();
user = JsonConvert.DeserializeObject<List<User>>(result);
streamReader.Close();
responseStream.Close();
myStream.Close();
if(user != null)
{
return true;
}
else
{
return false;
}
}
catch (WebException ex)
{
string _exception = ex.ToString();
Toast error = Toast.MakeText(this, _exception, ToastLength.Long);
error.Show();
Console.WriteLine("--->" + _exception);
return false;
}
}
示例12: DeletePortfolioData
private void DeletePortfolioData(data.baseDS.portfolioDetailDataTable dataTbl, string portfolioCode,string code)
{
for (int idx = 0; idx < dataTbl.Count; idx++)
{
if (dataTbl[idx].RowState== DataRowState.Deleted) continue;
if ( (dataTbl[idx].portfolio==portfolioCode) && (dataTbl[idx].code==code) )
dataTbl[idx].Delete();
}
}
示例13: CreateResponse
private data CreateResponse(List<Sentiment> data)
{
data r = new data();
foreach (Sentiment s in data)
{
r.score.Add(s.score.ToString());
r.date.Add(FromUnixTime(s.timestamp).ToString("dd-MM-yyyy"));
}
return r;
}
示例14: SetKoma
public void SetKoma(data data)
{
//(long)koma["posx"],(long)koma["posy"],koma["owner"].ToString(),num,(bool)koma["promote"]
Debug.Log ("koma"+data.koma["owner"]);
this.Posx = (long)data.koma["posx"];
this.Posy = (long)data.koma["posy"];
this.num = data.num.ToString();
this.owner = data.koma["owner"].ToString();
this.nari = (bool)data.koma["promote"];
}
示例15: ImportOHLCV_CSV
public static bool ImportOHLCV_CSV(string csvFileName,string stockExchangeForNewCode,
data.baseDS.priceDataDataTable priceDataTbl,
libs.OnUpdatePriceData onUpdateDataFunc)
{
return libs.ImportOHLCV_CSV(csvFileName, ',', common.dateTimeLibs.DateTimeFormats.YYMMDD,
stockExchangeForNewCode,libs.CultureInfoVN,
priceDataTbl, DoImportRow, onUpdateDataFunc, null);
}