public AutoTag(AbstractMethodXmlBuilder xmlBuilder, string name, AttributeInfo[] attributes)
            {
                _xmlBuilder = xmlBuilder;
                _name = name;

                _xmlBuilder.AppendOpenTag(name, attributes);
            }
예제 #2
0
 internal AttributeInfo Parse()
 {
     var rslt = new AttributeInfo(this);
     rslt.Name = this.Name;
     rslt.Value = this.Value;
     return rslt;
 }
예제 #3
0
 public virtual void RegisterService(AttributeInfo<DependencyAttribute> attributeInfo, ContainerManager container)
 {
     Type serviceType = attributeInfo.Attribute.ServiceType ?? attributeInfo.DecoratedType;
     container.AddComponent(serviceType,
         attributeInfo.DecoratedType,
         attributeInfo.Attribute.Key ?? attributeInfo.DecoratedType.FullName,
         attributeInfo.Attribute.LifeStyle);
 }
예제 #4
0
 private void InternalRegisterService(AttributeInfo<ServiceAttribute> info)
 {
     Type serviceType = info.Attribute.ServiceType ?? info.DecoratedType;
     string key = info.Attribute.Key ??
                  (info.Attribute.ServiceType ?? info.DecoratedType).FullName + "->" + info.DecoratedType.FullName;
     container.AddComponent(key, serviceType, info.DecoratedType);
     Logger.DebugFormat("InternalRegisterService {0} {1} {2}", key, serviceType.Name, info.DecoratedType.Name);
 }
예제 #5
0
 public void AddAttribute(ObjectInfo objTemp)
 {
     if (!string.IsNullOrEmpty(objTemp.Code))
     {
         AttributeInfo attr = new AttributeInfo();
         attr.Store(objTemp);
         this.Attributes.Add(attr);
     }
 }
예제 #6
0
 //add the new attribute to character's learned attribute list, which is charAttributes.
 public void LearnNewAttribute(int _id)
 {
     AttributeInfo newAttInfo = new AttributeInfo();
     newAttInfo.id = _id;
     newAttInfo.modifierLv = 0;
     charAttributes.Add(newAttInfo);
     //update dictionary
     UpdateAttributeEffectDictionary(_id);
 }
예제 #7
0
 private void Register(AttributeInfo<DeasyAttribute> info)
 {
     var type = info.DecoratedType;
     if (type.IsNull()) return;
     _typeFinder.FindClassesOfType(type)
         .Where(t => !t.IsInterface)
         .ForEach(c =>
         {
             _core.ContainerManager.AddComponent(type, c, info.Attribute.Key, info.Attribute.LifeStyle);
         });
 }
예제 #8
0
 public AttributeInfo Parse()
 {
     var attr = new AttributeInfo();
     attr.TokenPair = this;
     attr.Name = this.Name;
     attr.Parameters = new List<string>();
     foreach (var para in Parameters)
     {
         attr.Parameters.Add(para.Replace("\"",""));
     }
     return attr;
 }
		private void AddAttribute ()
		{
			if (attributes.Length == attributeCount) {
				AttributeInfo [] newArr =
					new AttributeInfo [attributeCount * 2];
				Array.Copy (attributes, newArr, attributeCount);
			}
			AttributeInfo ai = attributes [attributeCount];
			if (ai == null) {
				ai = new AttributeInfo ();
				attributes [attributeCount] = ai;
			}
			ai.LocalName = reader.LocalName;
			ai.NamespaceURI = reader.NamespaceURI;
			attributeCount++;
		}
예제 #10
0
        protected override ITaskResult<Nothing> SafeExecute(TaskContext context)
        {
            if (_destination == null)
            {
                throw new Exception("Destination file could not be null");
            }

            _destination.EnsureExists();

            var model = new Model
            {
                Attributes = new List<AttributeInfo>(),
                Namespaces = new List<Namespace>()
            };

            foreach (var attributeExpression in Attributes)
            {
                var body = (NewExpression)attributeExpression.Body;
                var attributeInfo = new AttributeInfo();

                var namespaceName = body.Type.Namespace;

                if (model.Namespaces.All(n => n.Name != namespaceName))
                {
                    model.Namespaces.Add(new Namespace
                    {
                        Name = namespaceName
                    });
                }

                attributeInfo.Name = body.Type.Name;
                attributeInfo.Arguments = string.Join(", ", GetArgumetValues(body));

                model.Attributes.Add(attributeInfo);
            }

            var result = Render.StringToString(Template, model);

            _destination.EnsureExists();
            _destination.WriteStringToFile(result);

            return Success;
        }
예제 #11
0
        /// <summary>
        /// Writes the specified attribute name to the specified <see cref="TextWriter"/>.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="name">The name.</param>
        /// <param name="prefix">The prefix.</param>
        /// <param name="prefixOffset">The prefix offset.</param>
        /// <param name="suffix">The suffix.</param>
        /// <param name="suffixOffset">The suffix offset</param>
        /// <param name="attributeValuesCount">The attribute values count.</param>
        public virtual void BeginWriteAttributeTo(TextWriter writer, string name, string prefix, int prefixOffset, string suffix, int suffixOffset, int attributeValuesCount)
        {
            if (writer == null)
                throw new ArgumentNullException(nameof(writer));

            if (prefix == null)
                throw new ArgumentNullException(nameof(prefix));

            if (suffix == null)
                throw new ArgumentNullException(nameof(suffix));

            _attributeInfo = new AttributeInfo(name, prefix, prefixOffset, suffix, suffixOffset, attributeValuesCount);

            // Single valued attributes might be omitted in entirety if it the attribute value strictly evaluates to
            // null  or false. Consequently defer the prefix generation until we encounter the attribute value.
            if (attributeValuesCount != 1)
            {
                WritePositionTaggedLiteral(writer, prefix, prefixOffset);
            }
        }
예제 #12
0
 internal virtual void Deserialize(IBinaryReader reader, AttributeInfo attributeInfo)
 {
     Name = attributeInfo.Name;
 }
예제 #13
0
        private void sendAttributes(ModelDoc2 model, Collection<AttributeInfo> componentsAttributesCollection, string path, string orderNumber, int fileType, string filePath, string fileName, string configuration)
        {
            string[] attributeNames = model.GetCustomInfoNames2(configuration);

            foreach (string attributeName in attributeNames)
            {
                string attributeValue = model.GetCustomInfoValue(configuration, attributeName);

                //Проверка записано ли свойство такого файла
                AttributeInfo attributeInfo = new AttributeInfo { Path = path, AttributeName = attributeName, AttributeValue = attributeValue };

                KeyValuePair<string, string> componentAttribute = new KeyValuePair<string, string>(path, attributeName);
                if (!componentsAttributesCollection.Contains(attributeInfo))
                {
                    componentsAttributesCollection.Add(attributeInfo);

                    //конвертация булевых атрибутов в формат БД
                    if (model.GetCustomInfoType3(configuration, attributeName) == 11)
                        attributeValue = (attributeValue == "Yes") ? "T" : "F";

                    //пропуск свойств без значений
                    if (!string.IsNullOrEmpty(attributeValue))

                        using (OracleCommand cmd = new OracleCommand())
                        {
                            cmd.Connection = Connection;
                            cmd.CommandText = "GENERAL.SWR_FILEDATA_ADD_SW";
                            cmd.CommandType = CommandType.StoredProcedure;
                            cmd.Parameters.Add("P_NUMAGREE", OracleDbType.Varchar2).Value = orderNumber;
                            cmd.Parameters.Add("P_CODEFILETYPE", OracleDbType.Int32).Value = fileType;
                            cmd.Parameters.Add("P_FILEPATH", OracleDbType.Varchar2).Value = filePath;
                            cmd.Parameters.Add("P_FILENAME", OracleDbType.Varchar2).Value = fileName;
                            cmd.Parameters.Add("P_IDFILEATTRIBUTE", OracleDbType.Varchar2).Value = attributeName;
                            cmd.Parameters.Add("P_ATTRIBUTEVALUE", OracleDbType.Varchar2).Value = attributeValue;
                            cmd.Parameters.Add("P_COMMIT", OracleDbType.Char).Value = 'T';
                            cmd.ExecuteNonQuery();
                        }

                }
                else
                {
                }
            }
        }
예제 #14
0
 public void AddOrderByClause(AttributeInfo info, bool descending)
 {
     query.AddOrderByClause(info, descending);
 }
        public override void Parse(VoidPtr address)
        {
            _nameID = _name;

            if (_size == 0)
                throw new Exception("Nothing to read");

            CharacterInfo cInfo = Manager.SelectedInfo;

            SectionParamInfo data = null;
            if (_name != null && cInfo._parameters.ContainsKey(_name))
            {
                data = cInfo._parameters[_name];
                _info = data._attributes;
                if (!String.IsNullOrEmpty(data._newName))
                    _name = data._newName;
            }
            else _info = new List<AttributeInfo>();

            if (_size > 0)
            {
                attributeBuffer = new UnsafeBuffer(_size);
                byte* pOut = (byte*)attributeBuffer.Address;
                byte* pIn = (byte*)address;

                for (int i = 0; i < _size; i++)
                {
                    if (i % 4 == 0)
                    {
                        if (data == null)
                        {
                            AttributeInfo info = new AttributeInfo();

                            //Guess if the value is a an integer or float
                            if (((((uint)*((buint*)pIn)) >> 24) & 0xFF) != 0 && *((bint*)pIn) != -1 && !float.IsNaN(((float)*((bfloat*)pIn))))
                                info._type = 0;
                            else
                                info._type = 1;

                            info._name = (info._type == 1 ? "*" : "") + "0x" + i.ToString("X");
                            info._description = "No Description Available.";

                            _info.Add(info);
                        }
                    }
                    *pOut++ = *pIn++;
                }
            }
        }
