本文整理汇总了C#中Element.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Element.ToString方法的具体用法?C# Element.ToString怎么用?C# Element.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Element
的用法示例。
在下文中一共展示了Element.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FindEqual
public override List<int> FindEqual(Element key)
{
List<int> row;
if (_entries.TryGetValue(key.ToString(), out row)) {
return row;
}
return new List<int>();
}
示例2: fadeElement
public void fadeElement(Element element)
{
float elementCount = element.count;
float elementMinCount = element.minCount;
if(element.minCount < 1)
{
elementMinCount = 1;
}
alpha = elementCount / elementMinCount;
if (alpha > .5f) {
string test = element.ToString();
}
}
示例3: Send
/// <summary>
/// Send a xml element over the XmppConnection
/// </summary>
/// <param name="e"></param>
public virtual void Send(Element e)
{
Send(e.ToString());
}
示例4: Send
public override void Send(Element e)
{
// this is a hack to not send the xmlns="jabber:component:accept" with all packets
Element dummyEl = new Element("a");
dummyEl.Namespace = Uri.ACCEPT;
dummyEl.AddChild(e);
string toSend = dummyEl.ToString();
Send(toSend.Substring(35, toSend.Length - 35 - 4));
}
示例5: Send
private void Send(Element el)
{
Send(el.ToString());
}
示例6: FindClassOrObject
private void FindClassOrObject(Element e)
{
try
{
e.Type = FindClass2(e.TypeName);
}
catch (Exception x)
{
DoLog("Assigning object-type to member [{0}] - TypeName [{1}]", e.ToString(), e.TypeName);
e.Type = ObjectClass;
}
}
示例7: toTermRangeQuery
/**
* 组装TermRangeQuery
* @param elements
* @return
*/
private TermRangeQuery toTermRangeQuery(Element fieldNameEle, LinkedList<Element> elements)
{
bool includeFirst = false;
bool includeLast = false;
String firstValue = null;
String lastValue = null;
//检查第一个元素是否是[或者{
Element first = elements.First.Value;
if ('[' == first.Type)
{
includeFirst = true;
}
else if ('{' == first.Type)
{
includeFirst = false;
}
else
{
throw new Exception("表达式异常");
}
//检查最后一个元素是否是]或者}
Element last = elements.Last.Value;
if (']' == last.Type)
{
includeLast = true;
}
else if ('}' == last.Type)
{
includeLast = false;
}
else
{
throw new Exception("表达式异常, RangeQuery缺少结束括号");
}
if (elements.Count < 4 || elements.Count > 5)
{
throw new Exception("表达式异常, RangeQuery 错误");
}
//读出中间部分
Element e2 = elements.ElementAt(1);
if ('\'' == e2.Type)
{
firstValue = e2.ToString();
//
Element e3 = elements.ElementAt(2);
if (',' != e3.Type)
{
throw new Exception("表达式异常, RangeQuery缺少逗号分隔");
}
//
Element e4 = elements.ElementAt(3);
if ('\'' == e4.Type)
{
lastValue = e4.ToString();
}
else if (e4 != last)
{
throw new Exception("表达式异常,RangeQuery格式错误");
}
}
else if (',' == e2.Type)
{
firstValue = null;
//
Element e3 = elements.ElementAt(2);
if ('\'' == e3.Type)
{
lastValue = e3.ToString();
}
else
{
throw new Exception("表达式异常,RangeQuery格式错误");
}
}
else
{
throw new Exception("表达式异常, RangeQuery格式错误");
}
return new TermRangeQuery(fieldNameEle.ToString(), firstValue, lastValue, includeFirst, includeLast);
}
示例8: Send
public override void Send(Element e)
{
if (!(ClientSocket is BoshClientSocket))
{
// this is a hack to not send the xmlns="jabber:client" with all packets
Element dummyEl = new Element("a");
dummyEl.Namespace = Uri.CLIENT;
dummyEl.AddChild(e);
string toSend = dummyEl.ToString();
Send(toSend.Substring(25, toSend.Length - 25 - 4));
}
else
base.Send(e);
}
示例9: FormatValue
private string FormatValue(Element e)
{
if (e.DataType == ElementType.DATETIME) {
return e.DateTimeValue().ToString();
}
else return e.ToString();
}
示例10: Send
public void Send(Element elm)
{
Send(elm.ToString());
}
示例11: ClientOnOnStreamError
private void ClientOnOnStreamError(object sender, Element element)
{
_connecting = false;
_connected = false;
_logger.WarnFormat("Stream error: {0}", element.ToString());
}
示例12: ReceiveElementNegativeProtection
public void ReceiveElementNegativeProtection(int protection, Element element){
EffectUIManager.GetInstance().AddTextEffect(this, new TextResistanceLoss(protection, element));
Logger.Debug("Receive element negative protection : " + protection + " for element : " + element._name);
/*int val = Math.Min (protection, Protections[element]);
Protections[element] -= val;
SommeProtection -= val;
protection -= val;
int max = MaxProtection - SommeNegativeProtection;
ProtectionsNegative[element] += Math.Min (max, protection);
SommeNegativeProtection += Math.Min (max, protection);*/
ProtectionsNegative[element] = Mathf.Min(ProtectionsNegative[element] + protection, 100);
Logger.Trace("Protection " + element.ToString() + " new value : " + Protections[element]);
}
示例13: SetElement
internal void SetElement(Element toElement)
{
comboBox1.SelectedText = toElement.ToString();
}
示例14: ClientConnectionOnOnStreamError
private void ClientConnectionOnOnStreamError(object sender, Element element)
{
Console.WriteLine("XMPP Stream Error of type {0}. ", element.GetType());
Console.WriteLine(element.ToString());
}
示例15: Print
internal static void Print(Element el)
{
Console.WriteLine(el.ToString(Formatting.Indented));
Console.WriteLine("\r\n");
}