Example #1
0
 public StatusMessage(Severity severity, string message, params string[] fieldNames) : this(severity, message)
 {
     foreach (string fieldName in fieldNames)
     {
         FieldNames.Add(fieldName);
     }
 }
Example #2
0
 private void FillNames()
 {
     for (int i = 0; i < Rows.First().Length; i++)
     {
         FieldNames.Add("Column " + i);
     }
 }
Example #3
0
 /// <summary>Checks whether all fields used at options are present and adds them if not.</summary>
 /// <param name="option">Options to check.</param>
 public void CheckFieldsPresent(ResultOption option)
 {
     foreach (var fieldName in option.FieldNames)
     {
         if (!FieldNames.Contains(fieldName))
         {
             FieldNames.Add(fieldName);
         }
     }
 }
Example #4
0
        public void Add(string name, Type fieldType, Func <object, object> getter, Action <object, object> setter)
        {
            FieldNames.Add(name);
            var filedDefinition = new FieldDefinition()
            {
                Name   = name,
                Type   = fieldType,
                Getter = getter,
                Setter = setter
            };

            FieldDefinitions[name] = filedDefinition;
        }
Example #5
0
        public override bool LoadFrom(Stream stream)
        {
            base.LoadFrom(stream);
            Attribute.LoadFrom(stream);
            UnderlyType = stream.ReadString();
            uint count = stream.ReadUInt();

            for (int i = 0; i < count; i++)
            {
                FieldNames.Add(stream.ReadString());
                FieldValues.Add(stream.ReadInt());
            }
            return(true);
        }
        public void SetConfig(IDMEEditor pbl, IDMLogger plogger, IUtil putil, string[] args, PassedArgs e, IErrorsInfo per)
        {
            Logger      = plogger;
            ErrorObject = per;
            DMEEditor   = pbl;
            Visutil     = (IVisUtil)e.Objects.Where(c => c.Name == "VISUTIL").FirstOrDefault().obj;

            branch       = (IBranch)e.Objects.Where(c => c.Name == "Branch").FirstOrDefault().obj;
            ParentBranch = (IBranch)e.Objects.Where(c => c.Name == "ParentBranch").FirstOrDefault().obj;
            webAPIData   = DMEEditor.GetDataSource(e.DatasourceName);
            if (webAPIData != null)
            {
                // webAPIData.Dataconnection.OpenConnection();
                DMEEditor.OpenDataSource(e.DatasourceName);
                CurrentEntity = e.CurrentEntity;
                ConnectionProperties cn = DMEEditor.ConfigEditor.DataConnections.Where(p => string.Equals(p.ConnectionName, e.DatasourceName, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
                ent = webAPIData.Entities.Where(o => string.Equals(o.EntityName, e.CurrentEntity, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();

                ls = ent.Fields;
                this.dataGridView1.DataSource = DataBindingSource;
                DataGridView grid = dv.CreateGrid();
                if (ent.Filters == null)
                {
                    ent.Filters = new List <ReportFilter>();
                }
                ent.Filters.Clear();
                for (int i = 0; i <= ls.Count - 1; i++)
                {
                    ReportFilter r = new ReportFilter();
                    r.FieldName = ls[i].fieldname;
                    r.Operator  = "=";
                    ent.Filters.Add(r);
                    FieldNames.Add(ls[i].fieldname);
                }
                filtersBindingSource.DataSource = ent.Filters;
                if (lsop == null)
                {
                    lsop = new List <string> {
                        "=", ">=", "<=", ">", "<"
                    };
                }
                grid.AutoGenerateColumns = false;
                grid.DataSource          = this.filtersBindingSource;
                grid.Columns.Add(dv.CreateComoboBoxColumnForGrid("FieldName", "Column", FieldNames));
                grid.Columns.Add(dv.CreateComoboBoxColumnForGrid("Operator", "Operator", lsop));
                grid.Columns.Add(dv.CreateTextColumnForGrid("FilterValue", "Value"));

                grid.DataError += Grid_DataError;
                //    grid.AllowUserToAddRows = true;

                grid.Left   = 5;
                grid.Top    = 50;
                grid.Height = 220;
                grid.Width  = FilterPanel.Width - 25;
                FilterPanel.Controls.Add(grid);
                grid.Dock = DockStyle.Fill;
            }
            else
            {
                MessageBox.Show("Error Could not Find WebApi Datasource", "BeepDM");
            }

            this.GetDataButton.Click += GetDataButton_Click;
        }
        /// <summary>
        /// Extracts node and field (or parameter) references from an XML element.
        /// </summary>
        /// <param name="Element">Element.</param>
        /// <param name="Nodes">Nodes.</param>
        /// <param name="FieldNames">Field (or parameter) names.</param>
        public static void ParseNodesAndFieldNames(XmlElement Element, out List <NodeReference> Nodes, out List <string> FieldNames)
        {
            XmlElement E, E2;
            string     NodeId;
            string     SourceId;
            string     CacheType;

            Nodes      = null;
            FieldNames = null;

            foreach (XmlNode Node in Element.ChildNodes)
            {
                E = Node as XmlElement;
                if (E == null)
                {
                    continue;
                }

                switch (E.LocalName)
                {
                case "node":
                    NodeId    = XmlUtilities.GetAttribute(E, "nodeId", string.Empty);
                    SourceId  = XmlUtilities.GetAttribute(E, "sourceId", string.Empty);
                    CacheType = XmlUtilities.GetAttribute(E, "cacheType", string.Empty);

                    if (Nodes == null)
                    {
                        Nodes = new List <NodeReference> ();
                    }

                    Nodes.Add(new NodeReference(NodeId, CacheType, SourceId));
                    break;

                case "field":
                case "parameter":
                case "boolean":
                case "color":
                case "date":
                case "dateTime":
                case "double":
                case "duration":
                case "int":
                case "long":
                case "string":
                case "time":
                    if (FieldNames == null)
                    {
                        FieldNames = new List <string> ();
                    }

                    FieldNames.Add(XmlUtilities.GetAttribute(E, "name", string.Empty));
                    break;

                case "x":
                    foreach (XmlNode Node2 in E.ChildNodes)
                    {
                        if (Node2.LocalName == "field" && (E2 = Node2 as XmlElement) != null)
                        {
                            if (FieldNames == null)
                            {
                                FieldNames = new List <string> ();
                            }

                            FieldNames.Add(XmlUtilities.GetAttribute(E2, "var", string.Empty));
                        }
                    }
                    break;
                }
            }
        }
Example #8
0
 public void AddField(string FieldName)
 {
     FieldNames.Add(FieldName);
 }
Example #9
0
        /// <summary>
        /// 初始化符号信息
        /// </summary>
        protected override void InitialSymbol()
        {
            base.InitialSymbol();

            if (m_pUniqueRender == null || m_pFeatureLayer == null)
            {
                return;
            }
            //是否是多个字段
            bool bNoSepFieldVal = false;
            //是否是连接表
            bool bIsJoined = false;

            try
            {
                IDisplayTable pDisplayTable = m_pFeatureLayer as IDisplayTable;
                ITable        pTable        = pDisplayTable.DisplayTable;
                IDataset      objDataset    = m_FeatureClass as IDataset;
                //是否是关系表
                if (pTable is IRelQueryTable)
                {
                    bIsJoined = true;
                }

                if (FieldCount > 1)
                {
                    bNoSepFieldVal = true;
                }
                //唯一值字段有多个
                if (bNoSepFieldVal)
                {
                    //数据源为SHAPE文件
                    if (objDataset.Workspace.Type == esriWorkspaceType.esriFileSystemWorkspace)
                    {
                        for (int i = 1; i <= FieldCount; i++)
                        {
                            FieldNames.Add(m_pUniqueRender.Field[i - 1].ToLower());
                        }

                        CommStaticClass.GimmeUniqueValuesFromShape(m_FeatureClass as ITable, FieldNames);
                    }
                    //数据源为其他
                    else
                    {
                        for (int i = 1; i <= FieldCount; i++)
                        {
                            FieldNames.Add(m_pUniqueRender.Field[i - 1].ToLower());
                            //属性表有连接表
                            if (pTable is IRelQueryTable)
                            {
                                IRelQueryTable pRelQueryTable     = default(IRelQueryTable);
                                ITable         pDestTable         = default(ITable);
                                IDataset       pDataSet           = default(IDataset);
                                IList <string> alJoinedTableNames = new List <string>();
                                while (pTable is IRelQueryTable)
                                {
                                    pRelQueryTable = pTable as IRelQueryTable;
                                    pDestTable     = pRelQueryTable.DestinationTable;
                                    pDataSet       = pDestTable as IDataset;

                                    pTable = pRelQueryTable.SourceTable;
                                    alJoinedTableNames.Add(pDataSet.Name);
                                }
                                CommStaticClass.GimmeUniqeValuesForFieldname(m_FeatureClass as ITable, m_pUniqueRender.Field[i - 1], alJoinedTableNames);
                                pTable = pDisplayTable.DisplayTable;
                            }
                            //属性表没有连接表
                            else
                            {
                                CommStaticClass.GimmeUniqeValuesForFieldname(m_FeatureClass as ITable, m_pUniqueRender.Field[i - 1]);
                            }
                        }
                    }
                }
                //唯一值字段只有一个
                else
                {
                    FieldNames.Add(m_pUniqueRender.Field[FieldCount - 1].ToLower());
                }

                //开始解析符号
                for (int j = 0; j <= ValueCount - 1; j++)
                {
                    ISymbol         pSymbol      = m_pUniqueRender.get_Symbol(m_pUniqueRender.get_Value(j));
                    ptSymbolFactory pSymbolFac   = new ptSymbolFactory(pSymbol);
                    ptSymbolClass   pSymbolClass = pSymbolFac.GetSymbolClass(m_pUniqueRender.Label[m_pUniqueRender.get_Value(j)], CommStaticClass.getUVFieldValues(m_pUniqueRender, j)
                                                                             , 0, 0);
                    SymbolList.Add(pSymbolClass);
                }
            }
            catch (Exception ex)
            {
                ptLogManager.WriteMessage(string.Format("方法名称:{0}{1}{2}{3}{4}", "InitialSymbol", Environment.NewLine, ex.Message, Environment.NewLine, ex.StackTrace));
            }
        }
Example #10
0
 public OdooDataService AddField(string fieldName)
 {
     FieldNames.Add(fieldName);
     return(this);
 }