public RuleElementDefiniton(Literal literal) { Type = ExpressionElementType.Literal; EntityName = literal.EntityName; AttributeName = literal.AttributeName; Negated = literal.Negated; }
public Frm_ContextualList(Form FrmParent, object Items, ExpressionElementType ItemType) { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); FormParent = FrmParent; TypeItem = ItemType; LV_Items.Items.Clear(); //ExpressionFunctionInfo if (!(Items == null)) { Type ItemsType = Items.GetType(); if (ItemsType.Equals(typeof(string[]))) //List of operators { string[] Elements = (string[])Items; //int iIcon = (int) TypeItem; foreach (string ElemName in Elements) { LV_Items.Items.Add(ElemName, 2); } } else if (ItemsType.Equals(typeof(ExpressionFunctionInfo[]))) //List of functions { FuncListInfo = (ExpressionFunctionInfo[])Items; foreach (ExpressionFunctionInfo sFuncInfo in FuncListInfo) { ListViewItem It = LV_Items.Items.Add(sFuncInfo.Name, 1); It.ToolTipText = sFuncInfo.FunctionExample; } } else //List of elements (CAN parameters, virtual channels, built-in signals) { ExpressionElementItem[] Elements = (ExpressionElementItem[])Items; int iIcone = -1; foreach (ExpressionElementItem sElem in Elements) { switch (sElem.Source) { case ExpressionElementChannelSource.CAN_Paramater: iIcone = 3; break; case ExpressionElementChannelSource.VirtualChannel: iIcone = 4; break; case ExpressionElementChannelSource.BuiltInSignal: iIcone = 5; break; case ExpressionElementChannelSource.DataChannel: iIcone = 0; break; } LV_Items.Items.Add(sElem.Name, iIcone); } } } }
public RuleElementDefiniton(Connective connective) { Type = ExpressionElementType.Connective; ConnectiveType = connective.Type; }