public override void CopyFrom(YqlNode source) { base.CopyFrom(source); var castedSource = (YqlPropertyNode)source; AbstractPropertyId = castedSource.AbstractPropertyId; }
internal static void RegisterXmlElements() { foreach (YqlOperation value in Enum.GetValues(typeof(YqlOperation))) { YqlNode.RegisterXmlElement(typeof(YqlOperationNode), value.ToString()); } }
public override void CopyFrom(YqlNode source) { base.CopyFrom(source); var castedSource = (YqlValueNode)source; Value = castedSource.Value; }
public override void CopyFrom(YqlNode source) { base.CopyFrom(source); var castedSource = (YqlListContainsNode)source; this.List = CloneIfNotNull(castedSource.List); this.ItemToFind = CloneIfNotNull(castedSource.ItemToFind); }
public static YqlNode CloneIfNotNull(YqlNode source) { if (source == null) { return(null); } return(source.Clone()); }
internal static XElement SaveToXmlOrNull(YqlNode node) { if (node == null) { return(null); } return(node.SaveToXml()); }
public YqlTextMatchNode(YqlNode sourceString, string searchText, bool wholeWords, bool matchAllWords) { this.SourceString = sourceString; this.SearchText = searchText; this.WholeWords = wholeWords; this.MatchAllWords = matchAllWords; }
public override void CopyFrom(YqlNode source) { base.CopyFrom(source); var castedSource = (YqlListNode)source; this.Items.Clear(); this.Items.AddRange(castedSource.Items.Select(x => x.Clone())); }
public override void CopyFrom(YqlNode source) { base.CopyFrom(source); var castedSource = (YqlObjectActionNode)source; this.TargetObject = YqlNode.CloneIfNotNull(castedSource.TargetObject); this.TargetObjectType = castedSource.TargetObjectType; }
public override void CopyFrom(YqlNode source) { base.CopyFrom(source); var castedSource = (YqlOperationNode)source; Operation = castedSource.Operation; Args.Clear(); Args.AddRange(castedSource.Args.Select(x => x.Clone())); }
public YqlCompiledNode(YqlNode node, Expression expression, IEnumerable <YqlCompiledNode> compiledArgs) { if (node == null) { throw new ArgumentNullException("node"); } this.Node = node; this.Expression = expression; this.CompiledArgs = new ReadOnlyCollection <YqlCompiledNode>(compiledArgs.ToArray()); }
public override void CopyFrom(YqlNode source) { base.CopyFrom(source); var castedSource = (YqlTextMatchNode)source; this.SourceString = castedSource.SourceString; this.SearchText = castedSource.SearchText; this.WholeWords = castedSource.WholeWords; this.MatchAllWords = castedSource.MatchAllWords; }
public YqlNode Clone() { #if true YqlNode clonedNode = (YqlNode)Activator.CreateInstance(GetType()); clonedNode.CopyFrom(this); #else XElement xxx = this.SaveToXml(); Debug.WriteLine(xxx.ToString()); YqlNode clonedNode = YqlNode.LoadFromXml(xxx); #endif return(clonedNode); }
internal static YqlNode LoadFromXml(XElement element) { if (element == null) { return(null); } Type type = xmlNameToType[element.Name.ToString()]; YqlNode node = (YqlNode)Activator.CreateInstance(type); node.LoadXmlElement(element); return(node); }
internal Func <YqlExecutionContext, bool> CompileMessage(YqlNode rootNode) { var compiledNode = CompileNode(rootNode.Clone()); //Debug.WriteLine(compiledNode.Expression.ToString()); //Debug.WriteLine("-------"); var lambda = Expression.Lambda <Func <YqlExecutionContext, bool> >(compiledNode.Expression, ExecutionContextParameter); //Debug.WriteLine(lambda.ToString()); //Debug.WriteLine("-------"); Func <YqlExecutionContext, bool> func = lambda.Compile(); return(func); }
internal static void RegisterXmlElements(YamsterModelType modelType, Type classType, Type enumType) { if (!typeof(YqlPropertyNode).IsAssignableFrom(classType)) { throw new ArgumentException("The classType must inherit from YqlPropertyNode"); } if (!enumType.IsEnum) { throw new ArgumentException("The enumType must be an enum"); } foreach (Enum enumValue in Enum.GetValues(enumType)) { // E.g. "Message_UserIdRepliedTo" string xmlName = modelType.ToString() + "_" + enumValue.ToString(); YqlNode.RegisterXmlElement(classType, xmlName); } }
internal static void RegisterXmlElements() { var typeCodes = new TypeCode[] { TypeCode.Boolean, TypeCode.DateTime, TypeCode.Int16, TypeCode.Int32, TypeCode.Int64, TypeCode.UInt16, TypeCode.UInt32, TypeCode.UInt64, TypeCode.String }; foreach (TypeCode typeCode in typeCodes) { YqlNode.RegisterXmlElement(typeof(YqlValueNode), typeCode.ToString()); } }
public YamsterThreadQuery(string title, YqlNode filterNode) : base(title, filterNode) { }
public virtual void CopyFrom(YqlNode source) { this.SourceLocation = source.SourceLocation; }
public virtual void CopyFrom(YamsterModelQuery source) { this.Title = source.Title; this.FilterNode = YqlNode.CloneIfNotNull(source.FilterNode); }
public YqlCompiledNode(YqlNode node, Expression expression) : this(node, expression, new YqlCompiledNode[0]) { }
protected YqlPropertyNode(PropertyMapping mapping, YamsterModelType targetObjectType, YqlNode targetObject) : base(targetObjectType, targetObject) { this.Mapping = mapping; }
public YqlUserPropertyNode(YqlUserProperty propertyId, YqlNode targetObject = null) : base(UserMapping, YamsterModelType.User, targetObject) { this.PropertyId = propertyId; }
public YqlMessagePropertyNode(YqlMessageProperty propertyId, YqlNode targetObject = null) : base(MessageMapping, YamsterModelType.Message, targetObject) { this.PropertyId = propertyId; }
public YqlThreadPropertyNode(YqlThreadProperty propertyId, YqlNode targetObject = null) : base(ThreadMapping, YamsterModelType.Thread, targetObject) { this.PropertyId = propertyId; }
public YamsterMessageQuery(string title, YqlNode filterNode) : base(title, filterNode) { }
protected void LoadFromXml(XElement element) { this.Title = XmlUtilities.GetStringAttribute(element, "Title"); this.FilterNode = YqlNode.LoadFromXml(XmlUtilities.GetChildElement(element, "FilterNode")); }
protected override void LoadXmlElement(XElement element) { this.List = LoadFromXmlOrNull(element, "List"); this.ItemToFind = LoadFromXmlOrNull(element, "ItemToFind"); }
public YqlCompiledNode CompileNode(YqlNode node) { return(node.CompileNode(this)); }
public YamsterModelQuery(string title, YqlNode filterNode) { this.Title = title; this.FilterNode = filterNode; }