예제 #16
0
        private void AppendOpenTag(string name, AttributeInfo[] attributes)
        {
            _builder.Append('<');
            _builder.Append(name);

            foreach (var attribute in attributes.Where(a => !a.IsEmpty))
            {
                _builder.Append(' ');
                _builder.Append(attribute.Name);
                _builder.Append("=\"");
                AppendEncoded(attribute.Value);
                _builder.Append('"');
            }

            _builder.Append('>');
        }
예제 #17
0
        private void ProcessAttributes(
            XmlReader xmlReader,
            StringBuilder output,
            ElementProcessContext elementProcessContext,
            bool isNoLineBreakElement,
            string attributeIndentationString)
        {
            var list          = new List <AttributeInfo>(xmlReader.AttributeCount);
            var firstLineList = new List <AttributeInfo>(xmlReader.AttributeCount);

            while (xmlReader.MoveToNextAttribute())
            {
                var attributeInfo = this.attributeInfoFactory.Create(xmlReader);
                list.Add(attributeInfo);

                // Maintain separate list of first line attributes.
                if (this.options.EnableAttributeReordering && this.IsFirstLineAttribute(attributeInfo.Name))
                {
                    firstLineList.Add(attributeInfo);
                }

                // Check for xml:space as defined in http://www.w3.org/TR/2008/REC-xml-20081126/#sec-white-space
                if (xmlReader.IsXmlSpaceAttribute())
                {
                    elementProcessContext.Current.IsPreservingSpace = (xmlReader.Value == "preserve");
                }
            }

            if (this.options.EnableAttributeReordering)
            {
                // .NET performs insertion sort if collection partition size is fewer than 16 elements, but it uses
                // Heapsort or Quicksort under different conditions. This can lead to an unstable sort and randomized
                // attributbes while formatting. Even though insertion sort is less performant, XAML elements with more
                // than 16 attributes are not common, so the effect of forcing insertion sort is negligable in all but
                // the most extreme of cases. - https://msdn.microsoft.com/en-us/library/b0zbh7b6(v=vs.110).aspx
                list.InsertionSort(this.AttributeInfoComparison);
                firstLineList.InsertionSort(this.AttributeInfoComparison);
            }

            var noLineBreakInAttributes    = (list.Count <= this.options.AttributesTolerance) || isNoLineBreakElement;
            var forceLineBreakInAttributes = false;

            // Root element?
            if (elementProcessContext.Count == 2)
            {
                switch (this.options.RootElementLineBreakRule)
                {
                case LineBreakRule.Default:
                    break;

                case LineBreakRule.Always:
                    noLineBreakInAttributes    = false;
                    forceLineBreakInAttributes = true;
                    break;

                case LineBreakRule.Never:
                    noLineBreakInAttributes = true;
                    break;

                default:
                    throw new NotImplementedException();
                }
            }

            // No need to break attributes.
            if (noLineBreakInAttributes)
            {
                foreach (var attrInfo in list)
                {
                    output.Append(' ').Append(this.attributeInfoFormatter.ToSingleLineString(attrInfo));
                }

                elementProcessContext.Current.IsMultlineStartTag = false;
            }
            else
            {
                // Need to break attributes.
                var attributeLines    = new List <string>();
                var currentLineBuffer = new StringBuilder();
                int attributeCountInCurrentLineBuffer     = 0;
                int xmlnsAliasesBypassLengthInCurrentLine = 0;

                AttributeInfo lastAttributeInfo = null;

                // Process first line attributes.
                string firstLine = String.Empty;
                foreach (var attrInfo in firstLineList)
                {
                    firstLine = $"{firstLine} {this.attributeInfoFormatter.ToSingleLineString(attrInfo)}";
                }

                if (firstLine.Length > 0)
                {
                    attributeLines.Add(firstLine);
                }

                foreach (AttributeInfo attrInfo in list)
                {
                    // Skip attributes already added to first line.
                    if (firstLineList.Contains(attrInfo))
                    {
                        continue;
                    }

                    // Attributes with markup extension, always put on new line
                    if (attrInfo.IsMarkupExtension && this.options.FormatMarkupExtension)
                    {
                        if (currentLineBuffer.Length > 0)
                        {
                            attributeLines.Add(currentLineBuffer.ToString());
                            currentLineBuffer.Length          = 0;
                            attributeCountInCurrentLineBuffer = 0;
                        }

                        attributeLines.Add(
                            this.attributeInfoFormatter.ToMultiLineString(attrInfo, attributeIndentationString));
                    }
                    else
                    {
                        string pendingAppend       = this.attributeInfoFormatter.ToSingleLineString(attrInfo);
                        var    actualPendingAppend = this.xmlEscapingService.RestoreXmlnsAliasesBypass(pendingAppend);
                        xmlnsAliasesBypassLengthInCurrentLine += pendingAppend.Length - actualPendingAppend.Length;

                        bool isAttributeCharLengthExceeded = (attributeCountInCurrentLineBuffer > 0) &&
                                                             (this.options.MaxAttributeCharactersPerLine > 0) &&
                                                             ((currentLineBuffer.Length + pendingAppend.Length - xmlnsAliasesBypassLengthInCurrentLine) > this.options.MaxAttributeCharactersPerLine);

                        bool isAttributeCountExceeded = (this.options.MaxAttributesPerLine > 0) &&
                                                        ((attributeCountInCurrentLineBuffer + 1) > this.options.MaxAttributesPerLine);

                        bool isAttributeRuleGroupChanged = this.options.PutAttributeOrderRuleGroupsOnSeparateLines &&
                                                           (lastAttributeInfo != null) &&
                                                           (lastAttributeInfo.OrderRule.Group != attrInfo.OrderRule.Group);

                        if ((currentLineBuffer.Length > 0) &&
                            (forceLineBreakInAttributes || isAttributeCharLengthExceeded || isAttributeCountExceeded || isAttributeRuleGroupChanged))
                        {
                            attributeLines.Add(currentLineBuffer.ToString());
                            currentLineBuffer.Length              = 0;
                            attributeCountInCurrentLineBuffer     = 0;
                            xmlnsAliasesBypassLengthInCurrentLine = 0;
                        }

                        currentLineBuffer.AppendFormat(CultureInfo.InvariantCulture, "{0} ", pendingAppend);
                        attributeCountInCurrentLineBuffer++;
                        xmlnsAliasesBypassLengthInCurrentLine += pendingAppend.Length - actualPendingAppend.Length;
                    }

                    lastAttributeInfo = attrInfo;
                }

                if (currentLineBuffer.Length > 0)
                {
                    attributeLines.Add(currentLineBuffer.ToString());
                }

                for (int i = 0; i < attributeLines.Count; i++)
                {
                    // Put first attribute line on same line as element?
                    if ((i == 0) && (this.options.KeepFirstAttributeOnSameLine || (firstLineList.Count > 0)))
                    {
                        output.Append(' ').Append(attributeLines[i].Trim());
                    }
                    else
                    {
                        output.Append(Environment.NewLine)
                        .Append(this.indentService.Normalize(attributeIndentationString + attributeLines[i].Trim()));
                    }
                }

                elementProcessContext.Current.IsMultlineStartTag = true;
            }
        }
예제 #18
0
 public bool GetBackgroundImageProperties(AttributeInfo sourceAttribute, AttributeInfo valueAttribute, AttributeInfo mimeTypeAttribute, AttributeInfo repeatAttribute, out Image.SourceType imageSource, out object imageValue, out bool isValueExpression, out object mimeType, out bool isMimeTypeExpression, out object repeat, out bool isRepeatExpression)
 {
     this.GetBackgroundImageValue(valueAttribute, out imageValue, out isValueExpression);
     this.GetBackgroundImageMIMEType(mimeTypeAttribute, out mimeType, out isMimeTypeExpression);
     this.GetBackgroundImageRepeat(repeatAttribute, out repeat, out isRepeatExpression);
     return(this.GetBackgroundImageSource(sourceAttribute, out imageSource));
 }
