当前位置: 首页>>代码示例>>C#>>正文


C# KacTalk.ktString类代码示例

本文整理汇总了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;
 }
开发者ID:ChrisHinde,项目名称:KacTalk_NET,代码行数:7,代码来源:ktTalker.cs

示例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;
 }
开发者ID:ChrisHinde,项目名称:KacTalk_NET,代码行数:14,代码来源:ktError.cs

示例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);
        }
开发者ID:ChrisHinde,项目名称:KacTalk_NET,代码行数:10,代码来源:ktRunStatement.cs

示例4: ktModule

        public ktModule(ktString Name, ktString Filename, bool Load)
            : base("ktIntObj", 0)
        {
            m_Name = Name;
            m_Filename = Filename;

            if (Load)
            {
            }
        }
开发者ID:ChrisHinde,项目名称:KacTalk_NET,代码行数:10,代码来源:ktModule.cs

示例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;
 }
开发者ID:ChrisHinde,项目名称:KacTalk_NET,代码行数:10,代码来源:ktContext.cs

示例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 + "'!");
     }
 }
开发者ID:ChrisHinde,项目名称:KacTalk_NET,代码行数:11,代码来源:ktBool.cs

示例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);
        }
开发者ID:ChrisHinde,项目名称:KacTalk_NET,代码行数:12,代码来源:ktValue.cs

示例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;
 }
开发者ID:ChrisHinde,项目名称:KacTalk_NET,代码行数:13,代码来源:ktClass.cs

示例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;
        }
开发者ID:ChrisHinde,项目名称:KacTalk_NET,代码行数:15,代码来源:ktHttpTalker.cs

示例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);
            };
        }
开发者ID:ChrisHinde,项目名称:KacTalk_NET,代码行数:46,代码来源:ktFunction.cs

示例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;
                    }
                }
            }
        }
开发者ID:ChrisHinde,项目名称:KacTalk_NET,代码行数:45,代码来源:ktTalker.cs

示例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;
        }
开发者ID:ChrisHinde,项目名称:KacTalk_NET,代码行数:24,代码来源:ktFunctionClass.cs

示例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("_");
        }
开发者ID:ChrisHinde,项目名称:KacTalk_NET,代码行数:24,代码来源:ktRunStatement.cs

示例14: AddAvailableObject

        internal void AddAvailableObject(ktString o)
        {
            if (m_AvailableObjects == null)
                m_AvailableObjects = new ktList();

            m_AvailableObjects.Add(o);
        }
开发者ID:ChrisHinde,项目名称:KacTalk_NET,代码行数:7,代码来源:ktTalker.cs

示例15: AddExtraParameter

 public void AddExtraParameter(ktString name, ktString value)
 {
     m_ExtraParams.Add(name, value);
 }
开发者ID:ChrisHinde,项目名称:KacTalk_NET,代码行数:4,代码来源:ktTalker.cs


注:本文中的KacTalk.ktString类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。