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


C# Data.PropertyCollection类代码示例

本文整理汇总了C#中System.Data.PropertyCollection的典型用法代码示例。如果您正苦于以下问题:C# PropertyCollection类的具体用法?C# PropertyCollection怎么用?C# PropertyCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PropertyCollection类属于System.Data命名空间,在下文中一共展示了PropertyCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DataRelation

		public DataRelation (string relationName, DataColumn[] parentColumns, DataColumn[] childColumns, bool createConstraints) 
		{
			this.extendedProperties = new PropertyCollection();
			if (relationName == null) relationName = string.Empty;
			this.relationName = relationName;
			if (parentColumns == null) throw new ArgumentNullException ();
			this.parentColumns = parentColumns;
			if (childColumns == null) throw new ArgumentNullException ();
			this.childColumns = childColumns;
			this.createConstraints = createConstraints;
			if (parentColumns.Length != childColumns.Length)
				throw new ArgumentException ("ParentColumns and ChildColumns should be the same length");
			DataTable parentTable = parentColumns[0].Table;
			DataTable childTable = childColumns[0].Table;
			if (parentTable.DataSet != childTable.DataSet)
				throw new InvalidConstraintException ();
			foreach (DataColumn column in parentColumns)
				if (column.Table != parentTable)
					throw new InvalidConstraintException ();
			foreach (DataColumn column in childColumns)
				if (column.Table != childTable)
					throw new InvalidConstraintException ();

			for (int i=0; i<ChildColumns.Length; i++)
				if (!( parentColumns[i].DataType.Equals( childColumns[i].DataType)))
					throw new InvalidConstraintException();
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:27,代码来源:DataRelation.cs

示例2: AddExtendedProperties

        internal static void AddExtendedProperties(PropertyCollection props, XmlElement node, Type type) {
            if(props != null) {
                foreach(DictionaryEntry entry in props) {
                    String s, v;

                    if (entry.Key is INullable) {
                        s = (String) SqlConvert.ChangeTypeForXML(entry.Key, typeof(string));

                    }
                    else {
                        s = (String) Convert.ToString(entry.Key, CultureInfo.InvariantCulture);
                    }

                    if (entry.Value is INullable) {
                        v = (String) SqlConvert.ChangeTypeForXML(entry.Value, typeof(string));
                    }
                    else if (entry.Value is System.Numerics.BigInteger) {
                        v = (string)BigIntegerStorage.ConvertFromBigInteger((System.Numerics.BigInteger)entry.Value, typeof(string), CultureInfo.InvariantCulture);
                    }
                    else {
                        v = (String) Convert.ToString(entry.Value, CultureInfo.InvariantCulture);
                    }

                    if (type == typeof(DataRelation)) {
                        s = Keywords.MSD_REL_PREFIX + s;
                    }
                    else if (type == typeof(ForeignKeyConstraint)) {
                        s = Keywords.MSD_FK_PREFIX + s;
                    }
                    node.SetAttribute(XmlConvert.EncodeLocalName(s), Keywords.MSPROPNS, v);
                }
            }
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:33,代码来源:xmlsaver.cs

示例3: Message

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="dest">Destination of the message</param>
 /// <param name="src">Source of the message</param>
 /// <param name="buf">Byte buffer of payload associated with the message</param>
 public Message(Address dest, Address src, byte[] buf)
 {
     dest_addr = dest;
     src_addr = src;
     this.buf = buf;
     headers = new PropertyCollection();
 }
开发者ID:curasystems,项目名称:externals,代码行数:13,代码来源:Message.cs

示例4: Clone

 public override object Clone() {
     // override Clone so that returned object is an
     // instance of PropertyCollection instead of Hashtable
     PropertyCollection clone = new PropertyCollection();
     foreach (DictionaryEntry pair in this) {
         clone.Add(pair.Key, pair.Value);
     }
     return clone;
 }
开发者ID:uQr,项目名称:referencesource,代码行数:9,代码来源:PropertyCollection.cs

示例5: AttachProperties_PropertyCollectionWithMishmatchingSchemaTypes_ThrowsArgumentException

		public void AttachProperties_PropertyCollectionWithMishmatchingSchemaTypes_ThrowsArgumentException() {
			var prophandler = DummyFactory.GetPropertyHandler();

			var propertyList = DummyFactory.GetPropertyList(12);
			var schema = DummyFactory.GetSchema<int>("property", 12);
			var attachedProperties = new PropertyCollection(propertyList, schema);

			Assert.Throws<ArgumentException>(() => prophandler.AttachProperties(attachedProperties));
		}
开发者ID:aelveborn,项目名称:njupiter,代码行数:9,代码来源:PropertyHandlerTests.cs

示例6: DataSet

		public DataSet (string name)
		{
			dataSetName = name;
			tableCollection = new DataTableCollection (this);
			relationCollection = new DataRelationCollection.DataSetRelationCollection (this);
			properties = new PropertyCollection ();
			this.prefix = String.Empty;
			
			this.Locale = CultureInfo.CurrentCulture;
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:10,代码来源:DataSet.cs

示例7: AppendExtendedProperties

 public static void AppendExtendedProperties(DataTable dtObj, PropertyCollection props, bool withClear)
 {
     if (withClear)
         dtObj.ExtendedProperties.Clear();
     try
     {
         foreach (DictionaryEntry item in props)
         {
             dtObj.ExtendedProperties.Add(item.Key, item.Value);
         }
     }
     catch { }
 }
开发者ID:AndrewEastwood,项目名称:desktop,代码行数:13,代码来源:DataWorkShared.cs

示例8: Field

 public Field(int fieldId, string column, int typeId, string typeName, int panelId, 
     PropertyCollection attr = null, PropertyCollection rules = null)
 {
     this.fieldId = fieldId;
     this.column = column;
     this.typeName = typeName;
     this.panelId = panelId;
     this.typeId = typeId;
     this.attr = attr==null?new PropertyCollection():attr;
     this.rules = rules==null?new PropertyCollection():rules;
     value = null;
     errMsg = "";
 }
开发者ID:rjankovic,项目名称:deskmin,代码行数:13,代码来源:Field.cs

示例9: Panel

 // holder (if != null) in attr["holder"]
 public Panel(string tableName, int panelId, int typeId, string typeName, List<IPanel> children,
     List<IField> fields, List<IControl> controls, List<string> PKColNames, DataRow PK = null,
     PropertyCollection viewAttr = null, PropertyCollection controlAttr = null, IPanel parent = null)
 {
     this.tableName = tableName;
     this.viewAttr = viewAttr == null ? new PropertyCollection() : viewAttr;
     this.controlAttr = controlAttr==null?new PropertyCollection():controlAttr;
     this.panelId = panelId;
     this.children = children;
     this.fields = fields;
     this.controls = controls;
     this.PKColNames = PKColNames;
     this.PK = PK;
     this.typeId = typeId;
     this.typeName = typeName;
     this.parent = parent;
     if (this.controls == null) this.controls = new List<IControl>();
     if (this.fields == null) this.fields = new List<IField>();
     if (this.controlAttr == null) this.controlAttr = new PropertyCollection();
     if (this.viewAttr == null) this.viewAttr = new PropertyCollection();
     if (this.PKColNames == null) this.PKColNames = new List<string>();
 }
开发者ID:rjankovic,项目名称:deskmin,代码行数:23,代码来源:Panel.cs

示例10: DeserializeDataSetProperties

 private void DeserializeDataSetProperties(SerializationInfo info, StreamingContext context)
 {
     this.dataSetName = info.GetString("DataSet.DataSetName");
     this.namespaceURI = info.GetString("DataSet.Namespace");
     this._datasetPrefix = info.GetString("DataSet.Prefix");
     this._caseSensitive = info.GetBoolean("DataSet.CaseSensitive");
     int culture = (int) info.GetValue("DataSet.LocaleLCID", typeof(int));
     this._culture = new CultureInfo(culture);
     this._cultureUserSet = true;
     this.enforceConstraints = info.GetBoolean("DataSet.EnforceConstraints");
     this.extendedProperties = (PropertyCollection) info.GetValue("DataSet.ExtendedProperties", typeof(PropertyCollection));
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:12,代码来源:DataSet.cs

示例11: _PropsNotEmpty

 //Does the DS or ANY object in it have ExtendedProperties?
 private static bool _PropsNotEmpty(PropertyCollection props) {
     return props != null && props.Count != 0;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:4,代码来源:xmlsaver.cs

示例12: setProperties

        /// <summary>
        /// Sets the properties specified in the configuration string
        /// </summary>
        /// <param name="props">Properties to set</param>
        /// <returns>False if properties were specified that are not know, otherwise true</returns>
        public override bool setProperties(PropertyCollection props)
        {
            if(props.Contains("shun"))
            {
                shun = Convert.ToBoolean(props["shun"]);
                props.Remove("shun");
            }
            if(props.Contains("print_local_addr"))
            {
                print_local_addr = Convert.ToBoolean(props["print_local_addr"]);
                props.Remove("print_local_addr");
            }
            if(props.Contains("join_timeout"))
            {
                join_timeout = Convert.ToInt64(props["join_timeout"]);
                props.Remove("join_timeout");
            }
            if(props.Contains("join_retry_timeout"))
            {
                join_retry_timeout = Convert.ToInt64(props["join_retry_timeout"]);
                props.Remove("join_retry_timeout");
            }
            if(props.Contains("leave_timeout")) // time to wait until coord responds to LEAVE req.
            {
                leave_timeout = Convert.ToInt64(props["leave_timeout"]);
                props.Remove("leave_timeout");
            }
            if(props.Contains("digest_timeout")) // time to wait for GET_DIGEST_OK from PBCAST
            {
                digest_timeout = Convert.ToInt64(props["digest_timeout"]);
                props.Remove("digest_timeout");
            }
            if(props.Contains("disable_initial_coord")) // time to wait for GET_DIGEST_OK from PBCAST
            {
                disable_initial_coord = Convert.ToBoolean(props["disable_initial_coord"]);
                props.Remove("disable_initial_coord");
            }

            if(props.Count > 0)
            {
                return false;
            }
            return true;
        }
开发者ID:curasystems,项目名称:externals,代码行数:49,代码来源:GMS.cs

示例13: setPropertiesInternal

        /// <summary>
        /// Removes and sets all generic properties of a Protocol, then passes remainder of properties on to implementation
        /// </summary>
        /// <param name="properties">Collection of properties</param>
        /// <returns>False if properties were specified that are not know, otherwise true</returns>
        public bool setPropertiesInternal(PropertyCollection properties)
        {
            this.props = properties;

            if(props.Contains("down_thread"))
            {
                down_thread = Convert.ToBoolean(props["down_thread"]);
                props.Remove("down_thread");
            }

            if(props.Contains("up_thread"))
            {
                up_thread = Convert.ToBoolean(props["up_thread"]);
                props.Remove("up_thread");
            }

            return setProperties(props);
        }
开发者ID:curasystems,项目名称:externals,代码行数:23,代码来源:Protocol.cs

示例14: BuildDynamicUpdateCommand

        public static NpgsqlCommand BuildDynamicUpdateCommand(tgDataRequest request, tgEntitySavePacket packet)
        {
            string where = String.Empty;
            string conncur = String.Empty;
            string scomma = String.Empty;
            string defaults = String.Empty;
            string defaultsComma = String.Empty;
            string and = String.Empty;

            string sql = "UPDATE " + CreateFullName(request) + " SET ";

            PropertyCollection props = new PropertyCollection();
            NpgsqlParameter p = null;

            Dictionary<string, NpgsqlParameter> types = Cache.GetParameters(request);

            NpgsqlCommand cmd = new NpgsqlCommand();
            if (request.CommandTimeout != null) cmd.CommandTimeout = request.CommandTimeout.Value;

            tgColumnMetadataCollection cols = request.Columns;
            foreach (tgColumnMetadata col in cols)
            {
                bool isModified = packet.ModifiedColumns == null ? false : packet.ModifiedColumns.Contains(col.Name);

                if (isModified && (!col.IsAutoIncrement && !col.IsConcurrency && !col.IsEntitySpacesConcurrency))
                {
                    p = cmd.Parameters.Add(CloneParameter(types[col.Name]));

                    object value = packet.CurrentValues[col.Name];
                    p.Value = value != null ? value : DBNull.Value;

                    sql += scomma + Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose + " = " + p.ParameterName;
                    scomma = ", ";
                }
                else if (col.IsAutoIncrement)
                {
                    // Nothing to do but leave this here
                }
                else if (col.IsConcurrency)
                {
                    p = CloneParameter(types[col.Name]);
                    p.SourceVersion = DataRowVersion.Original;
                    p.Direction = ParameterDirection.InputOutput;
                    cmd.Parameters.Add(p);

                    conncur += Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose + " = " + p.ParameterName;
                }
                else if (col.IsEntitySpacesConcurrency)
                {
                    p = CloneParameter(types[col.Name]);
                    p.Value = packet.OriginalValues[col.Name];
                    p.Direction = ParameterDirection.InputOutput;
                    cmd.Parameters.Add(p);

                    sql += scomma;
                    sql += Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose + " = " + p.ParameterName + " + 1";

                    conncur += Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose + " = " + p.ParameterName;

                    defaults += defaultsComma + Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose;
                    defaultsComma = ",";
                }
                else if (col.IsComputed)
                {
                    // Do nothing but leave this here
                }
                else if (cols.IsSpecialColumn(col))
                {
                    // Do nothing but leave this here
                }
                else if (col.HasDefault)
                {
                    // defaults += defaultsComma + Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose;
                    // defaultsComma = ",";
                }

                if (col.IsInPrimaryKey)
                {
                    p = CloneParameter(types[col.Name]);
                    p.Value = packet.OriginalValues[col.Name];
                    cmd.Parameters.Add(p);

                    where += and + Delimiters.ColumnOpen + col.Name + Delimiters.ColumnClose + " = " + p.ParameterName;
                    and = " AND ";
                }
            }

            #region Special Column Logic
            if (cols.DateModified != null && cols.DateModified.IsServerSide)
            {
                p = CloneParameter(types[cols.DateModified.ColumnName]);
                p.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(p);

                sql += scomma + Delimiters.ColumnOpen + cols.DateModified.ColumnName + Delimiters.ColumnClose + " = " + request.ProviderMetadata["DateModified.ServerSideText"];
                scomma = ", ";

                defaults += defaultsComma + cols.DateModified.ColumnName;
                defaultsComma = ",";
            }
//.........这里部分代码省略.........
开发者ID:HoosierMike,项目名称:Tiraggo,代码行数:101,代码来源:Shared.cs

示例15: ShowBills

        /* METHODS */
        private double ShowBills(DateTime fromDay, DateTime toDay)
        {
            Dictionary<string, object> items = DataWorkBill.LoadRangeBills(fromDay, toDay, AppConfig.Path_Bills, AppConfig.APP_SubUnit);
            DataTable currentBill = new DataTable();
            PropertyCollection props = new PropertyCollection();
            Dictionary<string, object> billInfo = new Dictionary<string, object>();
            double generalSuma = 0.0;
            //this.billFileList.Clear();
            listGrid.Rows.Clear();
            foreach (KeyValuePair<string, object> billEntry in items)
            {
                currentBill = (DataTable)((object[])billEntry.Value)[0];
                props = (PropertyCollection)((object[])billEntry.Value)[1];
                billInfo = ((Dictionary<string, object>)props[CoreConst.BILL]);
                //this.billFileList.Add(billInfo[CoreConst.OID].ToString(), billEntry.Key);

                if (props[CoreConst.ORDER_NO] == null)
                    continue;

                listGrid.Rows.Add(
                    new object[] {
                            billInfo[CoreConst.OID],
                            billEntry.Key,
                            false,
                            billInfo[CoreConst.BILL_NO],
                            billInfo[CoreConst.DATETIME],
                            billInfo[CoreConst.COMMENT],
                            (double)props[mdcore.Common.CoreConst.ORDER_SUMA],
                            bool.Parse(billInfo[CoreConst.IS_LOCKED].ToString()),
                            props[CoreConst.ORDER_NO]
                        }
                );
                generalSuma += (double)props[mdcore.Common.CoreConst.ORDER_SUMA];
                /*if (props.ContainsKey(CoreConst.ORDER_NO) && props[CoreConst.ORDER_NO] != null && props[CoreConst.ORDER_NO].ToString() != string.Empty)
                {
                    Font extFont = listGrid.Font;
                    listGrid.Rows[listGrid.Rows.Count - 1].DefaultCellStyle.Font = new Font(extFont, FontStyle.Strikeout);
                }*/
            }

            this.label_orderInfo_General.Text = string.Format("Всього {0} запис(ів) на суму {1:0.00}{2}", listGrid.RowCount, generalSuma, "грн");

            return generalSuma;
        }
开发者ID:AndrewEastwood,项目名称:desktop,代码行数:45,代码来源:uiWndBillManagercs.cs


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