예제 #19
0
        protected void OnSetupInstance()
        {
            Type type             = GetType();
            Type serializableType = typeof(Serializable);

            // Only do this for user types.
            if (type.Assembly == serializableType.Assembly || !type.IsSubclassOf(serializableType))
            {
                return;
            }

            AttributeMap allAttributes = Context.AllAttributes;

            // And only once per type.
            if (allAttributes.ContainsKey(GetTypeHash()))
            {
                return;
            }

            // Register field attributes of this class
            foreach (FieldInfo field in type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic))
            {
                if (field.DeclaringType?.Assembly == serializableType.Assembly)
                {
                    continue;
                }

                if (field.IsNotSerialized)
                {
                    continue;
                }

                var attribute = Attribute.GetCustomAttribute(field, typeof(SerializeFieldAttribute)) as SerializeFieldAttribute;
                if (field.IsPrivate && attribute == null)
                {
                    continue;
                }

                Type fieldType = field.FieldType;
                if (fieldType.IsEnum)
                {
                    fieldType = Enum.GetUnderlyingType(fieldType);
                }
                VariantType variantType = Variant.GetVariantType(fieldType);

                // TODO: Support VariantType.VarPtr
                if (variantType == VariantType.VarNone || variantType == VariantType.VarPtr || variantType == VariantType.VarVoidPtr)
                {
                    // Incompatible type.
                    Log.Warning($"Trying to register attribute {field.DeclaringType?.FullName}.{field.Name} which has incompatible type {field.FieldType.Name}.");
                    continue;
                }

                StringList enumNames = _emptyStringList;
                if (field.FieldType.IsEnum)
                {
                    enumNames = new StringList();
                    foreach (string name in field.FieldType.GetEnumNames())
                    {
                        enumNames.Add(name);
                    }
                }

                var accessor     = new VariantFieldAccessor(field, variantType);
                var defaultValue = new Variant();
                try
                {
                    accessor.Get(this, defaultValue);
                }
                catch (ArgumentNullException)
                {
                    defaultValue = new Variant(variantType);
                }
                string attributeName = attribute?.Name ?? field.Name;
                var    info          = new AttributeInfo(accessor.VariantType, attributeName, accessor, enumNames, defaultValue,
                                                         attribute?.Mode ?? AttributeMode.AmDefault);
                Context.RegisterAttribute(GetTypeHash(), info);
            }

            // Register property attributes of this class
            foreach (PropertyInfo property in type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic))
            {
                if (property.DeclaringType?.Assembly == serializableType.Assembly)
                {
                    continue;
                }

                // Private (even if partially) properties are not serialized by default.
                var attribute = Attribute.GetCustomAttribute(property, typeof(SerializeFieldAttribute)) as SerializeFieldAttribute;
                if ((property.GetMethod.IsPrivate || property.SetMethod.IsPrivate) && attribute == null)
                {
                    continue;
                }

                if (!property.CanRead || !property.CanWrite)
                {
                    Log.Warning($"Trying to register attribute {property.DeclaringType?.FullName}.{property.Name} which is not readable and writable.");
                    continue;
                }

                Type propertyType = property.PropertyType;
                if (propertyType.IsEnum)
                {
                    propertyType = Enum.GetUnderlyingType(propertyType);
                }
                VariantType variantType = Variant.GetVariantType(propertyType);

                // TODO: Support VariantType.VarPtr
                if (variantType == VariantType.VarNone || variantType == VariantType.VarPtr || variantType == VariantType.VarVoidPtr)
                {
                    // Incompatible type.
                    Log.Warning($"Trying to register attribute {property.DeclaringType?.FullName}.{property.Name} which has incompatible type {property.PropertyType.Name}.");
                    continue;
                }

                StringList enumNames = _emptyStringList;
                if (property.PropertyType.IsEnum)
                {
                    enumNames = new StringList();
                    foreach (string name in property.PropertyType.GetEnumNames())
                    {
                        enumNames.Add(name);
                    }
                }

                var accessor     = new VariantPropertyAccessor(property, variantType);
                var defaultValue = new Variant();
                try
                {
                    accessor.Get(this, defaultValue);
                }
                catch (ArgumentNullException)
                {
                    defaultValue = new Variant(variantType);
                }

                string attributeName = attribute?.Name ?? property.Name;
                var    info          = new AttributeInfo(accessor.VariantType, attributeName, accessor, enumNames, defaultValue,
                                                         attribute?.Mode ?? AttributeMode.AmDefault);
                Context.RegisterAttribute(GetTypeHash(), info);
            }
        }
예제 #20
0
파일: Serializable.cs 프로젝트: yazici/rbfx
        protected void OnSetupInstance()
        {
            var type             = GetType();
            var serializableType = typeof(Serializable);

            // Only do this for user types.
            if (type.Assembly == serializableType.Assembly || !type.IsSubclassOf(serializableType))
            {
                return;
            }

            var context       = GetContext();
            var allAttributes = context.GetAllAttributes();

            // And only once per type.
            if (allAttributes.ContainsKey(GetTypeHash()))
            {
                return;
            }

            // Register attributes of this class
            foreach (var field in type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic))
            {
                if (field.DeclaringType?.Assembly == serializableType.Assembly)
                {
                    continue;
                }

                if (field.IsNotSerialized)
                {
                    continue;
                }

                var attribute = Attribute.GetCustomAttribute(field, typeof(SerializeFieldAttribute)) as SerializeFieldAttribute;
                if (field.IsPrivate && attribute == null)
                {
                    continue;
                }

                var fieldType = field.FieldType;
                if (field.FieldType.IsEnum)
                {
                    fieldType = Enum.GetUnderlyingType(fieldType);
                }
                var variantType = Variant.GetVariantType(fieldType);
                if (variantType == VariantType.VarNone)
                {
                    // Incompatible type.
                    continue;
                }

                // TODO: This needs more work. Serializable should automatically serialize instances of Serializable.
                if (variantType == VariantType.VarPtr)
                {
                    continue;
                }

                // No way to serialize that in any meaningful way.
                if (variantType == VariantType.VarVoidptr)
                {
                    continue;
                }

                var enumNames = _emptyStringVector;
                if (field.FieldType.IsEnum)
                {
                    enumNames = new StringVector();
                    foreach (var name in field.FieldType.GetEnumNames())
                    {
                        enumNames.Add(name);
                    }
                }

                var accessor     = new VariantFieldAccessor(field, variantType);
                var defaultValue = new Variant();
                accessor.Get(this, defaultValue);

                var attributeName = attribute?.Name ?? field.Name;
                var info          = new AttributeInfo(accessor.VariantType, attributeName, accessor, enumNames, defaultValue,
                                                      attribute?.Mode ?? AttributeMode.AmDefault);
                context.RegisterAttribute(GetTypeHash(), info);
            }
        }
예제 #21
0
 public abstract object GetStyleAttributeValue(string styleName, AttributeInfo attribute);
