本文整理汇总了C#中Data类的典型用法代码示例。如果您正苦于以下问题:C# Data类的具体用法?C# Data怎么用?C# Data使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Data类属于命名空间,在下文中一共展示了Data类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AbilityEntry
public AbilityEntry(Data.AbilityEntry Entry)
{
this.Index = Entry.Index;
this.Note = Entry.Note;
this.Pokemon = Entry.Pokemon.Name;
this.Ability = Entry.Ability.Name;
}
示例2: Entered
/*
* Corey Paxton - 4/5/2014 - Initial Version
*/
public override void Entered(StateControl from, Data.User user, Data.User returnUser)
{
base.Entered(from, user, returnUser);
this.txt_currentName.Text = user.Name;
this.txt_newName.Text = user.Name;
ddl_groups.DataSource = Data.GroupList.Instance;
if (this.CurrentUser.Status == Data.User.UserType.Teacher)
{
// Hide group stuff, but display the password stuff
lbl_group.Visible = false;
ddl_groups.Visible = false;
lbl_newPassword.Visible = true;
lbl_newPasswordConfirm.Visible = true;
txt_newPassword.Visible = true;
txt_newPasswordConfirm.Visible = true;
}
else if (this.CurrentUser.Status == Data.User.UserType.Student)
{
// Display group stuff, hide password
lbl_group.Visible = true;
ddl_groups.Visible = true;
lbl_newPassword.Visible = false;
lbl_newPasswordConfirm.Visible = false;
txt_newPassword.Visible = false;
txt_newPasswordConfirm.Visible = false;
if(this.CurrentUser.GroupName != null)
ddl_groups.SelectedItem = Data.GroupList.Instance.GetByName(this.CurrentUser.GroupName);
}
}
示例3: AddMethod
public void AddMethod(MethodParamResult inMethod,Data.Inputs.Interfaces.IEventInput input)
{
MethodParamPair pair = new MethodParamPair(inMethod, input);
_methods.AddLast(pair);
if (_current == null)
_current = _methods.First;
}
示例4: InitGPIO
static void InitGPIO(this MainPage page, Data data)
{
GpioController gpio = GpioController.GetDefault();
page.GpioPinInfo.Text = "Led pin: " + Data.LED_PIN.ToString();
// Show an error if there is no GPIO controller
if (gpio == null)
{
data.pin = null;
page.GpioStatus.Text = "There is no GPIO controller on this device.";
return;
}
data.pin = gpio.OpenPin(Data.LED_PIN);
GpioPin pin = data.pin;
data.pinValue = GpioPinValue.High;
pin.Write(data.pinValue);
pin.SetDriveMode(GpioPinDriveMode.Output);
page.GpioStatus.Text = "GPIO pin initialized correctly.";
var timer = data.Timer;
if (pin != null)
{
timer.Start();
}
}
示例5: DeleteEventAction
protected void DeleteEventAction(object sender, EventArgs e)
{
HttpCookie cookie = Request.Cookies["BrowserDate"];
Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
if (Request.QueryString["O"] != null)
{
if (Request.QueryString["U"] != null)
{
dat.Execute("DELETE FROM User_GroupEvent_Calendar WHERE UserID=" + Session["User"].ToString() +
" AND GroupEventID=" + Request.QueryString["ID"].ToString() + " AND ReoccurrID=" +
Request.QueryString["O"].ToString());
}
else
{
dat.Execute("DELETE FROM GroupEvent_Members WHERE UserID=" + Session["User"].ToString() +
" AND GroupEventID=" + Request.QueryString["ID"].ToString() + " AND ReoccurrID=" +
Request.QueryString["O"].ToString());
}
}
else
{
dat.Execute("DELETE FROM User_Calendar WHERE UserID=" + Session["User"].ToString() +
" AND EventID=" + Request.QueryString["ID"].ToString());
}
RemovePanel.Visible = false;
ThankYouPanel.Visible = true;
}
示例6: UploadContent
public UploadContent(IDatabase db, Data.Version version,
int sendTimeout, int receiveTimeout, int sendBufferSize, int receiveBufferSize)
: base(sendTimeout, receiveTimeout, sendBufferSize, receiveBufferSize)
{
_db = db;
_version = version;
}
示例7: OpenquantDataLoader
/// <summary>
/// the data loader for openquant.
/// </summary>
/// <param name="instrument">The instrument.</param>
/// <param name="dtfrom">The dtfrom.</param>
/// <param name="dtto">The dtto.</param>
/// <param name="barsize">The barsize.</param>
/// <returns></returns>
public static LoaderTypes OpenquantDataLoader(string instrument, DateTime dtfrom, DateTime dtto,
Data.Data.BarType bartype, long barsize)
{
var BarSerie = new DataArray();
Console.WriteLine("Initialized the Openquant-Encog Loader");
try
{
// BarSerie = this.GetHistoricalBars(dtfrom, dtto, BarType.Time, barsize);
// BarSerie = this.GetHistoricalBars(this.MarketDataProvider,Instrument,dtfrom,dtto,(int)barsize);
// BarSerie = DataManager.GetHistoricalBars(instrument, Data.Data.BarType.Time, 3600);
var typeLoaded = new LoaderTypes(instrument, dtfrom, dtto, bartype, barsize);
Console.WriteLine("Loaded Types instrument:" + typeLoaded.Instrument);
return typeLoaded;
}
catch (Exception ex)
{
var er = new EncogError(ex);
Console.WriteLine("Error :" + ex.Message);
Console.WriteLine("Error :" + ex.StackTrace);
Console.WriteLine("Error:" + ex.InnerException);
Console.WriteLine("Full message:" + ex);
return null;
}
}
示例8: CheckAgencyPropertyExists
private static bool CheckAgencyPropertyExists(Property agencyProperty, Data.Models.Property databasePropertyDto)
{
IPropertyMatcherFactory factory = new PropertyMatcherFactory();
IPropertyMatcher propertyMatcher = factory.GetPropertyMatcher(agencyProperty.AgencyCode);
return propertyMatcher.IsMatch(agencyProperty, Mapper.Map<Property>(databasePropertyDto));
}
示例9: Fire
protected override void Fire(object sender, EventArgs e)
{
if (!UserInfo.isDoctor(Session))
{
alertAndGoback("you are not a doctor. Please login");
return;
}
String today = DateTime.Now.Date.ToString().Substring(0, 10);
DOS.Text = today;
UserID.Text = Param.getString("pId");
Data result = new Data();
DBC dbc = new DBC();
Data data = new Data();
/*dbc.open();
data.add("pID", Param.get("pId"));
result = dbc.select("SELECT * FROM Users WHERE UserID = @pId", data);
dbc.close();*/
SurgeryBiz biz = new SurgeryBiz();
biz.view(data);
userNameLabel.Text = Param.getString("pId");
type.DataSource = biz.getType(data).Source;
type.DataBind();
}
示例10: Board
// Used to populate the board in a networked game
public Board(Data data)
{
Width = data.Width;
Height = data.Height;
SetColors(data.Colors);
floodFiller = new FloodFiller(colors);
}
示例11: Deserialize
public object Deserialize(IStorage storage, Data.Node data, object result)
{
return data is Data.DateTime ? (data as Data.DateTime).Value :
data is Data.Binary ? new System.DateTime(BitConverter.ToInt64((data as Data.Binary).Value, 0)) :
data is Data.String ? System.DateTime.Parse((data as Data.String).Value) :
new System.DateTime();
}
示例12: GenerateGraphBody
public string GenerateGraphBody(string id, Data[] data, string[] tick_label)
{
string ret = "";
ret += "<div id=\"" + id + "\"></div>\n";
ret += "<script>\n";
ret += "(function basic_radar(container) {\n";
for (int x = 0; x < data.GetLength(0); x++)
{
ret += "var s" + x + " = { label : '" + data[x].label + "', data : [";
for (int y = 0; y < data[x].data.GetLength(0); y++)
{
if (y != 0)
{
ret += ",";
}
ret += "[" + y + "," + data[x].data[y] + "]";
}
ret += "]};";
}
ret += "var ticks = [\n";
for (int i = 0; i < tick_label.Length; i++)
{
if (i != 0)
{
ret += ",";
}
ret += "[" + i + ", \"" + tick_label[i] + "\"]\n";
}
ret += "]\n";
ret += "graph = Flotr.draw(container,[";
for (int x = 0; x < data.GetLength(0); x++)
{
if (x != 0)
{
ret += ",";
}
ret += "s" + x;
}
ret += "], {\n";
ret += "radar : { show : true}, \n";
ret += "grid : { circular : true, minorHorizontalLines : true}, \n";
ret += "yaxis : { min : " + m_min + ", max : " + m_max + ", minorTickFreq : 2}, \n";
ret += "xaxis : { ticks : ticks},\n";
ret += "mouse : { track : true}\n";
ret += "});\n";
ret += "})(document.getElementById(\"" + id + "\"));\n";
ret += "</script>\n";
return ret;
}
示例13: Deserialize
public object Deserialize(IStorage storage, Data.Node data, object result)
{
Kean.Collection.IList<Data.Node> nodes;
Reflect.Type type;
Reflect.Type elementType;
type = data.Type;
elementType = this.GetElementType(type);
if (data is Data.Collection)
nodes = (data as Data.Collection).Nodes;
else
{ // only one element so it was impossible to know it was a collection
nodes = new Kean.Collection.List<Data.Node>(data);
data.Type = data.OriginalType ?? elementType;
Uri.Locator locator = data.Locator.Copy();
locator.Fragment += "0";
data.Locator = locator;
}
if (result.IsNull())
result = this.Create(type, elementType, nodes.Count);
int i = 0;
foreach (Data.Node child in nodes)
{
int c = i++; // ensure c is unique in every closure of lambda function below
storage.Deserialize(child, elementType, d => this.Set(result, d, c));
}
return result;
}
示例14: Entered
public override void Entered(StateControl from, Data.User user, Data.User returnUser)
{
base.Entered(from, user, returnUser);
txt_newName.Text = string.Empty;
txt_oldName.Text = string.Empty;
dtg_ungrouped_users.DataSource = Data.UserList.Instance.ApplyGroupFilter("Ungrouped Users");
}
示例15: Download
public void Download(Data.RemoteServer _data, string _localFile, string _remoteFile)
{
this.data = _data;
this.remoteFile = _remoteFile;
this.localFile = _localFile;
string[] files = Utils.Ftp.directoryListDetailed(data, remoteFile.Substring(0, remoteFile.LastIndexOf("/")) + "/");
foreach(string elem in files)
{
string[] splitted = elem.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
if (splitted.Length >= 9)
{
string name = "";
for (int i = 8; i < splitted.Length; i++)
{
name += splitted[i] + " ";
}
name = Utils.Strings.CutLastChars(name, 1);
if (name == Path.GetFileName(remoteFile))
this.fileSize = long.Parse(splitted[4]);
}
}
if (this.fileSize > 65536)
{
worker.RunWorkerAsync();
this.ShowDialog();
}
else
{
worker_DoWork(null, null);
}
}