コード例 #1
0
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            IPropertyCollection         propertyCollection = (IPropertyCollection)value;
            Dictionary <string, object> properties         = propertyCollection
                                                             .ToDictionary(k => k.Key, v => GetValue(v.Value));

            serializer.Serialize(writer, properties);
        }
コード例 #2
0
ファイル: ChartStyle.cs プロジェクト: zhaoyin/officeOBA
 /// <summary>
 /// Inits the standards.
 /// </summary>
 private void InitStandards()
 {
     PropertyCollection           = new IPropertyCollection();
     PropertyCollection.Inserted += PropertyCollection_Inserted;
     PropertyCollection.Removed  += PropertyCollection_Removed;
     FamilyStyle = "chart";
     //			this.Document.Styles.Add(this);
 }
コード例 #3
0
        public static TMXColor GetColorFromProperty(this IPropertyCollection collection, string key)
        {
            if (collection.TryGetValue <string>(key, out PropertyValue value))
            {
                return(TMXColor.FromString(value));
            }

            return(null);
        }
コード例 #4
0
 protected void RemoveProperty(IPropertyCollection instanceProperties, string propertyName)
 {
     for (int i = 0; i < instanceProperties.Properties.Count; i++)
     {
         if (string.Equals(instanceProperties.Properties[i].Name, propertyName))
         {
             instanceProperties.Properties.RemoveAt(i--);
         }
     }
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the DbTableConfiguration class.
 /// </summary>
 /// <param name="tableName">Table name.</param>
 /// <param name="catalog">Catalog to which the table/view belongs to.</param>
 /// <param name="columnConfiguration">Column configuration</param>
 /// <param name="primaryKeyColumnIndexes">Primary key column indexes in <b>columnConfiguration</b> array.</param>
 /// <param name="parentEntityProperties">Names of parent entity properties in generated <see cref="IEntity"/> class.</param>
 /// <param name="extendedProperties">Customized information associated with the table.</param>
 public DbTableConfiguration(string tableName, ICatalog catalog, DbColumnConfiguration[] columnConfiguration, int[] primaryKeyColumnIndexes, string[] parentEntityProperties, IPropertyCollection extendedProperties)
 {
     this.TableName = tableName;
     this.Catalog = catalog;
     this.ColumnConfiguration = columnConfiguration;
     this.PrimaryKeyColumnIndexes = primaryKeyColumnIndexes;
     this.ParentEntityProperties = parentEntityProperties;
     this.EmptyDataTable = CreateDataTable();
     this.ExtendedProperties = extendedProperties;
 }
コード例 #6
0
ファイル: ResourceTracer.cs プロジェクト: mo5h/omeo
        public void Trace(IResource resource, bool traceLinks)
        {
            _tracer.Trace("______________________________________");
            _tracer.Trace("DisplayName: " + resource.DisplayName);
            _tracer.Trace("Type: " + resource.Type);
            _tracer.Trace("ID: " + resource.Id);
            IPropertyCollection properties = resource.Properties;

            foreach (IResourceProperty property in properties)
            {
                if (property.DataType == PropDataType.Link)
                {
                    if (traceLinks)
                    {
                        bool directed = ICore.Instance.ResourceStore.PropTypes[property.PropId].HasFlag(PropTypeFlags.DirectedLink);

                        IResourceList resources = null;
                        string        linkType  = string.Empty;

                        if (!directed)
                        {
                            resources = resource.GetLinksOfType(null, property.Name);
                        }
                        else
                        {
                            if (property.PropId < 0)
                            {
                                resources = resource.GetLinksTo(null, property.Name);
                                linkType  = "To: ";
                            }
                            else
                            {
                                resources = resource.GetLinksFrom(null, property.Name);
                                linkType  = "From: ";
                            }
                        }
                        foreach (IResource linkedResource in resources)
                        {
                            _tracer.Trace(linkType + property.Name);
                            Trace(linkedResource, false);
                        }
                    }
                }
                else
                {
                    string value = string.Empty;
                    if (property.Value != null)
                    {
                        value = property.Value.ToString();
                    }
                    _tracer.Trace(property.Name + " = " + value);
                }
            }
            _tracer.Trace("______________________________________");
        }
コード例 #7
0
 /// <summary>
 /// Create a new ListStyle object.
 /// </summary>
 /// <param name="document">The docuemnt</param>
 /// <param name="styleName">The style name</param>
 public ListStyle(IDocument document, string styleName)
 {
     Document                     = document;
     Node                         = new XElement(Ns.Text + "tab");
     PropertyCollection           = new IPropertyCollection();
     PropertyCollection.Inserted += PropertyCollection_Inserted;
     PropertyCollection.Removed  += PropertyCollection_Removed;
     //			this.Document.Styles.Add(this);
     ListlevelStyles = new ListLevelStyleCollection();
     StyleName       = styleName;
 }
コード例 #8
0
        private int AddLinkedResources(TreeNode treeNode, IResource selectedResource, int linkID, LinkNode linkNode)
        {
            bool          directed  = _resourceStore.PropTypes [linkID].HasFlag(PropTypeFlags.DirectedLink);
            IResourceList resources = null;

            if (directed)
            {
                if (linkID < 0)
                {
                    resources = selectedResource.GetLinksTo(null, -linkID);
                }
                else
                {
                    resources = selectedResource.GetLinksFrom(null, linkID);
                }
            }
            else
            {
                resources = selectedResource.GetLinksOfType(null, linkID);
            }

            int count = 0;

            foreach (IResource resource in resources)
            {
                if (IsSerializerExists(resource))
                {
                    int iconIndex = GetIcon(resource);
                    Tracer._Trace(resource.DisplayName);
                    TreeNode            treeSubNode  = new TreeNode(GetTypeDisplayName(resource.Type) + ": " + resource.DisplayName, iconIndex, iconIndex);
                    ResourceNode        resourceNode = linkNode.AddResource(resource);
                    IPropertyCollection properties   = resourceNode.Resource.Properties;
                    foreach (IResourceProperty property in properties)
                    {
                        if (property.DataType != PropDataType.Link)
                        {
                            IResourceSerializer serializer = Core.PluginLoader.GetResourceSerializer(resourceNode.Resource.Type);
                            SerializationMode   serMode    = GetSerializationMode(serializer, resourceNode.Resource, property);
                            if (serMode == SerializationMode.NoSerialize)
                            {
                                continue;
                            }
                            resourceNode.AddProperty(property);
                        }
                    }

                    treeSubNode.Tag = new SerializableTag(resourceNode, SerializableTag.Type.LinkedResource);
                    treeNode.Nodes.Add(treeSubNode);
                    _resourceTreeView.SetNodeCheckState(treeSubNode, NodeCheckState.Checked);
                    count++;
                }
            }
            return(count);
        }
コード例 #9
0
ファイル: LangElement.cs プロジェクト: cm4ker/Parsers
 /// <summary>
 /// Sets attributes for given node.
 /// </summary>
 /// <param name="node">Node to set properties for.</param>
 /// <param name="attributes">List of attributes. Can be <c>null</c> to remove attribites. Existing attributes are overwritten.</param>
 public static void SetAttributes(this IPropertyCollection node, IReadOnlyList <IAttributeElement> attributes)
 {
     if (attributes == null || attributes.Count == 0)
     {
         node.RemoveProperty <IReadOnlyList <IAttributeElement> >();
     }
     else
     {
         node.SetProperty(attributes);
     }
 }
コード例 #10
0
 internal PropertyHandler(string username, IPropertyCollection properties, IPredefinedNames propertyNames)
 {
     this.username        = username;
     this.propertyNames   = propertyNames;
     propertiesPerContext = new Dictionary <IContext, IPropertyCollection>();
     AttachProperties(properties);
     if (CreationDate == DateTime.MinValue)
     {
         CreationDate = DateTime.UtcNow;
     }
 }
コード例 #11
0
ファイル: CustomAttributes.cs プロジェクト: xmaxmex/Phalanger
 public static void SetCustomAttributes(this IPropertyCollection /*!*/ properties, CustomAttributes attributes)
 {
     if (attributes != null)
     {
         properties[typeof(CustomAttributes)] = attributes;
     }
     else
     {
         properties.RemoveProperty(typeof(CustomAttributes));
     }
 }
コード例 #12
0
        public void Clear()
        {
            IPropertyCollection  tilesheetProperties = m_tileSheet.Properties;
            IEnumerable <string> oldIndexedKeys
                = tilesheetProperties.Keys.Where(x => ParseIndexedKey(x) != null).ToArray();

            foreach (string indexedKey in oldIndexedKeys)
            {
                tilesheetProperties.Remove(indexedKey);
            }
        }
コード例 #13
0
        public void CopyFrom(IPropertyCollection propertyCollection)
        {
            Clear();

            IPropertyCollection tilesheetProperties = m_tileSheet.Properties;

            foreach (string key in propertyCollection.Keys)
            {
                tilesheetProperties[IndexKey(key)] = propertyCollection[key];
            }
        }
コード例 #14
0
ファイル: AgentConfig.cs プロジェクト: rubitek/OpenADK-csharp
        /// <summary>  Populates a Properties object with all <c>&lt;property&gt;</c>
        /// values defined by a <c>&lt;zone&gt;</c> node as well as all
        /// properties defined by the referenced zone template. Properties defined
        /// by the <c>&lt;zone&gt;</c> override properties defined by the
        /// template.
        /// </summary>
        public virtual void GetZoneProperties(IPropertyCollection props,
                                              XmlElement zone)
        {
            PopulateProperties(props, zone);

            string template = zone.GetAttribute(XmlConstants.TEMPLATE);

            if (template.Length > 0)
            {
                GetZoneTemplateProperties(props, template);
            }
        }
コード例 #15
0
        public static bool TryGetValue <T>(this IPropertyCollection collection, string key, out PropertyValue value)
        {
            if (collection.TryGetValue(key, out PropertyValue prop) &&
                prop.Type.IsAssignableFrom(typeof(T)))
            {
                value = prop;
                return(true);
            }

            value = null;
            return(false);
        }
コード例 #16
0
        public static IPropertyCollection AddOrReplace(this IPropertyCollection t, string key, string value)
        {
            if (!t.ContainsKey(key))
            {
                t.Add(key, value);
            }
            else
            {
                t[key] = value;
            }

            return(t);
        }
コード例 #17
0
ファイル: ColumnStyle.cs プロジェクト: zhaoyin/officeOBA
        /// <summary>
        /// Inits the standards.
        /// </summary>
        private void InitStandards()
        {
            Node = new XElement(Ns.Style + "style");
            if (Document is SpreadsheetDocument)
            {
                ParentStyleName = "Default";
            }
            PropertyCollection           = new IPropertyCollection();
            PropertyCollection.Inserted += PropertyCollection_Inserted;
            PropertyCollection.Removed  += PropertyCollection_Removed;
            FamilyStyle = "table-column";
//			this.Document.Styles.Add(this);
        }
コード例 #18
0
        private void InitMembers()
        {
            if (_members != null)
            {
                return;
            }

            _fields     = new FieldList(this);
            _properties = new PropertyList(this);
            _events     = new EventList(this);
            _methods    = new MethodList(this);
            _members    = new TypeMemberCollection(_fields, _methods, _properties, _events);
        }
コード例 #19
0
ファイル: GlobalUserMetaData.cs プロジェクト: zhh007/MyGen
        private void BindGrid(IPropertyCollection properties)
        {
            this.properties = properties;

            DataSet   ds = new DataSet();
            DataTable dt = new DataTable("this");

            dt.Columns.Add("this", Type.GetType("System.Object"));
            ds.Tables.Add(dt);
            dt.Rows.Add(new object[] { this });

            dt = new DataTable("MyData");
            DataColumn k = dt.Columns.Add("Key", stringType);

            k.AllowDBNull = false;
            DataColumn v = dt.Columns.Add("Value", stringType);

            v.AllowDBNull = false;
            ds.Tables.Add(dt);

            UniqueConstraint pk = new UniqueConstraint(k, false);

            dt.Constraints.Add(pk);
            ds.EnforceConstraints = true;

            this.colKey.HeaderText      = "Key";
            this.colKey.TextBox.Enabled = true;

            this.colValue.HeaderText  = "Value";
            this.colValue.MappingName = "Value";

            DataRowCollection rows = dt.Rows;

            foreach (IProperty prop in properties)
            {
                rows.Add(new object[] { prop.Key, prop.Value });
            }

            this.Grid.DataSource = dt.DefaultView;
            this.InitializeGrid();

            this.colKey.TextBox.BorderStyle   = BorderStyle.None;
            this.colValue.TextBox.BorderStyle = BorderStyle.None;

            this.colKey.TextBox.Move   += new System.EventHandler(this.ColorTextBox);
            this.colValue.TextBox.Move += new System.EventHandler(this.ColorTextBox);

            dt.RowChanged  += new DataRowChangeEventHandler(PropertyGridRowChanged);
            dt.RowDeleting += new DataRowChangeEventHandler(PropertyGridRowDeleting);
            dt.RowDeleted  += new DataRowChangeEventHandler(PropertyGridRowDeleted);
        }
コード例 #20
0
    // TODO: We could further reduce circular dependencies with PropertyEditorCollection by not having IDataValueReference implemented
    // by property editors and instead just use the already built in IDataValueReferenceFactory and/or refactor that into a more normal collection
    public IEnumerable <UmbracoEntityReference> GetAllReferences(
        IPropertyCollection properties,
        PropertyEditorCollection propertyEditors)
    {
        var trackedRelations = new HashSet <UmbracoEntityReference>();

        foreach (IProperty p in properties)
        {
            if (!propertyEditors.TryGet(p.PropertyType.PropertyEditorAlias, out IDataEditor? editor))
            {
                continue;
            }

            // TODO: We will need to change this once we support tracking via variants/segments
            // for now, we are tracking values from ALL variants
            foreach (IPropertyValue propertyVal in p.Values)
            {
                var val = propertyVal.EditedValue;

                IDataValueEditor?valueEditor = editor?.GetValueEditor();
                if (valueEditor is IDataValueReference reference)
                {
                    IEnumerable <UmbracoEntityReference> refs = reference.GetReferences(val);
                    foreach (UmbracoEntityReference r in refs)
                    {
                        trackedRelations.Add(r);
                    }
                }

                // Loop over collection that may be add to existing property editors
                // implementation of GetReferences in IDataValueReference.
                // Allows developers to add support for references by a
                // package /property editor that did not implement IDataValueReference themselves
                foreach (IDataValueReferenceFactory item in this)
                {
                    // Check if this value reference is for this datatype/editor
                    // Then call it's GetReferences method - to see if the value stored
                    // in the dataeditor/property has referecnes to media/content items
                    if (item.IsForEditor(editor))
                    {
                        foreach (UmbracoEntityReference r in item.GetDataValueReference().GetReferences(val))
                        {
                            trackedRelations.Add(r);
                        }
                    }
                }
            }
        }

        return(trackedRelations);
    }
コード例 #21
0
 private void AttachProperties(IPropertyCollection properties, IContext context)
 {
     if (isReadOnly)
     {
         properties.MakeReadOnly();
     }
     lock (padlock) {
         if (propertiesPerContext.Keys.Contains(context))
         {
             throw new ArgumentException("The context for the attached PropertyCollection is already attached.");
         }
         propertiesPerContext.Add(context, properties);
     }
 }
コード例 #22
0
        /// <summary>
        /// When input is received, check that the player is free and used an action button
        /// If so, attempt open the shop if it exists
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Input_ButtonPressed(object sender, StardewModdingAPI.Events.ButtonPressedEventArgs e)
        {
            //context and button check
            if (!Context.CanPlayerMove)
            {
                return;
            }

            //Resets the boolean I use to check if a menu used to move the player around came from my mod
            //and lets me return them to their original location
            SourceLocation = null;
            _playerPos     = Vector2.Zero;
            //checks if i've changed marnie's stock already after opening her menu
            _changedMarnieStock = false;

            if (Constants.TargetPlatform == GamePlatform.Android)
            {
                if (e.Button != SButton.MouseLeft)
                {
                    return;
                }
                if (e.Cursor.GrabTile != e.Cursor.Tile)
                {
                    return;
                }

                if (VerboseLogging)
                {
                    monitor.Log("Input detected!");
                }
            }
            else if (!e.Button.IsActionButton())
            {
                return;
            }

            Vector2 clickedTile = Helper.Input.GetCursorPosition().GrabTile;

            //check if there is a tile property on Buildings layer
            IPropertyCollection tileProperty = TileUtility.GetTileProperty(Game1.currentLocation, "Buildings", clickedTile);

            if (tileProperty == null)
            {
                return;
            }

            //if there is a tile property, attempt to open shop if it exists
            CheckForShopToOpen(tileProperty, e);
        }
コード例 #23
0
        public void AttachProperties(IPropertyCollection properties)
        {
            if (properties == null)
            {
                throw new ArgumentNullException("properties");
            }

            var context = GetContextFromPropertyCollection(properties);

            if (!ValidatePropertyCollection(properties, context))
            {
                throw new ArgumentException("The attached PropertyCollection does not match the attached Schema.");
            }
            AttachProperties(properties, context);
        }
コード例 #24
0
        protected DataTable GetIDOProperties(List <string> props, IPropertyCollection propDefs)
        {
            string properties = String.Empty;

            var table = new DataTable();

            foreach (var prop in props)
            {
                table.Columns.Add(prop, propDefs[prop].ClrType);
                properties += prop + " " + propDefs[prop].ClrType + "\n";
            }

            LogMessage(properties);
            return(table);
        }
コード例 #25
0
		private void BindGrid(IPropertyCollection properties)
		{
			this.properties = properties;

			DataSet ds = new DataSet();
			DataTable dt = new DataTable("this");
			dt.Columns.Add("this",  Type.GetType("System.Object"));
			ds.Tables.Add(dt);
			dt.Rows.Add(new object[] { this });

			dt = new DataTable("MyData");
			DataColumn k = dt.Columns.Add("Key", stringType);
			k.AllowDBNull = false;
			DataColumn v = dt.Columns.Add("Value", stringType);
			v.AllowDBNull = false;
			ds.Tables.Add(dt);

			UniqueConstraint pk = new UniqueConstraint(k, false);

			dt.Constraints.Add(pk);
			ds.EnforceConstraints = true;

			this.colKey.HeaderText  = "Key";
			this.colKey.TextBox.Enabled = true;

			this.colValue.HeaderText  = "Value";
			this.colValue.MappingName = "Value";

			DataRowCollection rows = dt.Rows;

			foreach(IProperty prop in properties)
			{
				rows.Add(new object[] { prop.Key, prop.Value } );
			}

			this.Grid.DataSource = dt.DefaultView;
			this.InitializeGrid();

			this.colKey.TextBox.BorderStyle = BorderStyle.None;
			this.colValue.TextBox.BorderStyle = BorderStyle.None;

			this.colKey.TextBox.Move   += new System.EventHandler(this.ColorTextBox);
			this.colValue.TextBox.Move += new System.EventHandler(this.ColorTextBox);

			dt.RowChanged  += new DataRowChangeEventHandler(PropertyGridRowChanged);
			dt.RowDeleting += new DataRowChangeEventHandler(PropertyGridRowDeleting);
			dt.RowDeleted  += new DataRowChangeEventHandler(PropertyGridRowDeleted);
		}
コード例 #26
0
        public virtual void CustomizeInstanceProperties(IPropertyCollection instanceProperties)
        {
            Argument.IsNotNull(() => instanceProperties);

            // Remove Catel properties
            RemoveProperty(instanceProperties, "BusinessRuleErrorCount");
            RemoveProperty(instanceProperties, "BusinessRuleWarningCount");
            RemoveProperty(instanceProperties, "FieldErrorCount");
            RemoveProperty(instanceProperties, "FieldWarningCount");
            RemoveProperty(instanceProperties, "HasErrors");
            RemoveProperty(instanceProperties, "HasWarnings");
            RemoveProperty(instanceProperties, "IsDirty");
            RemoveProperty(instanceProperties, "IsEditable");
            RemoveProperty(instanceProperties, "IsInEditSession");
            RemoveProperty(instanceProperties, "IsReadOnly");
        }
コード例 #27
0
ファイル: User.cs プロジェクト: aelveborn/njupiter
		public User(string userId,
		            string userName,
		            string domain,
		            IPropertyCollection properties,
		            IPredefinedNames propertyNames) {
			if(userId == null) {
				throw new ArgumentNullException("userId");
			}
			if(string.IsNullOrEmpty(userName)) {
				throw new ArgumentException("User name can not be empty.");
			}
			id = userId;
			this.domain = (domain ?? string.Empty);
			this.userName = userName;
			this.properties = new PropertyHandler(userName, properties, propertyNames);
		}
コード例 #28
0
 private static bool ValidatePropertyCollection(IPropertyCollection properties, IContext context)
 {
     if (!properties.Count.Equals(properties.Schema.Count))
     {
         return(false);
     }
     if (!IsAllPropertiesInContext(properties, context))
     {
         return(false);
     }
     if (!IsPropertiesConsistantToSchema(properties))
     {
         return(false);
     }
     return(true);
 }
コード例 #29
0
ファイル: Utilities.cs プロジェクト: tstaples/SDVMapDiffTool
 public static bool DoPropertiesDiffer(IPropertyCollection a, IPropertyCollection b)
 {
     if (a == null && b == null)
     {
         return(false);
     }
     if ((a == null && b != null) || a != null && b == null)
     {
         return(true);
     }
     if (a.Count != b.Count)
     {
         return(true);
     }
     return(GetDifference(a, b) != null);
 }
コード例 #30
0
        /// <summary>
        /// Sets <see cref="PHPDocBlock"/> to <paramref name="properties"/>.
        /// </summary>
        public static void SetPHPDoc(this IPropertyCollection /*!*/ properties, IDocBlock phpdoc)
        {
            if (phpdoc != null)
            {
                properties.SetProperty <IDocBlock>(phpdoc);

                // remember LangElement associated with phpdoc
                if (properties is LangElement element)
                {
                    phpdoc.Properties.SetProperty <LangElement>(element);
                }
            }
            else
            {
                properties.RemoveProperty <IDocBlock>();
            }
        }
コード例 #31
0
        public static bool ComparePropertySet(IPropertyCollection a, IPropertyCollection b)
        {
            if (a.Count != b.Count)
            {
                return(false);
            }

            foreach (var property in a)
            {
                if (b[property.Key] != null)
                {
                    CompareProperties(a[property.Key], b[property.Key]);
                }
            }

            return(true);
        }
コード例 #32
0
ファイル: ExportListForm.cs プロジェクト: mo5h/omeo
        private void  WriteResource2Entry(IResource res, XmlTextWriter writer)
        {
            writer.WriteStartElement("resource");
            writer.WriteAttributeString("type", res.Type);
            writer.WriteAttributeString("id", res.Id.ToString());

            IPropertyCollection props = res.Properties;

            foreach (IResourceProperty prop in props)
            {
                IPropType type = Core.ResourceStore.PropTypes[prop.Name];
                if (!type.HasFlag(PropTypeFlags.Internal))
                {
                    WriteResourceProperty2Entry(res, prop, writer);
                }
            }
            writer.WriteEndElement();
        }
コード例 #33
0
ファイル: PredefinedScheme.cs プロジェクト: wuke1988/WPEDMAS
        internal override PropertyExpression Export([NotNull] ConditionGroup parent, [NotNull] IPropertyCollection propertyCollection)
        {
            var property   = propertyCollection.GetProperty(PropertyName);
            var expression = new PropertyExpression
            {
                Parent   = parent,
                Property = property
            };
            var dataExpr = expression.DataTypeExpression;

            dataExpr.SelectedCondition = Condition;
            if (Value != null)
            {
                var valueProperty = dataExpr.GetType().GetProperty("Value");
                valueProperty.SetValue(dataExpr, ConvertEx.SafeCastValue(Value, valueProperty.PropertyType));
            }
            return(expression);
        }
コード例 #34
0
        public virtual void CustomizeInstanceProperties(IPropertyCollection instanceProperties)
        {
            Argument.IsNotNull(() => instanceProperties);

            var catelProperties = new HashSet<string> {
                "BusinessRuleErrorCount",
                "BusinessRuleWarningCount",
                "FieldErrorCount",
                "FieldWarningCount",
                "HasErrors",
                "HasWarnings",
                "IsDirty",
                "IsEditable",
                "IsInEditSession",
                "IsReadOnly"
            };

            // Remove Catel properties
            instanceProperties.Properties.RemoveAll(x => catelProperties.Contains(x.Name));

            // Remove unsupported type properties
            instanceProperties.Properties.RemoveAll(x => !InstancePropertyHelper.IsSupportedType(x));
        }
コード例 #35
0
        /// <summary>  Populates a Properties object with all <c>&lt;property&gt;</c>
        /// values defined by a <c>&lt;zone&gt;</c> node as well as all
        /// properties defined by the referenced zone template. Properties defined
        /// by the <c>&lt;zone&gt;</c> override properties defined by the
        /// template.
        /// </summary>
        public virtual void GetZoneProperties( IPropertyCollection props,
                                               XmlElement zone )
        {
            PopulateProperties( props, zone );

            string template = zone.GetAttribute( XmlConstants.TEMPLATE );
            if ( template.Length > 0 ) {
                GetZoneTemplateProperties( props, template );
            }
        }
コード例 #36
0
 /// <summary>  Populates a Properties object with all <c>&lt;property&gt;</c>
 /// values defined by a <c>&lt;zone&gt;</c> node as well as all
 /// properties defined by the referenced zone template. Properties defined
 /// by the <c>&lt;zone&gt;</c> override properties defined by the
 /// template.
 /// </summary>
 public virtual void GetZoneProperties( IPropertyCollection props,
                                        string zone )
 {
     GetZoneProperties( props, GetZoneNode( zone ) );
 }
コード例 #37
0
		public abstract void SaveProperties(IUser user, IPropertyCollection propertyCollection);
コード例 #38
0
		public override void SaveProperties(IUser user, IPropertyCollection propertyCollection) {
			this.repository.SaveProperties(user, propertyCollection);
		}
コード例 #39
0
        public void CopyFrom(IPropertyCollection propertyCollection)
        {
            Clear();

            IPropertyCollection tilesheetProperties = m_tileSheet.Properties;
            foreach (string key in propertyCollection.Keys)
                tilesheetProperties[IndexKey(key)] = propertyCollection[key];
        }
コード例 #40
0
 /// <summary>  Populates a Properties object with all <c>&lt;property&gt;</c>
 /// values defined as children of the specified node. Properties that already
 /// exist in the Properties object are not overwritten by properties defined
 /// by the node.
 /// </summary>
 public virtual void PopulateProperties( IPropertyCollection props,
                                         XmlElement node )
 {
     PopulateProperties( props, node, false );
 }
コード例 #41
0
ファイル: UserRepository.cs プロジェクト: aelveborn/njupiter
		public override void SaveProperties(IUser user, IPropertyCollection propertyCollection) {
			if(user == null)
				throw new ArgumentNullException("user");

			this.UserCache.RemoveUserFromCache(user);

			if(propertyCollection == null)
				throw new ArgumentNullException("propertyCollection");

			DirectoryObject dirObj = CurrentDS.CreateDirectoryObjectInstance();
			dirObj.Id = user.Id;
			foreach(IProperty property in propertyCollection) {
				if(dirObj.Contains(property.Name)) {
					dirObj[property.Name] = property.ToSerializedString();
					property.IsDirty = false;
				}
			}
			CurrentDS.SaveDirectoryObject(dirObj);
		}
コード例 #42
0
ファイル: TilePicker.cs プロジェクト: dekk7/xEngine
 public TileIndexPropertyComponent(IPropertyCollection propertyCollection)
 {
     m_propertyCollection = propertyCollection;
 }
コード例 #43
0
 /// <summary>  Populates a Properties object with all <c>&lt;property&gt;</c>
 /// values defined for a <c>&lt;template&gt;</c> node.
 /// </summary>
 public virtual void GetZoneTemplateProperties( IPropertyCollection props,
                                                string template )
 {
     PopulateProperties( props, GetZoneTemplateNode( template ) );
 }
コード例 #44
0
 /// <summary>  Populates a Properties object with all <c>&lt;property&gt;</c>
 /// values defined for a <c>&lt;template&gt;</c> node.
 /// </summary>
 public virtual void GetZoneTemplateProperties( IPropertyCollection props,
                                                XmlElement template )
 {
     PopulateProperties( props, template );
 }
コード例 #45
0
ファイル: VariableResolver.cs プロジェクト: mastersign/bench
 /// <summary>
 /// Initializes a new instance of <see cref="VariableResolver"/>.
 /// </summary>
 /// <param name="valueSource">The value source for the referenced variables.</param>
 public VariableResolver(IPropertyCollection valueSource)
     : this()
 {
     ValueSource = valueSource;
 }
コード例 #46
0
 /// <summary>  Populates a Properties object with all <c>&lt;property&gt;</c>
 /// values defined as children of the specified node. Properties that already
 /// exist in the Properties object are optionally overwritten with properties
 /// defined by the node.
 /// 
 /// </summary>
 /// <param name="props">The Properties object to populate
 /// </param>
 /// <param name="node">The XmlElement to search for child <c>&lt;property&gt;</c> elements
 /// </param>
 /// <param name="replace">true to replace the values of properties already defined
 /// in the <c>props</c> object
 /// </param>
 public virtual void PopulateProperties( IPropertyCollection props,
                                         XmlElement node,
                                         bool replace )
 {
     if ( node != null ) {
         XmlNodeList propertyList = node.SelectNodes( AdkXmlConstants.Property.ELEMENT );
         // Return only the "enabled" nodes
         foreach ( XmlElement n in new XmlUtils.FilteredElementList( propertyList ) ) {
             string nam = n.GetAttribute( AdkXmlConstants.Property.NAME );
             string val = n.GetAttribute( AdkXmlConstants.Property.VALUE );
             if ( nam.Length > 0 && val.Length > 0 && (replace || !props.Contains( nam )) ) {
                 props[nam] = val;
             }
         }
     }
 }
コード例 #47
0
ファイル: UserRepository.cs プロジェクト: aelveborn/njupiter
		public override void SaveProperties(IUser user, IPropertyCollection propertyCollection) {
			using(var transaction = TransactionFactory.BeginTransaction(CurrentDB)) {
				SaveProperties(user, propertyCollection, transaction);
				transaction.Commit();
			}
		}
コード例 #48
0
		internal void Load(IPropertyCollection local, IPropertyCollection global)
		{
			this._local  = local;
			this._global = global;
		}
コード例 #49
0
 /// <summary>
 /// Initializes a new instance of the DbColumn class.
 /// </summary>
 /// <param name="columnName">Column name.</param>
 /// <param name="dbType">DB data type.</param>
 /// <param name="dataType">.NET type of data stored in the column.</param>
 /// <param name="nullable">Specifies whether the values of this column are nullable.</param>
 /// <param name="ordinal">Column's ordinal in parent table.</param>
 /// <param name="autoIncrement">Specifies whether the values of this column are automatically incremented.</param>
 /// <param name="defaultValue">Default value.</param>
 /// <param name="maxLengthIfText">The maximum length of a text column.</param>
 /// <param name="isPrimaryKeyPart">Indicates whether the column is a part of the primary key.</param>
 /// <param name="isForeignKeyPart">Indicates whether the column is a part of a foreign key.</param>
 /// <param name="isUniqueConstraintPart">Indicates whether the column is a part of a unique constraint.</param>
 /// <param name="propertyName">Name of the class property mapped to this column.</param>
 /// <param name="minValue">The smallest possible value of this column. May be <b>null</b>.</param>
 /// <param name="maxValue">The smallest possible value of this column. May be <b>null</b>.</param>
 /// <param name="isAutoGenerated">Indicates whether the value of the field is automatically generated by database (eg. timestamp in SQL Server).</param>
 /// <param name="sequenceName">Sequence that increments value for this field. <b>Null</b> if the field is not auto-incremented or sequence does not exist.</param>
 /// <param name="extendedProperties">Customized information associated with the table.</param>
 public DbColumnConfiguration(string columnName, DbType dbType, Type dataType, bool nullable, int ordinal, bool autoIncrement, object defaultValue,
     int maxLengthIfText, bool isPrimaryKeyPart, bool isForeignKeyPart, bool isUniqueConstraintPart, string propertyName, object minValue,
     object maxValue, bool isAutoGenerated, string sequenceName, IPropertyCollection extendedProperties)
 {
     this.ColumnName = columnName;
     this.DbType = dbType;
     this.DataType = dataType;
     this.IsNullable = nullable;
     this.Ordinal = ordinal;
     this.AutoIncrement = autoIncrement;
     this.DefaultValue = defaultValue;
     this.MaxLengthIfText = maxLengthIfText;
     this.IsPrimaryKeyPart = isPrimaryKeyPart;
     this.IsForeignKeyPart = isForeignKeyPart;
     this.IsUniqueConstraintPart = isUniqueConstraintPart;
     this.PropertyName = propertyName;
     this.MinValue = minValue;
     this.MaxValue = maxValue;
     this.IsAutoGenerated = isAutoGenerated;
     this.SequenceName = sequenceName;
     this.ExtendedProperties = extendedProperties;
 }