예제 #22
0
        public IPersistable CreateRIFObject(ObjectType objectType, ref IntermediateFormatReader context)
        {
            IPersistable persistable = null;

            if (objectType == ObjectType.Null)
            {
                return(null);
            }
            IDOwner    parentIDOwner    = m_parentIDOwner;
            ReportItem parentReportItem = m_parentReportItem;

            switch (objectType)
            {
            case ObjectType.PageSection:
                persistable        = new PageSection(m_parentReportItem);
                m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.Line:
                persistable        = new Line(m_parentReportItem);
                m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.Rectangle:
                persistable        = new Rectangle(m_parentReportItem);
                m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.Image:
                persistable        = new Image(m_parentReportItem);
                m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.TextBox:
                persistable        = new TextBox(m_parentReportItem);
                m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.SubReport:
                persistable        = new SubReport(m_parentReportItem);
                m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.Grouping:
                persistable = new Grouping(ConstructionPhase.Deserializing);
                break;

            case ObjectType.Sorting:
                persistable = new Sorting(ConstructionPhase.Deserializing);
                break;

            case ObjectType.ReportItemCollection:
                persistable = new ReportItemCollection();
                break;

            case ObjectType.ReportItemIndexer:
                persistable = default(ReportItemIndexer);
                break;

            case ObjectType.Style:
                persistable = new Style(ConstructionPhase.Deserializing);
                break;

            case ObjectType.AttributeInfo:
                persistable = new AttributeInfo();
                break;

            case ObjectType.Visibility:
                persistable = new Visibility();
                break;

            case ObjectType.ExpressionInfo:
                persistable = new ExpressionInfo();
                break;

            case ObjectType.ExpressionInfoTypeValuePair:
                persistable = new ExpressionInfoTypeValuePair();
                break;

            case ObjectType.DataAggregateInfo:
                persistable = new DataAggregateInfo();
                break;

            case ObjectType.RunningValueInfo:
                persistable = new RunningValueInfo();
                break;

            case ObjectType.Filter:
                persistable = new Filter();
                break;

            case ObjectType.DataSource:
                persistable = new DataSource();
                break;

            case ObjectType.DataSet:
                persistable = new DataSet();
                break;

            case ObjectType.ReportQuery:
                persistable = new ReportQuery();
                break;

            case ObjectType.Field:
                persistable = new Field();
                break;

            case ObjectType.ParameterValue:
                persistable = new ParameterValue();
                break;

            case ObjectType.ReportSnapshot:
                persistable = new ReportSnapshot();
                break;

            case ObjectType.DocumentMapNode:
                persistable = new DocumentMapNode();
                break;

            case ObjectType.DocumentMapBeginContainer:
                persistable = DocumentMapBeginContainer.Instance;
                break;

            case ObjectType.DocumentMapEndContainer:
                persistable = DocumentMapEndContainer.Instance;
                break;

            case ObjectType.ReportInstance:
                persistable = new ReportInstance();
                break;

            case ObjectType.ParameterInfo:
                persistable = new ParameterInfo();
                break;

            case ObjectType.ValidValue:
                persistable = new ValidValue();
                break;

            case ObjectType.ParameterDataSource:
                persistable = new ParameterDataSource();
                break;

            case ObjectType.ParameterDef:
                persistable = new ParameterDef();
                break;

            case ObjectType.ProcessingMessage:
                persistable = new ProcessingMessage();
                break;

            case ObjectType.CodeClass:
                persistable = default(CodeClass);
                break;

            case ObjectType.Action:
                persistable = new Action();
                break;

            case ObjectType.RenderingPagesRanges:
                persistable = default(RenderingPagesRanges);
                break;

            case ObjectType.IntermediateFormatVersion:
                persistable = new IntermediateFormatVersion();
                break;

            case ObjectType.ImageInfo:
                persistable = new ImageInfo();
                break;

            case ObjectType.ActionItem:
                persistable = new ActionItem();
                break;

            case ObjectType.DataValue:
                persistable = new DataValue();
                break;

            case ObjectType.CustomReportItem:
                persistable        = new CustomReportItem(m_parentReportItem);
                m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.SortFilterEventInfoMap:
                persistable = new SortFilterEventInfoMap();
                break;

            case ObjectType.SortFilterEventInfo:
                persistable = new SortFilterEventInfo();
                break;

            case ObjectType.EndUserSort:
                persistable = new EndUserSort();
                break;

            case ObjectType.ScopeLookupTable:
                persistable = new ScopeLookupTable();
                break;

            case ObjectType.Tablix:
                persistable        = new Tablix(m_parentReportItem);
                m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.TablixHeader:
                persistable = new TablixHeader();
                break;

            case ObjectType.TablixMember:
                persistable = new TablixMember();
                break;

            case ObjectType.TablixColumn:
                persistable = new TablixColumn();
                break;

            case ObjectType.TablixRow:
                persistable = new TablixRow();
                break;

            case ObjectType.TablixCornerCell:
                persistable = new TablixCornerCell();
                break;

            case ObjectType.TablixCell:
                persistable = new TablixCell();
                break;

            case ObjectType.Chart:
                persistable        = new Chart(m_parentReportItem);
                m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.ChartMember:
                persistable = new ChartMember();
                break;

            case ObjectType.ChartSeries:
                persistable = new ChartSeries();
                break;

            case ObjectType.ChartDataPoint:
                persistable = new ChartDataPoint();
                break;

            case ObjectType.ChartDataPointValues:
                persistable = new ChartDataPointValues();
                break;

            case ObjectType.ChartArea:
                persistable = new ChartArea();
                break;

            case ObjectType.ChartLegend:
                persistable = new ChartLegend();
                break;

            case ObjectType.ChartLegendTitle:
                persistable = new ChartLegendTitle();
                break;

            case ObjectType.ChartAxis:
                persistable = new ChartAxis();
                break;

            case ObjectType.ThreeDProperties:
                persistable = new ChartThreeDProperties();
                break;

            case ObjectType.ChartDataLabel:
                persistable = new ChartDataLabel();
                break;

            case ObjectType.ChartMarker:
                persistable = new ChartMarker();
                break;

            case ObjectType.ChartTitle:
                persistable = new ChartTitle();
                break;

            case ObjectType.ChartAxisScaleBreak:
                persistable = new ChartAxisScaleBreak();
                break;

            case ObjectType.ChartDerivedSeries:
                persistable = new ChartDerivedSeries();
                break;

            case ObjectType.ChartBorderSkin:
                persistable = new ChartBorderSkin();
                break;

            case ObjectType.ChartNoDataMessage:
                persistable = new ChartNoDataMessage();
                break;

            case ObjectType.ChartItemInLegend:
                persistable = new ChartItemInLegend();
                break;

            case ObjectType.ChartEmptyPoints:
                persistable = new ChartEmptyPoints();
                break;

            case ObjectType.ChartNoMoveDirections:
                persistable = new ChartNoMoveDirections();
                break;

            case ObjectType.ChartFormulaParameter:
                persistable = new ChartFormulaParameter();
                break;

            case ObjectType.ChartLegendColumn:
                persistable = new ChartLegendColumn();
                break;

            case ObjectType.ChartLegendColumnHeader:
                persistable = new ChartLegendColumnHeader();
                break;

            case ObjectType.ChartLegendCustomItem:
                persistable = new ChartLegendCustomItem();
                break;

            case ObjectType.ChartLegendCustomItemCell:
                persistable = new ChartLegendCustomItemCell();
                break;

            case ObjectType.ChartAlignType:
                persistable = new ChartAlignType();
                break;

            case ObjectType.ChartElementPosition:
                persistable = new ChartElementPosition();
                break;

            case ObjectType.ChartSmartLabel:
                persistable = new ChartSmartLabel();
                break;

            case ObjectType.ChartStripLine:
                persistable = new ChartStripLine();
                break;

            case ObjectType.ChartAxisTitle:
                persistable = new ChartAxisTitle();
                break;

            case ObjectType.ChartCustomPaletteColor:
                persistable = new ChartCustomPaletteColor();
                break;

            case ObjectType.GridLines:
                persistable = new ChartGridLines();
                break;

            case ObjectType.ChartTickMarks:
                persistable = new ChartTickMarks();
                break;

            case ObjectType.DataMember:
                persistable = new DataMember();
                break;

            case ObjectType.CustomDataRow:
                persistable = new CustomDataRow();
                break;

            case ObjectType.DataCell:
                persistable = new DataCell();
                break;

            case ObjectType.Variable:
                persistable = new Variable();
                break;

            case ObjectType.Page:
                persistable = new Page();
                break;

            case ObjectType.Paragraph:
                persistable = new Paragraph();
                break;

            case ObjectType.TextRun:
                persistable = new TextRun();
                break;

            case ObjectType.Report:
                persistable        = new Report(m_parentReportItem);
                m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.GaugePanel:
                persistable        = new GaugePanel(m_parentReportItem);
                m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.GaugeMember:
                persistable = new GaugeMember();
                break;

            case ObjectType.GaugeRow:
                persistable = new GaugeRow();
                break;

            case ObjectType.GaugeCell:
                persistable = new GaugeCell();
                break;

            case ObjectType.BackFrame:
                persistable = new BackFrame();
                break;

            case ObjectType.CapImage:
                persistable = new CapImage();
                break;

            case ObjectType.FrameBackground:
                persistable = new FrameBackground();
                break;

            case ObjectType.FrameImage:
                persistable = new FrameImage();
                break;

            case ObjectType.CustomLabel:
                persistable = new CustomLabel();
                break;

            case ObjectType.GaugeImage:
                persistable = new GaugeImage();
                break;

            case ObjectType.GaugeInputValue:
                persistable = new GaugeInputValue();
                break;

            case ObjectType.GaugeLabel:
                persistable = new GaugeLabel();
                break;

            case ObjectType.GaugePanelItem:
                persistable = new GaugePanelItem();
                break;

            case ObjectType.GaugeTickMarks:
                persistable = new GaugeTickMarks();
                break;

            case ObjectType.LinearGauge:
                persistable = new LinearGauge();
                break;

            case ObjectType.LinearPointer:
                persistable = new LinearPointer();
                break;

            case ObjectType.LinearScale:
                persistable = new LinearScale();
                break;

            case ObjectType.NumericIndicator:
                persistable = new NumericIndicator();
                break;

            case ObjectType.PinLabel:
                persistable = new PinLabel();
                break;

            case ObjectType.PointerCap:
                persistable = new PointerCap();
                break;

            case ObjectType.PointerImage:
                persistable = new PointerImage();
                break;

            case ObjectType.RadialGauge:
                persistable = new RadialGauge();
                break;

            case ObjectType.RadialPointer:
                persistable = new RadialPointer();
                break;

            case ObjectType.RadialScale:
                persistable = new RadialScale();
                break;

            case ObjectType.ScaleLabels:
                persistable = new ScaleLabels();
                break;

            case ObjectType.ScalePin:
                persistable = new ScalePin();
                break;

            case ObjectType.ScaleRange:
                persistable = new ScaleRange();
                break;

            case ObjectType.IndicatorImage:
                persistable = new IndicatorImage();
                break;

            case ObjectType.StateIndicator:
                persistable = new StateIndicator();
                break;

            case ObjectType.Thermometer:
                persistable = new Thermometer();
                break;

            case ObjectType.TickMarkStyle:
                persistable = new TickMarkStyle();
                break;

            case ObjectType.TopImage:
                persistable = new TopImage();
                break;

            case ObjectType.LookupInfo:
                persistable = new LookupInfo();
                break;

            case ObjectType.LookupDestinationInfo:
                persistable = new LookupDestinationInfo();
                break;

            case ObjectType.ReportSection:
                persistable = new ReportSection();
                break;

            case ObjectType.MapFieldDefinition:
                persistable = new MapFieldDefinition();
                break;

            case ObjectType.MapFieldName:
                persistable = new MapFieldName();
                break;

            case ObjectType.MapLineLayer:
                persistable = new MapLineLayer();
                break;

            case ObjectType.MapShapefile:
                persistable = new MapShapefile();
                break;

            case ObjectType.MapPolygonLayer:
                persistable = new MapPolygonLayer();
                break;

            case ObjectType.MapSpatialDataRegion:
                persistable = new MapSpatialDataRegion();
                break;

            case ObjectType.MapSpatialDataSet:
                persistable = new MapSpatialDataSet();
                break;

            case ObjectType.MapPointLayer:
                persistable = new MapPointLayer();
                break;

            case ObjectType.MapTile:
                persistable = new MapTile();
                break;

            case ObjectType.MapTileLayer:
                persistable = new MapTileLayer();
                break;

            case ObjectType.MapField:
                persistable = new MapField();
                break;

            case ObjectType.MapLine:
                persistable = new MapLine();
                break;

            case ObjectType.MapPolygon:
                persistable = new MapPolygon();
                break;

            case ObjectType.MapPoint:
                persistable = new MapPoint();
                break;

            case ObjectType.MapLineTemplate:
                persistable = new MapLineTemplate();
                break;

            case ObjectType.MapPolygonTemplate:
                persistable = new MapPolygonTemplate();
                break;

            case ObjectType.MapMarkerTemplate:
                persistable = new MapMarkerTemplate();
                break;

            case ObjectType.Map:
                persistable        = new Map(m_parentReportItem);
                m_parentReportItem = (ReportItem)persistable;
                break;

            case ObjectType.MapBorderSkin:
                persistable = new MapBorderSkin();
                break;

            case ObjectType.MapDataRegion:
                persistable = new MapDataRegion(m_parentReportItem);
                break;

            case ObjectType.MapMember:
                persistable = new MapMember();
                break;

            case ObjectType.MapRow:
                persistable = new MapRow();
                break;

            case ObjectType.MapCell:
                persistable = new MapCell();
                break;

            case ObjectType.MapLocation:
                persistable = new MapLocation();
                break;

            case ObjectType.MapSize:
                persistable = new MapSize();
                break;

            case ObjectType.MapGridLines:
                persistable = new MapGridLines();
                break;

            case ObjectType.MapBindingFieldPair:
                persistable = new MapBindingFieldPair();
                break;

            case ObjectType.MapCustomView:
                persistable = new MapCustomView();
                break;

            case ObjectType.MapDataBoundView:
                persistable = new MapDataBoundView();
                break;

            case ObjectType.MapElementView:
                persistable = new MapElementView();
                break;

            case ObjectType.MapViewport:
                persistable = new MapViewport();
                break;

            case ObjectType.MapLimits:
                persistable = new MapLimits();
                break;

            case ObjectType.MapColorScale:
                persistable = new MapColorScale();
                break;

            case ObjectType.MapColorScaleTitle:
                persistable = new MapColorScaleTitle();
                break;

            case ObjectType.MapDistanceScale:
                persistable = new MapDistanceScale();
                break;

            case ObjectType.MapTitle:
                persistable = new MapTitle();
                break;

            case ObjectType.MapLegend:
                persistable = new MapLegend();
                break;

            case ObjectType.MapLegendTitle:
                persistable = new MapLegendTitle();
                break;

            case ObjectType.MapBucket:
                persistable = new MapBucket();
                break;

            case ObjectType.MapColorPaletteRule:
                persistable = new MapColorPaletteRule();
                break;

            case ObjectType.MapColorRangeRule:
                persistable = new MapColorRangeRule();
                break;

            case ObjectType.MapCustomColorRule:
                persistable = new MapCustomColorRule();
                break;

            case ObjectType.MapCustomColor:
                persistable = new MapCustomColor();
                break;

            case ObjectType.MapLineRules:
                persistable = new MapLineRules();
                break;

            case ObjectType.MapPolygonRules:
                persistable = new MapPolygonRules();
                break;

            case ObjectType.MapSizeRule:
                persistable = new MapSizeRule();
                break;

            case ObjectType.MapMarkerImage:
                persistable = new MapMarkerImage();
                break;

            case ObjectType.MapMarker:
                persistable = new MapMarker();
                break;

            case ObjectType.MapMarkerRule:
                persistable = new MapMarkerRule();
                break;

            case ObjectType.MapPointRules:
                persistable = new MapPointRules();
                break;

            case ObjectType.PageBreak:
                persistable = new PageBreak();
                break;

            case ObjectType.DataScopeInfo:
                persistable = new DataScopeInfo();
                break;

            case ObjectType.LinearJoinInfo:
                persistable = new LinearJoinInfo();
                break;

            case ObjectType.IntersectJoinInfo:
                persistable = new IntersectJoinInfo();
                break;

            case ObjectType.BucketedDataAggregateInfos:
                persistable = new BucketedDataAggregateInfos();
                break;

            case ObjectType.DataAggregateInfoBucket:
                persistable = new DataAggregateInfoBucket();
                break;

            case ObjectType.NumericIndicatorRange:
                persistable = new NumericIndicatorRange();
                break;

            case ObjectType.IndicatorState:
                persistable = new IndicatorState();
                break;

            case ObjectType.SharedDataSetQuery:
                persistable = new SharedDataSetQuery();
                break;

            case ObjectType.DataSetCore:
                persistable = new DataSetCore();
                break;

            case ObjectType.DataSetParameterValue:
                persistable = new DataSetParameterValue();
                break;

            case ObjectType.RIFVariantContainer:
                persistable = new RIFVariantContainer();
                break;

            case ObjectType.IdcRelationship:
                persistable = new IdcRelationship();
                break;

            case ObjectType.DefaultRelationship:
                persistable = new DefaultRelationship();
                break;

            case ObjectType.JoinCondition:
                persistable = new Relationship.JoinCondition();
                break;

            case ObjectType.BandLayoutOptions:
                persistable = new BandLayoutOptions();
                break;

            case ObjectType.LabelData:
                persistable = new LabelData();
                break;

            case ObjectType.Slider:
                persistable = new Slider();
                break;

            case ObjectType.Coverflow:
                persistable = new Coverflow();
                break;

            case ObjectType.PlayAxis:
                persistable = new PlayAxis();
                break;

            case ObjectType.BandNavigationCell:
                persistable = new BandNavigationCell();
                break;

            case ObjectType.Tabstrip:
                persistable = new Tabstrip();
                break;

            case ObjectType.NavigationItem:
                persistable = new NavigationItem();
                break;

            case ObjectType.ScopedFieldInfo:
                persistable = new ScopedFieldInfo();
                break;

            default:
                Global.Tracer.Assert(condition: false, "Unsupported object type: " + objectType);
                break;
            }
            IDOwner iDOwner = persistable as IDOwner;

            if (iDOwner != null)
            {
                iDOwner.ParentInstancePath = m_parentIDOwner;
                m_parentIDOwner            = iDOwner;
            }
            persistable.Deserialize(context);
            m_parentIDOwner    = parentIDOwner;
            m_parentReportItem = parentReportItem;
            return(persistable);
        }
