本文整理汇总了C#中Data.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Data.ToString方法的具体用法?C# Data.ToString怎么用?C# Data.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Data
的用法示例。
在下文中一共展示了Data.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckoutVersion
public override void CheckoutVersion(EngineRequest request, Data.VersionId version)
{
CheckInitialization();
Logger.Storage.Debug("Checking out the version '" + version.ToString() + "'");
EngineMethods.CheckoutVersion act = new EngineMethods.CheckoutVersion(request, version);
act.Execute();
}
示例2: RemoteServerNode
public RemoteServerNode(ServersTreeView treeView, Data.RemoteServer _serverData)
: base(treeView, "/", _serverData, _serverData.ToString())
{
this.ServerData = _serverData;
this.ImageIndex = ServersTreeView.RemoteServerIcon;
this.SelectedImageIndex = this.ImageIndex;
}
示例3: GetInfo
private string GetInfo(Data key)
{
const string format = "{0,-10} {1, 5}";
string ret = key.ToString() + ":";
switch (key)
{
case Data.Time:
return String.Format(format, ret, Clock.TotalFrameTime) + " (ms)";
case Data.Frame:
return String.Format(format, ret, Clock.TotalFrameCount);
case Data.FPS:
return String.Format(format, ret, Clock.FPS);
case Data.MinFPS:
return String.Format(format, ret, Clock.MinFPS);
case Data.AvgFPS:
return String.Format(format, ret, Clock.AverageFPS);
case Data.MaxFPS:
return String.Format(format, ret, Clock.MaxFPS);
case Data.Delta:
return String.Format(format, ret, Clock.LastFrameTime) + " (ms)";
case Data.MinDelta:
return String.Format(format, ret, Clock.MinFrameTime) + " (ms)";
case Data.AvgDelta:
return String.Format(format, ret, Clock.AverageFrameTime) + " (ms)";
case Data.MaxDelta:
return String.Format(format, ret, Clock.MaxFrameTime + " (ms)");
default:
return "invalid key";
}
}
示例4: ServerNode
public ServerNode(ServersTreeView treeView, DirectoryInfo directoryInfo, Data.Server _serverData)
: base(treeView, directoryInfo, _serverData.ToString())
{
this.serverData = _serverData;
this.directory = directoryInfo;
this.ImageIndex = ServersTreeView.LocalServerIcon;
this.SelectedImageIndex = this.ImageIndex;
}
示例5: Decrypt
public static string Decrypt(String strEncText, string strKey24)
{
var sym = new Symmetric(Symmetric.Provider.TripleDES, true);
var key = new Data(strKey24);
var encryptedData = new Data();
encryptedData.Base64 = strEncText;
var decryptedData = new Data();
decryptedData = sym.Decrypt(encryptedData, key);
return decryptedData.ToString();
}
示例6: ServerNode
public ServerNode(ServersTreeView treeView, DirectoryInfo directoryInfo, Data.Server _serverData)
: base(treeView, directoryInfo, _serverData.ToString())
{
IgnoredFiles.Add("ServerManagerData.xml");
IgnoredFiles.Add("eula.txt");
IgnoredFiles.Add("server.jar");
serverData = _serverData;
directory = directoryInfo;
ImageIndex = ServersTreeView.LocalServerIcon;
SelectedImageIndex = ImageIndex;
}
示例7: FxGroupMenuItem
public FxGroupMenuItem(CheckedListBox box_, Data.FXGroup group_)
{
m_listBox = box_;
m_group = group_;
Text = group_.ToString();
}
示例8: ResourceRequest
public ResourceRequest(string user, Data.ResourceId id, GlobalPermission globalPermissions, ResourcePermission resourcePermissions)
: base(user, id.ToString(), globalPermissions, resourcePermissions)
{
}
示例9: KeeperException
/// <summary>
/// new
/// </summary>
/// <param name="path"></param>
/// <param name="error"></param>
public KeeperException(string path, Data.ZoookError error)
: base(string.Concat("path:{", path ?? string.Empty, "}, error:{", error.ToString(), "}"))
{
this.Path = path;
this.Error = error;
}
示例10: Build
public static Uri Build(IDatabase db, Data.VersionId versionId)
{
return new Uri(db.Uri.ToString() + versionId.ToString());
}
示例11: SetTableStructure
public void SetTableStructure(Data.TableStructure newTableDef)
{
Data.TableStructure CurrentTableDef = this.GetTableStructure(newTableDef.Name, false);
bool TablaCreada = false;
if (CurrentTableDef.Columns.Count == 0) {
// Crear la tabla
string Sql = newTableDef.ToString();
this.ExecuteSql(this.CustomizeSql(Sql));
TablaCreada = true;
} else {
// Modificar tabla existente
// Primero dropeo las que ya no son claves primarias
foreach (Data.ColumnDefinition NewFieldDef in newTableDef.Columns.Values) {
if (CurrentTableDef.Columns.ContainsKey(NewFieldDef.Name)) {
Data.ColumnDefinition CurrentFieldDef = CurrentTableDef.Columns[NewFieldDef.Name];
if (CurrentFieldDef.PrimaryKey == true && NewFieldDef.PrimaryKey == false) {
DropPrimaryKey(newTableDef.Name);
break;
}
}
}
// Luego hago las modificaciones pertinentes
string LastColName = null;
List<string> Alterations = new List<string>();
foreach (Data.ColumnDefinition NewFieldDef in newTableDef.Columns.Values) {
if (CurrentTableDef.Columns.ContainsKey(NewFieldDef.Name) == false) {
//Agregar campo a una tabla existente
string Sql = "ADD COLUMN \"" + NewFieldDef.Name + "\" " + NewFieldDef.SqlDefinition(true);
if (this.SqlMode == qGen.SqlModes.MySql) {
if (LastColName == null)
Sql += " FIRST";
else
Sql += " AFTER \"" + LastColName + "\"";
}
Alterations.Add(Sql);
} else {
Data.ColumnDefinition CurrentFieldDef = CurrentTableDef.Columns[NewFieldDef.Name];
if (CurrentFieldDef != NewFieldDef) {
//Existe el campo, pero no es igual... hay que modificarlo
if (this.AccessMode == AccessModes.Npgsql) {
if (CurrentFieldDef.FieldType != NewFieldDef.FieldType || CurrentFieldDef.Lenght != NewFieldDef.Lenght || CurrentFieldDef.Precision != NewFieldDef.Precision)
Alterations.Add("ALTER COLUMN \"" + NewFieldDef.Name + "\" TYPE " + NewFieldDef.SqlType());
if (CurrentFieldDef.Nullable != NewFieldDef.Nullable) {
if (NewFieldDef.Nullable)
Alterations.Add("ALTER COLUMN \"" + NewFieldDef.Name + "\" DROP NOT NULL");
else
Alterations.Add("ALTER COLUMN \"" + NewFieldDef.Name + "\" SET NOT NULL");
}
if (CurrentFieldDef.DefaultValue != NewFieldDef.DefaultValue && NewFieldDef.FieldType != DbTypes.Serial) {
//Cambio de default value (salvo en Serial, que en PostgreSQL es siempre 0)
switch (NewFieldDef.FieldType) {
case DbTypes.VarChar:
case DbTypes.Text:
if (NewFieldDef.DefaultValue == null)
Alterations.Add("ALTER COLUMN \"" + NewFieldDef.Name + "\" SET DEFAULT ''");
else if (NewFieldDef.DefaultValue == "NULL")
Alterations.Add("ALTER COLUMN \"" + NewFieldDef.Name + "\" SET DEFAULT NULL");
else
Alterations.Add("ALTER COLUMN \"" + NewFieldDef.Name + "\" SET DEFAULT '" + NewFieldDef.DefaultValue + "'");
break;
default:
if (NewFieldDef.DefaultValue != null && NewFieldDef.DefaultValue.Length > 0)
Alterations.Add("ALTER COLUMN \"" + NewFieldDef.Name + "\" SET DEFAULT " + NewFieldDef.DefaultValue);
else
Alterations.Add("ALTER COLUMN \"" + NewFieldDef.Name + "\" DROP DEFAULT");
break;
}
}
} else {
string Alter = "MODIFY COLUMN \"" + NewFieldDef.Name + "\" " + NewFieldDef.SqlDefinition(false);
if (this.SqlMode == qGen.SqlModes.MySql) {
if (LastColName == null)
Alter += " FIRST";
else
Alter += " AFTER \"" + LastColName + "\"";
}
Alterations.Add(Alter);
}
}
}
LastColName = NewFieldDef.Name;
}
foreach (Data.ColumnDefinition FieldDef in CurrentTableDef.Columns.Values) {
if (newTableDef.Columns.ContainsKey(FieldDef.Name) == false) {
// TODO: que marque la columna para eliminarla en el futuro
// Alterations.Add("DROP COLUMN \"" + FieldDef.Name + "\"");
}
}
// Ejecuto todas las alteraciones juntas
if (Alterations.Count > 0) {
string Sql = "ALTER TABLE \"" + newTableDef.Name + "\" " + string.Join("," + System.Environment.NewLine, Alterations.ToArray());
this.ExecuteSql(this.CustomizeSql(Sql));
}
}
//Crear y modificar indices
//.........这里部分代码省略.........
示例12: GetItemDefinition
public override Data.ItemDefinition GetItemDefinition(Data.ID itemId, CallContext context)
{
Log.Debug("start GetItemDefinition(..) with itemId " + itemId.ToString() + ", database: " + this.Database.Name);
XPathNavigator element = null;
if (courseCache.ContainsKey(itemId))
{
context.Abort();
element = (XPathNavigator)courseCache[itemId];
}
else
{
element = CourseData.SelectSingleNode(string.Format("//course[@id='{0}']", itemId.ToString()));
if (element != null)
{
context.Abort();
string itemName = element.SelectSingleNode("./name").Value;
ItemDefinition definition = new ItemDefinition(itemId, itemName, TemplateID, ID.Null);
courseCache.Add(itemId, element, 0L);
return definition;
}
}
return base.GetItemDefinition(itemId, context);
}
示例13: showFXRegion
private void showFXRegion(Data.FXGroup group_)
{
ReturnsEval.DataSeriesEvaluator eval = new ReturnsEval.DataSeriesEvaluator(group_.ToString(), m_evaluator.DataType);
foreach (ReturnsEval.DataSeriesEvaluator innerEval in m_evaluator.InnerSeries)
{
Data.Currency ccy = Singleton<Data.FXIDs>.Instance[innerEval.Name];
if (ccy == null)
continue;
if (ccy.IsGroup(group_))
eval.AddInnerEvaluator(innerEval);
}
eval.Evaluate(eval.All.MinDate, eval.All.MaxDate);
ReturnsDisplay rd = new ReturnsDisplay();
rd.Bind(eval);
SI.Controls.ShowForm.Show(rd, FormBorderStyle.Sizable, null, FindForm().Text + " - " + group_.ToString());
}
示例14: GoogleMapMarker
public GoogleMapMarker(Data.ResourceNames r)
{
size = GoogleMapMarkerSize.Mid;
locations = new GoogleMapLocation[0];
icon = "http://ro4m3r.servebeer.com:1337/pictures/SocialGaming/" + r.ToString() + ".png";
Debug.Log(icon);
//if (r == Data.ResourceNames.WOOD)
// icon = "http://images2.wikia.nocookie.net/farmville/images/thumb/c/c4/Wood_Pile-icon.png/35px-Wood_Pile-icon.png";
//else if (r == Data.ResourceNames.ORE)
// icon = "http://www.top1gaming.com/images/wonderlandonline//iron_ore.png";
//else if (r == Data.ResourceNames.CLAY)
// icon = "http://premierreclaimedbricks.co.uk/wp-content/uploads/2011/09/brick-icon4.png";
}
示例15: DeleteResource
public override void DeleteResource(EngineRequest request, Data.ResourceId resource)
{
CheckInitialization();
Logger.Storage.Debug("Deleting resource '" + resource.ToString() + "'...");
EngineMethods.DeleteResource act = new EngineMethods.DeleteResource(request, resource);
act.Execute();
}