本文整理汇总了C#中KacTalk.ktString类的典型用法代码示例。如果您正苦于以下问题:C# ktString类的具体用法?C# ktString怎么用?C# ktString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ktString类属于KacTalk命名空间,在下文中一共展示了ktString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ktRequestObject
public ktRequestObject(ktString obj, ktString memb, Dictionary<ktString, ktString> args, ktTalkFormat form = ktTalkFormat._DEFUALT)
{
Object = obj;
Member = memb;
Arguments = args;
Format = form;
}
示例2: ktError
/// <summary>
/// Constructor for the error class (mostely used when throwing errors)
/// </summary>
/// <param name="Error">The error message</param>
/// <param name="ErrorNum">The error number</param>
/// <param name="LineNo">The line on which the error was thrown</param>
/// <param name="CharPos">The character by which the error was thrown</param>
public ktError(ktString Error, ktERR ErrorNum, int LineNo, int CharPos)
: base(Error)
{
m_Num = ErrorNum;
m_LineNo = LineNo;
m_CharPos = CharPos;
}
示例3: SetVariable
public bool SetVariable(ktString Name, ktValue Value, bool Add, bool Copy, bool IgnoreConstant)
{
// Nothing to use??
if (Name.IsEmpty() || (Value == null) || (m_Block == null))
{
return false;
}
return m_Block.SetVariable(Name, Value, Add, Copy, IgnoreConstant);
}
示例4: ktModule
public ktModule(ktString Name, ktString Filename, bool Load)
: base("ktIntObj", 0)
{
m_Name = Name;
m_Filename = Filename;
if (Load)
{
}
}
示例5: ktContext
public ktContext(ktString Name)
: base("ktContext", 0)
{
m_Name = Name;
m_Parent = null;
m_Aliases = null;
m_Variables = null;
m_Functions = null;
m_AddIfNotSet = true;
}
示例6: Compare
public override int Compare(ktString op, ktList arguments)
{
if (arguments.Count == 1)
{
return Compare(op, (ktValue)arguments.FirstNode.Value);
}
else
{
throw new ktError("Compare for more than 1 value is not implemented in '" + this.m_Name + "'!");
}
}
示例7: ktValue
public ktValue(ktString Name, ktString Type, ktIntObj Object,
bool HardType, bool Constant, ktClass CallbackClass)
: base("ktValue", 0)
{
m_Object = Object;
SetName(Name);
SetType(Type);
SetHardType(HardType);
SetConstant(Constant);
SetCallback(CallbackClass);
}
示例8: ktClass
public ktClass(ktString Name, ktClass Parent, ktList Properties, ktList Methods,
bool AddIfNotSet, bool IsClass_, bool HardType = false, bool IsConstant = false)
: base("ktClass", 0)
{
m_Name = Name;
m_Parent = Parent;
m_Properties = Properties;
m_Methods = Methods;
m_AddIfNotSet = AddIfNotSet;
m_IsClass = IsClass_;
m_HardType = HardType;
m_IsConstant = IsConstant;
}
示例9: Initiate
public override bool Initiate(ktString URI, ktString APIKey)
{
m_Initiated = true;
m_URI = URI;
m_Key = APIKey;
OpenConnection();
CheckVersion();
RequestAvailableObjects();
CloseConnection();
return true;
}
示例10: ktDelegateFunction
public ktDelegateFunction(ktString Name, ktFunction_Double_Delegate Delegate)
: base(Name, null, null, ktValue.Null)
{
m_Arguments = new ktList();
m_Arguments.Add(new ktValue("D", "double",
kacTalk.Main.GetClass("double"),
true, true));
m_Delegate = delegate(ktList Args)
{
if ((Args == null) || (Args.FirstNode == null) ||
(Args.FirstNode.Value == null))
{
throw new ktError("Didn't get an argument for '" +
Name + "'!", ktERR.MISSING);
}
//ktDebug.Log( "ktDF::DOUBLE(" +Args.FirstNode.Value.ToString() + ")" );
ktString S_In = new ktString(Args.FirstNode.Value.ToString());
double D_In = 0.0;
double D_Out = 0.0;
try
{
if (System.Globalization.NumberFormatInfo.CurrentInfo.NumberDecimalSeparator == ",")
{
S_In.Replace(".", ",", true);
}
D_In = S_In.ToDouble();
}
catch (Exception E)
{
if (E.GetType() == typeof(System.FormatException) && !S_In.IsEmpty())
{
throw new ktError("ktDouble::CreateObject: Cant make '" + S_In + "' into an double", ktERR.WRONGTYPE);
}
}
ktDebug.Log("D_In: " + D_In.ToString());
D_Out = Delegate(D_In);
ktDebug.Log("D_Out: " + D_Out.ToString());
return new ktValue("return", "double",
kacTalk.Main.MakeObjectOf("double", D_Out),
true, true);
};
}
示例11: ktTalker
public ktTalker( ktString InfoStr, ktTalkerChannel TalkerChannel = null )
: base("ktTalker", 0)
{
m_InfoMap = ParseInfoString(InfoStr);
m_APIKey = GetProperty("KEY");
m_URI = GetProperty("URI");
if (TalkerChannel != null)
{
m_Channel = TalkerChannel;
}
else
{
ktString Channel = "";
if (m_InfoMap.ContainsKey("CHANNEL")) Channel = m_InfoMap["CHANNEL"];
else if (m_InfoMap.ContainsKey("PROTO")) Channel = m_InfoMap["PROTO"];
else if (m_InfoMap.ContainsKey("PROTOCOL")) Channel = m_InfoMap["PROTOCOL"];
if (Channel.IsEmpty())
{
throw new ktError("ktTalker wasn't given a channel!");
}
try
{
Type type = Type.GetType("ktTalkers.ktTalker" + Channel.Capitalize() + "Channel");
object[] args = { this };
m_Channel = (ktTalkerChannel)Activator.CreateInstance(type,args);
}
catch (Exception Exc)
{
if ((Exc is ArgumentNullException) || (Exc is ArgumentException) || (Exc is NotSupportedException)
|| (Exc is InvalidComObjectException) || (Exc is TypeLoadException))
{
throw new ktError("ktTalker couldn't create a Channel object for '" + Channel + "'!");
}
else
{
throw Exc;
}
}
}
}
示例12: _RunMethod
public override ktValue _RunMethod(ktString Name, ktList Arguments)
{
ktValue Value = ktValue.Null;
switch (Name.AsLower())
{
case "run":
case "_run":
case "execute":
case "_execute":
case "_func_call":
{
Value = Run( Arguments );
break;
}
default:
{
throw new ktError("Couldn't find the method '" +
Name + "' in class '" + m_Name + "'.", ktERR._404);
}
}
return Value;
}
示例13: SetProperty
public override ktValue SetProperty(ktString Name, ktValue Value)
{
if ((Name == "this") || (Name == "_this") ||
(Name == "object") || (Name == "_object") ||
(Name == "_") || (Name.IsEmpty()))
{
/*try {
m_Value = Convert.ToInt32( Value.ToString() );
} catch (Exception E) {
if (E.GetType() == typeof( System.FormatException )) {
throw new ktError( "kactalkClass::CreateObject: Cant make '" + Value + "' into an integer", ktERR.WRONGTYPE );
}
}*/
} /*else if (Name == "MathMode") {
// m_Value.MathMode = (((ktClass)Value.Value).ToString().ToLower() == "true");
m_Value.MathMode = Value.ToBool();
} */else
{
throw new ktError("Couldn't find the property '" +
Name + "' in class '" + m_Name + "'.", ktERR._404);
}
return GetProperty("_");
}
示例14: AddAvailableObject
internal void AddAvailableObject(ktString o)
{
if (m_AvailableObjects == null)
m_AvailableObjects = new ktList();
m_AvailableObjects.Add(o);
}
示例15: AddExtraParameter
public void AddExtraParameter(ktString name, ktString value)
{
m_ExtraParams.Add(name, value);
}