예제 #23
0
 public abstract int AddAttributeName(AttributeInfo attribute);
예제 #24
0
 public abstract bool AddAttribute(AttributeInfo attribute);
예제 #25
0
        public async Task Create(AttributeInfo attribute)
        {
            await _db.AttributeInfos.AddAsync(attribute).ConfigureAwait(false);

            await _db.SaveChangesAsync().ConfigureAwait(false);
        }
예제 #26
0
 public override bool IsApplicable(AttributeInfo value)
 {
     return(true);
 }
예제 #27
0
 public abstract bool UpdateSpecification(AttributeInfo attribute);
예제 #28
0
 public override bool IsMatch(AttributeInfo attributeInfo)
 {
     return(!AttributeNames.Contains(attributeInfo.AttributeClass));
 }
예제 #29
0
 private void CreateAttribute(TypeInfo ti, Classifier aCls, AttributeInfo aField, PdOOM.BasePackage aPckg)
 {
     CustomHandlerField field = new CustomHandlerField(aField, null);
     if (!field.ThroughProperty)
     {
         PdOOM.Attribute attribute = (PdOOM.Attribute)aCls.CreateObject(0x18112065, "", -1, true);
         if (aField.IsStatic)
         {
             attribute.Static = true;
         }
         try
         {
             attribute.Name = attribute.Code = aField.Name;
         }
         catch (COMException)
         {
             if (LZ.Reverse.Info._bDebug)
             {
                 LZ.Reverse.Info.Write(new string[] { "*** exception while naming the attribute \"{1}\" on the type \"{0}\"", aField.Code, aField.Name });
             }
         }
         attribute.Visibility = GetTypeVisibility(aField.Modifier);
         //attribute.Persistent = !aField.IsNotSerialized;
         field.PdObj = attribute;
         field.Convert();
         ////Type fieldType = aField.FieldType;
         ////if (fieldType.IsArray)
         ////{
         ////    attribute.Multiplicity = "*";
         ////    fieldType = fieldType.GetElementType();
         ////}
         ////if (fieldType.IsGenericType && !fieldType.IsGenericTypeDefinition)
         ////{
         ////    fieldType = fieldType.GetGenericTypeDefinition();
         ////}
         ////this.ProcessType(fieldType, false);
         ////TypeMapping mapping = TypeMapping.Retrieve(fieldType);
         ////if (mapping.HasClassifier())
         ////{
         ////    PdOOM.BaseObject obj2 = ProperRef.Link(NamespaceMapping.Retrieve(aPckg), mapping);
         ////    attribute.UseQualifiedDataType = false;
         ////    attribute.DataTypeObject = obj2;
         ////}
         ////else
         {
             attribute.DataType = ti.Code;   // mapping.Name;
         }
     }
 }
예제 #30
0
 /// <summary>
 /// 更新属性
 /// </summary>
 /// <param name="newAttributeInfo">新属性</param>
 /// <param name="oldAttributeInfo">原属性</param>
 public static void UpdateAttribute(AttributeInfo attributeInfo)
 {
     BrnMall.Core.BMAData.RDBS.UpdateAttribute(attributeInfo);
 }
 public void LoadParameters()
 {
     _parameters = new Dictionary<string, SectionParamInfo>();
     string loc = Application.StartupPath + "/MovesetData/CharSpecific/Fit" + ((CharFolder)(int)_charId).ToString() + ".txt";
     string n = "", attrName = "";
     if (File.Exists(loc))
         using (StreamReader sr = new StreamReader(loc))
             while (!sr.EndOfStream)
             {
                 n = sr.ReadLine();
                 SectionParamInfo info = new SectionParamInfo();
                 info._newName = sr.ReadLine();
                 info._attributes = new List<AttributeInfo>();
                 while (true && !sr.EndOfStream)
                 {
                     if (String.IsNullOrEmpty(attrName = sr.ReadLine()))
                         break;
                     else
                     {
                         AttributeInfo i = new AttributeInfo();
                         i._name = attrName;
                         i._description = sr.ReadLine();
                         i._type = int.Parse(sr.ReadLine());
                         info._attributes.Add(i);
                         sr.ReadLine();
                     }
                 }
                 if (!_parameters.ContainsKey(n))
                     _parameters.Add(n, info);
             }
 }
예제 #32
0
 /// <summary>
 /// 创建属性
 /// </summary>
 /// <param name="attributeInfo">属性信息</param>
 /// <param name="attrGroupId">属性组id</param>
 /// <param name="attrGroupName">属性组名称</param>
 /// <param name="attrGroupDisplayOrder">属性组排序</param>
 public static void CreateAttribute(AttributeInfo attributeInfo, int attrGroupId, string attrGroupName, int attrGroupDisplayOrder)
 {
     BrnMall.Core.BMAData.RDBS.CreateAttribute(attributeInfo, attrGroupId, attrGroupName, attrGroupDisplayOrder);
 }
        protected void AddUnusedAttribute(int size, VertexAttribPointerType pointerType = VertexAttribPointerType.Float)
        {
            AttributeInfo info = new AttributeInfo(this, String.Empty, size, VertexDataStride,
                0, 0, pointerType, false);

            VertexDataStride += info.Length;
            VertexDataSize += info.Size;
        }
예제 #34
0
        void IInitializable.Initialize()
        {
            m_controlInfo = new ControlInfo("DesignView", "DesignView", StandardControlGroup.CenterPermanent);
            m_controlHostService.RegisterControl(m_designView.HostControl, m_controlInfo, this);

            Application.ApplicationExit += delegate
            {
                Util3D.Shutdown();
                GameEngine.Shutdown();
            };

            GameEngine.RefreshView += (sender, e) => m_designView.InvalidateViews();

            m_gameDocumentRegistry.DocumentAdded   += new EventHandler <ItemInsertedEventArgs <IGameDocument> >(m_gameDocumentRegistry_DocumentAdded);
            m_gameDocumentRegistry.DocumentRemoved += new EventHandler <ItemRemovedEventArgs <IGameDocument> >(m_gameDocumentRegistry_DocumentRemoved);

            string ns = m_schemaLoader.NameSpace;

            // register GridRenderer on grid child.
            DomNodeType gridType = m_schemaLoader.TypeCollection.GetNodeType(ns, "gridType");

            gridType.Define(new ExtensionInfo <GridRenderer>());

            // register NativeGameWorldAdapter on game type.
            m_schemaLoader.GameType.Define(new ExtensionInfo <NativeGameWorldAdapter>());

            // parse schema annotation.
            foreach (DomNodeType domType in m_schemaLoader.TypeCollection.GetNodeTypes())
            {
                IEnumerable <XmlNode> annotations = domType.GetTagLocal <IEnumerable <XmlNode> >();
                if (annotations == null)
                {
                    continue;
                }


                // collect all the properties that only exist in native side.
                List <NativeAttributeInfo> nativeAttribs = new List <NativeAttributeInfo>();

                foreach (XmlNode annot in annotations)
                {
                    XmlElement elm = annot as XmlElement;
                    if (elm.LocalName == NativeAnnotations.NativeType)
                    {
                        string typeName = elm.GetAttribute(NativeAnnotations.NativeName);
                        domType.SetTag(NativeAnnotations.NativeType, GameEngine.GetObjectTypeId(typeName));
                        if (domType.IsAbstract == false)
                        {
                            domType.Define(new ExtensionInfo <NativeObjectAdapter>());
                        }
                    }
                    else if (elm.LocalName == NativeAnnotations.NativeProperty)
                    {
                        // find a prop name and added to the attribute.


                        string nativePropName = elm.GetAttribute(NativeAnnotations.NativeName);
                        string attribName     = elm.GetAttribute(NativeAnnotations.Name);
                        uint   typeId         = (uint)domType.GetTag(NativeAnnotations.NativeType);
                        uint   propId         = GameEngine.GetObjectPropertyId(typeId, nativePropName);
                        if (!string.IsNullOrEmpty(attribName))
                        {
                            AttributeInfo attribInfo = domType.GetAttributeInfo(elm.GetAttribute(NativeAnnotations.Name));
                            attribInfo.SetTag(NativeAnnotations.NativeProperty, propId);
                        }
                        else
                        {
                            NativeAttributeInfo attribInfo = new NativeAttributeInfo(domType, nativePropName, typeId, propId);
                            nativeAttribs.Add(attribInfo);
                        }
                    }
                    else if (elm.LocalName == NativeAnnotations.NativeElement)
                    {
                        ChildInfo info   = domType.GetChildInfo(elm.GetAttribute(NativeAnnotations.Name));
                        uint      typeId = (uint)domType.GetTag(NativeAnnotations.NativeType);
                        string    name   = elm.GetAttribute(NativeAnnotations.NativeName);
                        info.SetTag(NativeAnnotations.NativeElement, GameEngine.GetObjectChildListId(typeId, name));
                    }
                }

                if (nativeAttribs.Count > 0)
                {
                    domType.SetTag(nativeAttribs.ToArray());
                }
            }


            // register BoundableObject
            m_schemaLoader.GameObjectType.Define(new ExtensionInfo <BoundableObject>());
            m_schemaLoader.GameObjectFolderType.Define(new ExtensionInfo <BoundableObject>());

            #region code to handle gameObjectFolder

            {
                // This code is fragile and need to be updated whenever
                // any relevant part of the schema changes.
                // purpose:
                // gameObjectFolderType does not exist in C++
                // this code will map gameObjectFolderType to gameObjectGroupType.
                DomNodeType gobFolderType = m_schemaLoader.GameObjectFolderType;
                DomNodeType groupType     = m_schemaLoader.GameObjectGroupType;

                // map native bound attrib from gameObject to GobFolder
                NativeAttributeInfo[] nativeAttribs = m_schemaLoader.GameObjectType.GetTag <NativeAttributeInfo[]>();
                foreach (var attrib in nativeAttribs)
                {
                    if (attrib.Name == "Bounds")
                    {
                        gobFolderType.SetTag(new NativeAttributeInfo[] { attrib });
                        break;
                    }
                }

                // map type.
                gobFolderType.Define(new ExtensionInfo <NativeObjectAdapter>());
                gobFolderType.SetTag(NativeAnnotations.NativeType, groupType.GetTag(NativeAnnotations.NativeType));

                // map all native attributes of gameObjectGroup to gameFolder
                foreach (AttributeInfo srcAttrib in groupType.Attributes)
                {
                    object nativeIdObject = srcAttrib.GetTag(NativeAnnotations.NativeProperty);
                    if (nativeIdObject == null)
                    {
                        continue;
                    }
                    AttributeInfo destAttrib = gobFolderType.GetAttributeInfo(srcAttrib.Name);
                    if (destAttrib == null)
                    {
                        continue;
                    }
                    destAttrib.SetTag(NativeAnnotations.NativeProperty, nativeIdObject);
                    destAttrib.SetTag(NativeAnnotations.MappedAttribute, srcAttrib);
                }

                // map native element from gameObjectGroupType to gameObjectFolderType.
                object gobsId = groupType.GetChildInfo("gameObject").GetTag(NativeAnnotations.NativeElement);
                foreach (ChildInfo srcChildInfo in gobFolderType.Children)
                {
                    if (srcChildInfo.IsList)
                    {
                        srcChildInfo.SetTag(NativeAnnotations.NativeElement, gobsId);
                    }
                }

                m_schemaLoader.GameType.GetChildInfo("gameObjectFolder").SetTag(NativeAnnotations.NativeElement, gobsId);
            }

            #endregion
        }
예제 #35
0
 AttributeInfo[] ReadAttributes(BigEndianBinaryReader reader)
 {
     /*
         u2 attributes_count;
         attribute_info attributes[attributes_count];
     */
     ushort attributesCount = reader.ReadUInt16();
     AttributeInfo[] attributes = new AttributeInfo[attributesCount];
     if (attributesCount == 0) {
         return attributes;
     }
     for (ushort i = 0; i < attributesCount; i++) {
         /*
             attribute_info {
                 u2 attribute_name_index;
                 u4 attribute_length;
                 u1 info[attribute_length];
             }
         */
         AttributeInfo attr;
         attr.AttributeNameIndex = reader.ReadUInt16();
         attr.Bytes = reader.ReadBytes(reader.ReadUInt32());
         attributes[i] = attr;
     }
     return attributes;
 }
예제 #36
0
 private string CreateKey(DomNode node, AttributeInfo attrib)
 {
     return(string.Format("{0}.{1}", node.GetId(), attrib.Name));
 }
예제 #37
0
 /// <summary>
 /// 添加自定义属性信息
 /// </summary>
 /// <param name="model">自定义属性实体</param>
 /// <returns></returns>
 public static int AddAttribute(AttributeInfo model)
 {
     return(Remoting.RemoteObject().AddAttribute(model));
 }
예제 #38
0
	public static bool GetVector(DomNode domNode, AttributeInfo attribute, out Vec3F result)
    {
      Contract.Requires(domNode != null);
      float[] floats = domNode.GetAttribute(attribute) as float[];
      if (floats != null)
      {
        result = new Vec3F(floats);
        return true;
      }

      result = null;
      return false;
    }
예제 #39
0
 /// <summary>
 /// Validates the given value for assignment to the given attribute</summary>
 /// <param name="value">Value to validate</param>
 /// <param name="info">Attribute info</param>
 /// <returns>True, iff value is valid for the given attribute</returns>
 public abstract bool Validate(object value, AttributeInfo info);
예제 #40
0
 internal object GetAttribute(AttributeInfo attribute)
 {
   throw new System.NotImplementedException();
 }
예제 #41
0
 public void Verify <T>(AttributeInfo info, MatchOp match, T fieldValue)
 {
     query.Verify(info, match, fieldValue);
 }
예제 #42
0
        private void CreateAttribute(TypeInfo ti, Classifier aCls, AttributeInfo aField, PdOOM.BasePackage aPckg)
        {
            CustomHandlerField field = new CustomHandlerField(aField, null);
            if (!field.ThroughProperty)
            {
                PdOOM.Attribute attribute = (PdOOM.Attribute)aCls.CreateObject(0x18112065, "", -1, true);
                if (aField.IsStatic)
                {
                    attribute.Static = true;
                }
                try
                {
                    attribute.Name = attribute.Code = aField.Name;
                }
                catch (COMException)
                {
                    if (LZ.Reverse.Info._bDebug)
                    {
                        LZ.Reverse.Info.Write(new string[] { "*** exception while naming the attribute \"{1}\" on the type \"{0}\"", aField.Code, aField.Name });
                    }
                }
                attribute.Visibility = GetTypeVisibility(aField.Modifier);
                //attribute.Persistent = !aField.IsNotSerialized;
                attribute.Volatile = aField.IsVolatile;
                if (aField.IsPointer)
                {
                    attribute.Multiplicity = "*";
                }
                field.PdObj = attribute;
                field.Convert();

                TypeInfo tiField = new TypeInfo();
                ////System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex("[a-zA-Z_][a-zA-Z_0-9]*");
                ////System.Text.RegularExpressions.Match m = reg.Match(aField.Type.Replace("unsigned",""));
                tiField.Code = tiField.Name = aField.Type;
                tiField.IsClass = true;
                tiField.Comment = aCls.Comment;
                this.AddClassifier(tiField, false);
                bool bCreate = true;
                TypeMapping mapping = TypeMapping.Retrieve(tiField, ref bCreate);
                if (mapping.HasClassifier())
                {
                    PdOOM.NamedObject objClassB = (PdOOM.NamedObject)ProperRef.Link(NamespaceMapping.Retrieve(aPckg), mapping);
                    PdOOM.NamedObject objClassA = (PdOOM.NamedObject)attribute.Parent;
                    attribute.UseQualifiedDataType = false;
                    attribute.DataTypeObject = objClassA;

                    Association ass = (Association)aPckg.CreateObject((int)PdOOM_Classes.cls_Association, "", -1, true);
                    ass.ClassA = objClassA;
                    ass.ClassB = objClassB;
                    try
                    {
                        ass.Name = ass.Code = string.Format("ass_{0}_2_{1}_{2}", objClassA.Code, objClassB.Code, attribute.Code);
                        if (tiField.Code == aField.FullType)
                        {
                            ass.RoleBMultiplicity = "1..1";
                            ass.RoleAIndicator = aField.IsPointer ? "A" : "C";
                        }
                        ass.RoleAMultiplicity = "";
                        ass.RoleBName = aField.Name;
                        ass.RoleANavigability = false;
                        ass.RoleBNavigability = false;
                    }
                    catch (COMException)
                    {
                        if (LZ.Reverse.Info._bDebug)
                        {
                            LZ.Reverse.Info.Write(new string[] { "*** exception while naming the attribute \"{1}\" on the type \"{0}\"", aField.Code, aField.Name });
                        }
                    }

                }
                ////else
                {
                    attribute.DataType = aField.FullType;   // mapping.Name;
                }
            }
        }
예제 #43
0
파일: TestDomNode.cs 프로젝트: brobits/ATF
        public void TestAttributeChangedEvents()
        {
            DomNodeType   type           = new DomNodeType("type");
            AttributeInfo stringTypeInfo = GetStringAttribute("string");
            AttributeInfo intTypeInfo    = GetIntAttribute("int");

            type.Define(stringTypeInfo);
            type.Define(intTypeInfo);
            DomNode test = new DomNode(type);

            test.AttributeChanging += new EventHandler <AttributeEventArgs>(test_AttributeChanging);
            test.AttributeChanged  += new EventHandler <AttributeEventArgs>(test_AttributeChanged);
            AttributeEventArgs expected;

            // test for no value change if setting to the default value and attribute is already the default
            AttributeChangingArgs = null;
            AttributeChangedArgs  = null;
            test.SetAttribute(stringTypeInfo, stringTypeInfo.DefaultValue);
            Assert.Null(AttributeChangingArgs);
            Assert.Null(AttributeChangedArgs);
            test.SetAttribute(intTypeInfo, intTypeInfo.DefaultValue);
            Assert.Null(AttributeChangingArgs);
            Assert.Null(AttributeChangedArgs);

            // test for value change, string type
            test = new DomNode(type);
            test.AttributeChanging += new EventHandler <AttributeEventArgs>(test_AttributeChanging);
            test.AttributeChanged  += new EventHandler <AttributeEventArgs>(test_AttributeChanged);
            AttributeChangingArgs   = null;
            AttributeChangedArgs    = null;
            object oldValue = test.GetAttribute(stringTypeInfo);

            test.SetAttribute(stringTypeInfo, "foo");
            expected = new AttributeEventArgs(test, stringTypeInfo, oldValue, "foo");
            Assert.True(Equals(AttributeChangingArgs, expected));
            Assert.True(Equals(AttributeChangedArgs, expected));

            oldValue = test.GetAttribute(stringTypeInfo);
            test.SetAttribute(stringTypeInfo, "foobar");
            expected = new AttributeEventArgs(test, stringTypeInfo, oldValue, "foobar");
            Assert.True(Equals(AttributeChangingArgs, expected));
            Assert.True(Equals(AttributeChangedArgs, expected));

            // test for value change, int type
            AttributeChangingArgs = null;
            AttributeChangedArgs  = null;
            oldValue = test.GetAttribute(intTypeInfo);
            test.SetAttribute(intTypeInfo, 5);
            expected = new AttributeEventArgs(test, intTypeInfo, oldValue, 5);
            Assert.True(Equals(AttributeChangingArgs, expected));
            Assert.True(Equals(AttributeChangedArgs, expected));

            oldValue = test.GetAttribute(intTypeInfo);
            test.SetAttribute(intTypeInfo, 7);
            expected = new AttributeEventArgs(test, intTypeInfo, oldValue, 7);
            Assert.True(Equals(AttributeChangingArgs, expected));
            Assert.True(Equals(AttributeChangedArgs, expected));

            // test for no value change
            test.SetAttribute(stringTypeInfo, "foo");
            AttributeChangingArgs = null;
            AttributeChangedArgs  = null;
            test.SetAttribute(stringTypeInfo, "foo");
            Assert.Null(AttributeChangingArgs);
            Assert.Null(AttributeChangedArgs);

            test.SetAttribute(intTypeInfo, 9);
            AttributeChangingArgs = null;
            AttributeChangedArgs  = null;
            test.SetAttribute(intTypeInfo, 9);
            Assert.Null(AttributeChangingArgs);
            Assert.Null(AttributeChangedArgs);
        }
예제 #44
0
 public abstract bool UpdateAttributeName(AttributeInfo attribute);
예제 #45
0
 internal float[] GetAttributeFloat(AttributeInfo attribute)
 {
   throw new System.NotImplementedException();
 }
예제 #46
0
 /// <summary>
 /// 创建属性
 /// </summary>
 /// <param name="attributeInfo">属性信息</param>
 /// <param name="attributeGroupInfo">属性组信息</param>
 public static void CreateAttribute(AttributeInfo attributeInfo, AttributeGroupInfo attributeGroupInfo)
 {
     NStore.Data.Categories.CreateAttribute(attributeInfo, attributeGroupInfo.AttrGroupId, attributeGroupInfo.Name, attributeGroupInfo.DisplayOrder);
     //NStore.Core.BMACache.Remove(CacheKeys.MALL_CATEGORY_FILTERAANDVLIST + attributeInfo.CateId);
     NStore.Core.BMACache.Remove(CacheKeys.MALL_CATEGORY_AANDVLISTJSONCACHE + attributeInfo.CateId);
 }
예제 #47
0
 /// <summary>
 /// Constructor</summary>
 /// <param name="node">DomNode holding the reference</param>
 /// <param name="attributeInfo">Reference attribute of node</param>
 /// <param name="value">Persistent string form of the reference</param>
 public XmlNodeReference(DomNode node, AttributeInfo attributeInfo, string value)
 {
     Node = node;
     AttributeInfo = attributeInfo;
     Value = value;
 }
예제 #48
0
 public static bool UpdateAttributeName(AttributeInfo attribute)
 {
     return(new AttributeDao().UpdateAttributeName(attribute));
 }
예제 #49
0
        public void Link()
        {
            GL.LinkProgram(ProgramID);

            Console.WriteLine(GL.GetProgramInfoLog(ProgramID));

            GL.GetProgram(ProgramID, ProgramParameter.ActiveAttributes, out AttributeCount);
            GL.GetProgram(ProgramID, ProgramParameter.ActiveUniforms, out UniformCount);

            for (int i = 0; i < AttributeCount; i++)
            {
                AttributeInfo info = new AttributeInfo();
                int length = 0;

                StringBuilder name = new StringBuilder();

                GL.GetActiveAttrib(ProgramID, i, 256, out length, out info.size, out info.type, name);

                info.name = name.ToString();
                info.address = GL.GetAttribLocation(ProgramID, info.name);
                Attributes.Add(name.ToString(), info);
            }

            for (int i = 0; i < UniformCount; i++)
            {
                UniformInfo info = new UniformInfo();
                int length = 0;

                StringBuilder name = new StringBuilder();

                GL.GetActiveUniform(ProgramID, i, 256, out length, out info.size, out info.type, name);

                info.name = name.ToString();
                Uniforms.Add(name.ToString(), info);
                info.address = GL.GetUniformLocation(ProgramID, info.name);
            }
        }
예제 #50
0
 public static bool AddAttributeName(AttributeInfo attribute)
 {
     return(new AttributeDao().AddAttributeName(attribute) > 0);
 }
예제 #51
0
        private void ProcessAType(ref TypeInfo ti, ref string sModifier, string[] list, bool bIsValueType)
        {
            string word = NextTokenText(list);
            ti = new TypeInfo();
            ti.Name = ti.Code = word;
            word = NextTokenText(list);
            string wordNext = GetTokenText(list, tokenCurrent);


            if (word == ";")
            {
                ti.IsClass = false;
                return;
            }
            ti.IsClass = true;

            ObjectInfo obj = null, objTemp = new ObjectInfo(), paramObj = new ObjectInfo();
            MethordInfo mi = null;
            List<ObjectInfo> paramList = new List<ObjectInfo>();
            AttributeInfo attr = null;
            bool isTypeBody = false, isMethord = false, isOperator = false;
            Stack<int> stack = new Stack<int>();
            stack.Push(0);
            while (stack.Count > 0)
            {
                switch(word)
                {
                    case "operator":
                        ReadMethordBody(list, word);
                        objTemp.Clear();
                        break;
                    case "virtual":
                    case "afx_msg":
                        mi = new MethordInfo();
                        mi.Virtual = word;
                        break;
                    case "private":
                    case "protected":
                    case "public":
                        sModifier = word;
                        break;
                    case ":":
                        if (isTypeBody)
                        {
                            
                        }
                        else
                        {
                            word = NextTokenText(list);
                            ////obj = new ObjectInfo();
                            ////switch (word)
                            ////{
                            ////    case "private":
                            ////    case "protected":
                            ////    case "public":
                            ////        obj.Modifier = word;
                            ////        word = NextTokenText(list);
                            ////        break;
                            ////    default:
                            ////        break;
                            ////}
                            ////obj.Code = word;
                            ////obj.Name = word;
                            ////ti.Parents.Add(obj);
                        }
                        break;
                    case "(":
                        if (mi == null)  mi = new MethordInfo();
                        isMethord = true;
                        paramList.Clear();
                        paramObj.Clear();
                        break;
                    case ")":
                        break;
                    case "}":
                        stack.Pop();
                        break;
                    case "{":
                        if (isTypeBody)
                        {
                            // 这里应该是方法

                            // 方法或属性定义结束
                            if (isMethord)
                            {
                                if (mi != null)
                                {
                                    mi.Store(objTemp);
                                    if (!string.IsNullOrEmpty(paramObj.Code))
                                    {
                                        ObjectInfo param = new ObjectInfo();
                                        param.Store(paramObj);
                                        paramList.Add(param);

                                        if (mi.Parameters == null) mi.Parameters = new List<ObjectInfo>();
                                        mi.Parameters.AddRange(paramList);
                                    }
                                    ti.Methords.Add(mi);
                                }
                            }
                            else
                            {
                                if (!string.IsNullOrEmpty(objTemp.Code))
                                {
                                    attr = new AttributeInfo();
                                    attr.Store(objTemp);
                                    ti.Attributes.Add(attr);
                                }
                            }
                            objTemp.Clear();
                            mi = null;
                            attr = null;
                            isMethord = false;

                            ReadMethordBody(list, word);

                            break;
                        }

                        // 类体定义,方法或属性
                        if (!isTypeBody)
                        {
                            isTypeBody = true;
                        }
                        break;
                    case "DECLARE_DYNCREATE":
                    case "DECLARE_MESSAGE_MAP":
                        // 读取到行尾
                        word = ReadToLineEnd(list);
                        wordNext = GetTokenText(list, tokenCurrent);
                        continue;

                    case ";":
                        // 方法或属性定义结束
                        if (isMethord)
                        {
                            if (mi != null)
                            {
                                mi.Store(objTemp);
                                if (!string.IsNullOrEmpty(paramObj.Code))
                                {
                                    ObjectInfo param = new ObjectInfo();
                                    param.Store(paramObj);
                                    paramList.Add(param);

                                    if (mi.Parameters == null) mi.Parameters = new List<ObjectInfo>();
                                    mi.Parameters.AddRange(paramList);
                                }
                                ti.Methords.Add(mi);
                            }
                        }
                        else
                        {
                            if (!string.IsNullOrEmpty(objTemp.Code))
                            {
                                attr = new AttributeInfo();
                                attr.Store(objTemp);
                                ti.Attributes.Add(attr);
                            }
                        }
                        objTemp.Clear();
                        mi = null;
                        attr = null;
                        isMethord = false;
                        break;
                    case ",":
                        if (isMethord)
                        {
                            if (!string.IsNullOrEmpty(paramObj.Code))
                            {
                                ObjectInfo param = new ObjectInfo();
                                param.Store(paramObj);
                                paramList.Add(param);
                            }
                            paramObj.Clear();
                        }
                        break;
                    default:
                        if (word == ti.Code)
                        {
                            // 构造函数
                            objTemp.Modifier = sModifier;
                            objTemp.Code = objTemp.Name = word;
                        }
                        else if(word == "~" && GetTokenText(list, tokenCurrent.next) == ti.Code)
                        {
                            // 析构函数
                            objTemp.Modifier = sModifier;
                            objTemp.Code = objTemp.Name = word + ti.Code;
                            word = NextTokenText(list);
                        }
                        else
                        {
                            if (string.IsNullOrEmpty(objTemp.Type))
                            {
                                objTemp.Modifier = sModifier;
                                switch (word)
                                {
                                    case "const":
                                        objTemp.IsConst = true;
                                        break;
                                    case "inline":
                                        break;
                                    default:
                                        objTemp.Type = word;
                                        break;
                                }
                            }
                            else if (string.IsNullOrEmpty(objTemp.Code))
                            {
                                switch (word)
                                {
                                    case "*":
                                    case "&":
                                        objTemp.Type += word;
                                        break;
                                    default:
                                        objTemp.Code = objTemp.Name = word;
                                        break;
                                }
                            }
                            else if (isMethord)
                            {
                                // 一般应该为参数

                                if (string.IsNullOrEmpty(paramObj.Type))
                                {
                                    paramObj.Modifier = sModifier;

                                    if (word == "const")
                                    {
                                        paramObj.IsConst = true;
                                    }
                                    else
                                    {
                                        paramObj.Type = word;
                                    }
                                }
                                else if (string.IsNullOrEmpty(paramObj.Code))
                                {
                                    switch(word)
                                    {
                                        case "*":
                                        case "&":
                                            paramObj.Type += word;
                                            break;
                                        default:
                                            paramObj.Code = paramObj.Name = word;
                                            break;
                                    }
                                }
                            }
                        }

                        break;
                }

                if (tokenCurrent.next == null)
                {
                    break;
                }
                word = NextTokenText(list);
                wordNext = GetTokenText(list, tokenCurrent.next);
            }
        }
예제 #52
0
 /// <summary>
 /// Sets the DomNode Value to the given Vec3F</summary>
 /// <param name="domNode">DomNode holding value</param>
 /// <param name="attribute">attribute of the DomNode that contains the data</param>
 /// <param name="v">Vec3F</param>
 public static void SetVector(DomNode domNode, AttributeInfo attribute, Vec3F v)
 {
     domNode.SetAttribute(attribute, v.ToArray());
 }
예제 #53
0
파일: DomTest.cs 프로젝트: zparr/ATF
 public override bool Validate(object value, AttributeInfo info)
 {
     Validated = true;
     return(true);
 }
	// Get the attribute information for a specific ColorAdjustType value.
	private AttributeInfo GetInfo(ColorAdjustType type)
			{
				AttributeInfo current = info;
				while(current != null)
				{
					if(current.type == type)
					{
						return current;
					}
					current = current.next;
				}
				info = new AttributeInfo(info, type);
				return info;
			}
예제 #55
0
 public CustomHandlerField(AttributeInfo aField, PdOOM.Attribute anAttr)
     : base(null, aField.Name, anAttr)
 {
     this._through = false;
     base.ProcessAttrs();
 }
        protected void AddAttribute(String identifier, int size, int divisor = 0, int inputOffset = -1,
            VertexAttribPointerType pointerType = VertexAttribPointerType.Float,
            bool normalize = false)
        {
            if (inputOffset == -1) {
                inputOffset = VertexDataSize;
            }

            AttributeInfo info = new AttributeInfo(this, identifier, size, VertexDataStride,
                divisor, inputOffset - VertexDataSize, pointerType, normalize);

            VertexDataStride += info.Length;
            VertexDataSize += info.Size;
            _attributes.Add(info);

            // Tools.ErrorCheck("addattrib:" + identifier);
        }
예제 #57
0
 /// <summary>
 /// Gets the DomNode attribute as a Vec3F. The attribute must exist on the DomNode.</summary>
 /// <param name="domNode">DomNode holding the attribute</param>
 /// <param name="attribute">attribute of the DomNode that contains the data</param>
 /// <returns>attribute as a Vec3F</returns>
 public static Vec3F GetVector(DomNode domNode, AttributeInfo attribute)
 {
     return(new Vec3F((float[])domNode.GetAttribute(attribute)));
 }
예제 #58
0
 /// <summary>
 /// 修改自定义属性信息
 /// </summary>
 /// <param name="model">自定义属性实体</param>
 /// <returns></returns>
 public static int UpdateAttribute(AttributeInfo model)
 {
     return(Remoting.RemoteObject().UpdateAttribute(model));
 }