コード例 #1
0
        private static string ParamCreate(AzMetaCloumEntity azMetaCloum, AzClassCreatProperty classCreatProperty)
        {
            StringBuilder stringBuilder = new StringBuilder();
            MetaDataType  metaDataType  = MetaDataTypeHandle.GetMetaDataType(azMetaCloum.FldType);

            stringBuilder.AddLineStatement("param = new SqlParameter();", 2);
            stringBuilder.AddLineStatement("param.ParameterName = \"@" + azMetaCloum.FldName + "\";", 2);
            if (azMetaCloum.IsOutParam == 0)
            {
                if (azMetaCloum.IsNullable == false)
                {
                    stringBuilder.AddLineStatement($"param.Value={BaseConstants.ParamPer}Item.{azMetaCloum.FldNameTo};", 2);
                }
                else
                {
                    stringBuilder.AddLineStatement($"if ({BaseConstants.ParamPer}Item.{azMetaCloum.FldNameTo}==null)", 2);
                    stringBuilder.AddLineStatement(" {param.Value = System.DBNull.Value;}", 2);
                    stringBuilder.AddLineStatement($"else", 2);
                    stringBuilder.AddLineStatement($"{{ param.Value={BaseConstants.ParamPer}Item.{azMetaCloum.FldNameTo};}};", 2);
                }
            }
            else
            {
                stringBuilder.AddLineStatement("param.Direction = ParameterDirection.Output;}", 2);
            }
            if (metaDataType.CodeSign == 2)
            {
                stringBuilder.AddLineStatement($"param.Size = {azMetaCloum.FldLenCode};", 2);
            }
            stringBuilder.AddLineStatement($"param.SqlDbType = SqlDbType.{metaDataType.DBCodeType};", 2);
            stringBuilder.AddLineStatement("cmd.Parameters.Add(param);", 2);
            stringBuilder.AppendLine();
            return(stringBuilder.ToString());
        }
コード例 #2
0
 private async Task SaveFileTagAsync(string filePath, MetaDataType fieldType, string fieldValue)
 {
     await Task.Factory.StartNew(() =>
     {
         _mbApiInterface.Library_SetFileTag(filePath, fieldType, fieldValue);
     });
 }
コード例 #3
0
        /// <summary>
        /// Allows the search.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <returns></returns>
        private bool AllowSearch(MetaDataType type)
        {
            if (
                type == MetaDataType.BigInt ||
                type == MetaDataType.Decimal ||
                type == MetaDataType.Float ||
                type == MetaDataType.Int ||
                type == MetaDataType.Money ||
                type == MetaDataType.Numeric ||
                type == MetaDataType.SmallInt ||
                type == MetaDataType.SmallMoney ||
                type == MetaDataType.TinyInt ||
                type == MetaDataType.LongHtmlString ||
                type == MetaDataType.LongString ||
                type == MetaDataType.NChar ||
                type == MetaDataType.NText ||
                type == MetaDataType.NVarChar ||
                type == MetaDataType.ShortString ||
                type == MetaDataType.Text ||
                type == MetaDataType.VarChar
                )
            {
                return(true);
            }

            return(false);
        }
コード例 #4
0
        /// <summary>
        /// Handles the SelectedIndexChanged event of the ddlType control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void ddlType_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            chkSaveHistory.Enabled = true;
            try
            {
                MetaDataType mdType = MetaType.Load(MDContext, int.Parse(ddlType.SelectedValue)).MetaDataType;
                chkSaveHistory.Enabled = AllowSaveHistory(mdType);
                InitDataTypeUI(mdType);

                if (!chkSaveHistory.Enabled)
                {
                    chkSaveHistory.Checked   = false;
                    chkMultiLanguage.Checked = false;
                }
            }
            catch
            {
            }

            if (ddlType.SelectedItem.Value == "0")
            {
                chkMultiline.Visible  = true;
                chkEditable.Visible   = true;
                chkAllowNulls.Checked = true;
                chkAllowNulls.Enabled = false;
            }
            else
            {
                chkMultiline.Visible  = false;
                chkEditable.Visible   = false;
                chkAllowNulls.Enabled = true;
            }
        }
コード例 #5
0
ファイル: VlcMedia.cs プロジェクト: kgloveyou/xZune.Vlc
        /// <summary>
        /// 设置媒体的元数据
        /// </summary>
        /// <param name="type">元数据类型</param>
        /// <param name="data">元数据值</param>
        public void SetMeta(MetaDataType type, String data)
        {
            GCHandle handle = GCHandle.Alloc(Encoding.UTF8.GetBytes(data), GCHandleType.Pinned);

            _setMetaFunction.Delegate(InstancePointer, type, handle.AddrOfPinnedObject());
            handle.Free();
        }
コード例 #6
0
ファイル: MetaDataType.cs プロジェクト: BlackLambert/knowdes
        public static string GetName(this MetaDataType type)
        {
            switch (type)
            {
            case MetaDataType.Unset:
                return("Metadatum hinzufügen");

            case MetaDataType.Title:
                return("Titel");

            case MetaDataType.Author:
                return("Autoren");

            case MetaDataType.CreationDate:
                return("Erstellungsdatum");

            case MetaDataType.LastChangedDate:
                return("Änderungsdatum");

            case MetaDataType.Tags:
                return("Schlagwörter");

            case MetaDataType.Comment:
                return("Kommentar");

            case MetaDataType.Description:
                return("Beschreibung");

            case MetaDataType.PreviewImage:
                return("Vorschaubild");

            default:
                throw new NotImplementedException();
            }
        }
コード例 #7
0
        private string ExportLibrary()
        {
            string[] library = null;
            string[] tags    = null;
            mbApi.Library_QueryFilesEx("domain=Library", ref library);
            Array.Sort(library, (x, y) => String.Compare(x, y));

            MetaDataType[] meta = new MetaDataType[] { MetaDataType.TrackTitle, MetaDataType.TrackNo, MetaDataType.DiscNo, MetaDataType.Album, MetaDataType.Year, MetaDataType.AlbumArtist };

            List <string> artists = new List <string>();

            List <Band> bands = new List <Band>();

            foreach (var item in library.Select((value, index) => new { value, index }))
            {
                mbApi.Library_GetFileTags(item.value, meta, ref tags);
                if (artists.Find(c => c == tags[5]) == null)
                {
                    bands.Add(new Band {
                        Artist = tags[5], Albums = GetAlbums(tags[5])
                    });
                    artists.Add(tags[5]);
                }
            }
            return(JsonSerializer.ToJsonString(bands));
        }
コード例 #8
0
        public MetaData CreateNew(MetaDataType type)
        {
            Guid iD = Guid.NewGuid();

            switch (type)
            {
            case MetaDataType.Title:
                return(new TitleData(iD, _defaultTitle));

            case MetaDataType.Author:
                return(new AuthorData(iD));

            case MetaDataType.CreationDate:
                return(new CreationDateData(iD));

            case MetaDataType.LastChangedDate:
                return(new LastChangeDateData(iD));

            case MetaDataType.Tags:
                return(new TagsData(iD));

            case MetaDataType.Comment:
                return(new CommentData(iD, _defaultComment));

            case MetaDataType.Description:
                return(new DescriptionData(iD, _defaultDescription));

            case MetaDataType.PreviewImage:
                return(new PreviewImageData(iD, null));

            default:
                throw new NotImplementedException();
            }
        }
コード例 #9
0
ファイル: MetaDataTable.cs プロジェクト: BlackLambert/knowdes
        private MetaData convertMetaDataFrom(IDataReader reader)
        {
            MetaDataType type = (MetaDataType)Convert.ToInt32(reader[METADATA_TYP]);

            switch (type)
            {
            case MetaDataType.Author:
                return(convertAuthorDataFrom(reader));

            case MetaDataType.CreationDate:
                return(convertCreationDateDataFrom(reader));

            case MetaDataType.LastChangedDate:
                return(convertLastChangedDateDataFrom(reader));

            case MetaDataType.Tags:
                return(convertTagsDataFrom(reader));

            case MetaDataType.Title:
                return(convertTitleDataFrom(reader));

            case MetaDataType.Comment:
                return(convertCommentDataFrom(reader));

            case MetaDataType.Description:
                return(convertDescriptionDataFrom(reader));

            case MetaDataType.PreviewImage:
                return(convertPreviewImageDataFrom(reader));

            default:
                throw new NotImplementedException();
            }
        }
コード例 #10
0
        public int GetElementNidByGID(string elementGID, MetaDataType metadataType)
        {
            int    RetVal        = 0;
            string Query         = string.Empty;
            string NIDColumnName = string.Empty;

            try
            {
                elementGID = DIQueries.RemoveQuotesForSqlQuery(elementGID);

                switch (metadataType)
                {
                case MetaDataType.Indicator:
                    Query         = this.DBQueries.Indicators.GetIndicator(FilterFieldType.GId, "'" + elementGID + "'", FieldSelection.NId);
                    NIDColumnName = Indicator.IndicatorNId;
                    break;

                case MetaDataType.Map:
                    Query         = this.DBQueries.Area.GetAreaMapLayer(DevInfo.Lib.DI_LibDAL.Queries.Area.Select.MapFilterFieldType.LayerName, "'" + elementGID + "'", FieldSelection.NId);
                    NIDColumnName = Area_Map_Layer.LayerNId;
                    break;

                case MetaDataType.Source:
                    Query         = this.DBQueries.Source.GetSource(FilterFieldType.Name, "'" + elementGID + "'", FieldSelection.NId, false);
                    NIDColumnName = IndicatorClassifications.ICNId;
                    break;

                //case MetaDataType.Sector:
                //    break;
                //case MetaDataType.Goal:
                //    break;
                //case MetaDataType.CF:
                //    break;
                //case MetaDataType.Theme:
                //    break;
                //case MetaDataType.Institution:
                //    break;
                //case MetaDataType.Convention:
                //    break;
                //case MetaDataType.IndicatorClassification:
                //    break;
                default:
                    break;
                }

                if (!string.IsNullOrEmpty(Query))
                {
                    foreach (DataRow Row in this.DBConnection.ExecuteDataTable(Query).Rows)
                    {
                        RetVal = Convert.ToInt32(Row[NIDColumnName]);
                        break;
                    }
                }
            }
            catch (Exception)
            {
                RetVal = 0;
            }
            return(RetVal);
        }
コード例 #11
0
        public Type GetType(MetaDataType sourceType)
        {
            Type ret = null;

            switch (sourceType)
            {
            case MetaDataType.Boolean:
                ret = typeof(bool);
                break;

            case MetaDataType.String:
                ret = typeof(string);
                break;

            case MetaDataType.Double:
                ret = typeof(double);
                break;

            case MetaDataType.Long:
                ret = typeof(long);
                break;

            case MetaDataType.Integer:
                ret = typeof(int);
                break;

            case MetaDataType.Date:
                ret = typeof(DateTime);
                break;
            }

            return(ret);
        }
コード例 #12
0
        protected override object ConvertToFile(object value, MetaDataType Dest, string DestFieldName, int RowIndex, out MDPImportWarning[] warnings)
        {
            warnings = null;

            string path = value.ToString();

            try
            {
                using (FileStream fs = File.OpenRead(path))
                {
                    byte[] b = new byte[fs.Length];
                    fs.Read(b, 0, b.Length);

                    Mediachase.MetaDataPlus.MetaFile mf = new MetaFile(Path.GetFileName(path), b);

                    return(mf);
                }
            }
            catch (Exception ex)
            {
                MDPImportWarning w = new MDPImportWarning(RowIndex, ex.Message);
                warnings = new MDPImportWarning[] { w };
                return(null);
            }
        }
コード例 #13
0
        /// <summary>
        /// Returns categories table from database for the given metadata type
        /// </summary>
        /// <param name="metadataType"></param>
        /// <returns></returns>
        private DataTable GetCategoryDataTableFrmDB(MetaDataType metadataType)
        {
            DataTable           RetVal        = null;
            MetadataElementType MDElementType = MetadataElementType.Indicator;
            string ColumnInfo = string.Empty;

            switch (metadataType)
            {
            case MetaDataType.Indicator:
                MDElementType = MetadataElementType.Indicator;
                break;

            case MetaDataType.Map:
                MDElementType = MetadataElementType.Area;
                break;

            case MetaDataType.Source:
                MDElementType = MetadataElementType.Source;
                break;

            default:
                break;
            }


            RetVal = this.DBConnection.ExecuteDataTable(this.DBQueries.Metadata_Category.GetMetadataCategories(FilterFieldType.Type, DIQueries.MetadataElementTypeText[MDElementType]));

            return(RetVal);
        }
コード例 #14
0
 /// <summary>
 /// Creates the specified name.
 /// </summary>
 /// <param name="Name">The name.</param>
 /// <param name="FriendlyName">Name of the friendly.</param>
 /// <param name="Description">The description.</param>
 /// <param name="DataType">Type of the data.</param>
 /// <returns></returns>
 public static MetaField Create(
     string name,
     string friendlyName,
     string description,
     MetaDataType dataType)
 {
     return(MetaField.Create(MetaNamespace.UserRoot, name, friendlyName, description, dataType, 0));
 }
コード例 #15
0
        private void AddMetaFieldToClass(MetaDataContext mdContext, string metaDataNamespace, string metaClassName,
                                         string metaFieldName, MetaDataType type, int length, bool allowNulls, bool cultureSpecific, int optScale = 2, int optPrecision = 18)
        {
            var metaField = CreateMetaField(mdContext, metaDataNamespace, metaFieldName, type, length, allowNulls,
                                            cultureSpecific, optScale, optPrecision);

            JoinField(mdContext, metaField, metaClassName);
        }
コード例 #16
0
        private static MetaField CreateMetaField(MetaDataContext mdContext, string metaDataNamespace, string name,
                                                 MetaDataType type, int length, bool allowNulls, bool cultureSpecific)
        {
            var f = MetaField.Load(mdContext, name) ?? MetaField.Create(mdContext, metaDataNamespace, name, name,
                                                                        string.Empty, type, length, allowNulls, cultureSpecific, false, false);

            return(f);
        }
コード例 #17
0
 /// <summary>
 /// Inits the data type UI.
 /// </summary>
 /// <param name="type">The type.</param>
 private void InitDataTypeUI(MetaDataType type)
 {
     DecimalProperties.Visible = type == MetaDataType.Decimal || type == MetaDataType.Numeric;
     ImageProperties.Visible   = type == MetaDataType.Image || type == MetaDataType.ImageFile;
     DictionaryValues.Visible  = IsDictionaryType(type);
     SearchProperties.Visible  = AllowSearch(type);
     chkIsEncrypted.Visible    = IsEncryptionType(type);
     chkMultiLanguage.Enabled  = type != MetaDataType.File;
 }
コード例 #18
0
        public void SetTileSet(string tileSet)
        {
            scrollOffset = Point.Zero;
            SelectedObject = null;
            SelectedSpriteBounds = InitialTileSize;
            SelectedSpritePosition = null;

            SelectedSpritePath = tileSet;
        }
コード例 #19
0
        public static void DrawPreview(SpriteBatch spriteBatch, Vector2 position, MetaDataType obj)
        {
            if (obj is BlockType)
            {
                var blockType = (BlockType)obj;

                if (blockType.SpritePath != null)
                {
                    spriteBatch.Draw(SimulationGame.ContentManager.Load <Texture2D>(blockType.SpritePath),
                                     position, new Rectangle(blockType.SpritePosition, blockType.SpriteBounds), Color.White, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 1.0f);
                }
            }
            else if (obj is AmbientObjectType)
            {
                var ambientObjectType = (AmbientObjectType)obj;

                if (ambientObjectType.SpritePath != null)
                {
                    var realPosition = new Vector2(position.X - ambientObjectType.SpriteOrigin.X, position.Y - ambientObjectType.SpriteOrigin.Y);

                    spriteBatch.Draw(SimulationGame.ContentManager.Load <Texture2D>(ambientObjectType.SpritePath),
                                     realPosition, new Rectangle(ambientObjectType.SpritePositions[0], ambientObjectType.SpriteBounds), Color.White, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 1.0f);
                }
            }
            else if (obj is AmbientHitableObjectType)
            {
                var ambientHitableObjectType = (AmbientHitableObjectType)obj;

                if (ambientHitableObjectType.SpritePath != null)
                {
                    var realPosition = new Vector2(position.X - ambientHitableObjectType.SpriteOrigin.X, position.Y - ambientHitableObjectType.SpriteOrigin.Y);

                    spriteBatch.Draw(SimulationGame.ContentManager.Load <Texture2D>(ambientHitableObjectType.SpritePath),
                                     realPosition, new Rectangle(ambientHitableObjectType.SpritePositions[0], ambientHitableObjectType.SpriteBounds), Color.White, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 1.0f);
                }
            }
            else if (obj is LivingEntityType)
            {
                var livingEntityType = (LivingEntityType)obj;

                if (livingEntityType.SpritePath != null)
                {
                    var realPosition = new Vector2(position.X - livingEntityType.SpriteOrigin.X, position.Y - livingEntityType.SpriteOrigin.Y);

                    if (livingEntityType.WithGrid)
                    {
                        spriteBatch.Draw(SimulationGame.ContentManager.Load <Texture2D>(livingEntityType.SpritePath),
                                         realPosition, new Rectangle(new Point(livingEntityType.DownAnimation[0].X * livingEntityType.SpriteBounds.X, livingEntityType.DownAnimation[0].Y * livingEntityType.SpriteBounds.Y), livingEntityType.SpriteBounds), Color.White, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 1.0f);
                    }
                    else
                    {
                        spriteBatch.Draw(SimulationGame.ContentManager.Load <Texture2D>(livingEntityType.SpritePath),
                                         realPosition, new Rectangle(livingEntityType.DownAnimation[0], livingEntityType.SpriteBounds), Color.White, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 1.0f);
                    }
                }
            }
        }
コード例 #20
0
        public ActionDescription(string nameSpace)
        {
            var nsValue = nameSpace.Split(".").Last();

            if (Enum.TryParse(nsValue.Substring(0, nsValue.Length - 1), out MetaDataType actionType))
            {
                ActionType = actionType;
            }
            ;
        }
コード例 #21
0
ファイル: RuleItem.cs プロジェクト: 0anion0/IBN
 public RuleItem(string srcColumnName, Type srcColumnType, string destColumnName, MetaDataType destColumnType, bool destColumnSystem, FillTypes fillType, string customValue)
 {
     _srcColumnName = srcColumnName;
     _srcColumnType = srcColumnType;
     _destColumnName = destColumnName;
     _destColumnType = destColumnType;
     _destColumnSystem = destColumnSystem;
     _fillType = fillType;
     _customValue = customValue;
 }
コード例 #22
0
 /// <summary>
 /// Creates the specified name.
 /// </summary>
 /// <param name="Name">The name.</param>
 /// <param name="FriendlyName">Name of the friendly.</param>
 /// <param name="Description">The description.</param>
 /// <param name="DataType">Type of the data.</param>
 /// <param name="Length">The length.</param>
 /// <returns></returns>
 public static MetaField Create(
     string name,
     string friendlyName,
     string description,
     MetaDataType dataType,
     int length)
 {
     return(MetaField.Create(MetaNamespace.UserRoot, name, friendlyName, description, dataType, length,
                             true, false, false, false));
 }
コード例 #23
0
 public MetadataInfo(string metadataNamespace, string metaFieldName, MetaDataType type, int length, bool allowNulls, bool cultureSpecific, List<string> classNames)
 {
     MetadataNamespace = metadataNamespace;
     MetaFieldName = metaFieldName;
     Type = type;
     Length = length;
     AllowNulls = allowNulls;
     CultureSpecific = cultureSpecific;
     ClassNames = classNames;
 }
コード例 #24
0
 public RuleItem(string srcColumnName, Type srcColumnType, string destColumnName, MetaDataType destColumnType, bool destColumnSystem, FillTypes fillType, string customValue)
 {
     _srcColumnName    = srcColumnName;
     _srcColumnType    = srcColumnType;
     _destColumnName   = destColumnName;
     _destColumnType   = destColumnType;
     _destColumnSystem = destColumnSystem;
     _fillType         = fillType;
     _customValue      = customValue;
 }
コード例 #25
0
 public MetadataInfo(string metadataNamespace, string metaFieldName, MetaDataType type, int length, bool allowNulls, bool cultureSpecific, List <string> classNames)
 {
     MetadataNamespace = metadataNamespace;
     MetaFieldName     = metaFieldName;
     Type            = type;
     Length          = length;
     AllowNulls      = allowNulls;
     CultureSpecific = cultureSpecific;
     ClassNames      = classNames;
 }
コード例 #26
0
 public MetaFieldInfo(string name, MetaDataType metaFieldType)
 {
     if (name == null)
     {
         throw new ArgumentNullException(nameof(name));
     }
     Name          = name;
     MetaFieldType = metaFieldType;
     FriendlyName  = name;
 }
コード例 #27
0
 private MetaField GetOrCreateField(
     MetaDataContext mdContext,
     string metaNamespace,
     string fieldName,
     string friendlyName,
     MetaDataType metaDataType = MetaDataType.LongString)
 {
     return(MetaField.Load(mdContext, fieldName) ?? MetaField.Create(mdContext, metaNamespace,
                                                                     fieldName, friendlyName, string.Empty, metaDataType, Int32.MaxValue, true, false, false, false));
 }
コード例 #28
0
 /// <summary>
 /// Creates the specified name.
 /// </summary>
 /// <param name="Name">The name.</param>
 /// <param name="FriendlyName">Name of the friendly.</param>
 /// <param name="Description">The description.</param>
 /// <param name="DataType">Type of the data.</param>
 /// <param name="AllowNulls">if set to <c>true</c> [allow nulls].</param>
 /// <param name="SaveHistory">if set to <c>true</c> [save history].</param>
 /// <param name="AllowSearch">if set to <c>true</c> [allow search].</param>
 /// <returns></returns>
 public static MetaField Create(string name,
                                string friendlyName,
                                string description,
                                MetaDataType dataType,
                                bool allowNulls,
                                bool saveHistory,
                                bool allowSearch)
 {
     return(MetaField.Create(MetaNamespace.UserRoot, name, friendlyName, description, dataType, 0,
                             allowNulls, saveHistory, false, allowSearch));
 }
コード例 #29
0
        /// <summary>
        /// Get MetaDataType based on name
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        private MetaDataType GetMetaDataTypeByName(string name)
        {
            MetaDataType metaData = MetaDataType.Custom16;

            if (Enum.TryParse <MetaDataType>(name, out metaData))
            {
                return(metaData);
            }

            throw new Exception("Value not found in Metadata list: " + name);
        }
コード例 #30
0
        public static string GetCorrectType(AzMetaCloumEntity azMetaCloum)
        {
            MetaDataType metaDataType = MetaDataTypeHandle.GetMetaDataType(azMetaCloum.FldType);
            string       ctype        = metaDataType.CodeType;

            if (azMetaCloum.IsNullable == true)
            {
                ctype = metaDataType.CodeGeneric;
            }

            return(ctype);
        }
コード例 #31
0
        public int AlterMetaField(string metaFieldName, MetaDataType metaDataType, int length)
        {
            var parameters = new []
            {
                new KeyValuePair <string, object>("@TargetType", (int)metaDataType),
                new KeyValuePair <string, object>("@TargetLength", length),
            };

            _logger.Debug($"Altering meta field {metaFieldName} to type {metaDataType} with length {length}");

            return(ExecuteNonQuery(string.Format(_alterMetaFieldType, metaFieldName, metaDataType), parameters));
        }
コード例 #32
0
 /// <summary>
 /// Gets the type id.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <returns></returns>
 private int GetTypeId(MetaDataType type)
 {
     MetaType[] coll = GetMetaTypeList();
     foreach (MetaType t in coll)
     {
         if (t.MetaDataType == type)
         {
             return(t.Id);
         }
     }
     return(-1);
 }
コード例 #33
0
ファイル: RuleItem.cs プロジェクト: 0anion0/IBN
        public RuleItem(string srcColumnName, Type srcColumnType, MetaField destColumn, FillTypes fillType, string customValue)
        {
            if (destColumn == null)
                throw new ArgumentNullException("destColumn");

            _srcColumnName = srcColumnName;
            _srcColumnType = srcColumnType;
            _destColumnName = destColumn.Name;
            _destColumnType = destColumn.DataType;
            _destColumnSystem = destColumn.IsSystem;
            _fillType = fillType;
            _customValue = customValue;
        }
コード例 #34
0
 /// <summary>
 /// Initializes an instance of the MetaDataNode class.
 /// </summary>
 /// <param name="xmlNode">The XML Node describing the Node.</param>
 /// <param name="game">The game object related to the Node.</param>
 public MetaDataNode(XmlNode xmlNode, Game game)
 {
     // meta NMTOKEN #REQUIRED
     // data % entity; #IMPLIED
     // info NMTOKEN #REQUIRED
     // ts NMTOKEN #IMPLIED
     _game = game;
     if (xmlNode.Attributes?["meta"]?.Value == null) { throw new NullReferenceException(); }
     Meta = (MetaDataType)Enum.Parse(typeof(MetaDataType), xmlNode.Attributes?["meta"]?.Value);
     Int32.TryParse(xmlNode.Attributes?["data"]?.Value, out Data);
     Int32.TryParse(xmlNode.Attributes?["info"]?.Value, out Info);
     Ts = xmlNode.Attributes?["ts"]?.Value;
 }
コード例 #35
0
		public Meta_FCDetail()
		{
			m_functionname = String.Empty; 
			m_MetaFcDetailList = new ArrayList(); 
			m_pinname = String.Empty; 
			m_pinindex = new byte(); 
			m_datatype = new MetaDataType(); 
			m_tune = false; 
			m_pintype = String.Empty; 
			m_maxvalue = String.Empty; 
			m_minvalue = String.Empty; 
			m_validvalue = String.Empty; 
			m_defaultvalue = String.Empty; 
			m_required = false; 
			m_description = String.Empty; 
			m_fixed = false; 
			m_pinsignaltype = String.Empty; 
		}
コード例 #36
0
		public Meta_FCDetail(
			bool tune, 
			bool required, 
			bool fixed)
			: this()
		{
			m_functionname = String.Empty;
			m_pinname = String.Empty;
			m_pinindex = null;
			m_datatype = null;
			m_tune = tune;
			m_pintype = String.Empty;
			m_maxvalue = String.Empty;
			m_minvalue = String.Empty;
			m_validvalue = String.Empty;
			m_defaultvalue = String.Empty;
			m_required = required;
			m_description = String.Empty;
			m_fixed = fixed;
			m_pinsignaltype = String.Empty;
		}
コード例 #37
0
        /// <summary>
        /// Returns the instance of MetadataEditorSource for the given element type
        /// </summary>
        /// <param name="elementNid"></param>
        /// <param name="elementType"></param>
        /// <param name="dbConnection"></param>
        /// <param name="dbQueries"></param>
        /// <returns></returns>
        public static MetadataEditorSource CreateInstance(int elementNid, MetaDataType elementType, DIConnection dbConnection, DIQueries dbQueries)
        {
            MetadataEditorSource RetVal = null;

            switch (elementType)
            {
                case MetaDataType.Indicator:
                    RetVal = new IndicatorMetadataEditorSource();
                    RetVal._ImageElementType = "MI";
                    break;

                case MetaDataType.Map:
                    RetVal = new AreaMetadataEditorSource();
                    RetVal._ImageElementType = "MA";
                    break;

                case MetaDataType.Source:
                    RetVal = new DISourceMetadataEditorSource();
                    RetVal._ImageElementType = "MS";
                    break;

                default:
                    RetVal = new ICMetadataEditorSource();
                    RetVal._ImageElementType = string.Empty;
                    RetVal._IsRtfMetadata = true;
                    break;
            }

            // set properties
            if (RetVal != null)
            {
                RetVal.DBConnection = dbConnection;
                RetVal.DBQueries = dbQueries;
            }

            return RetVal;
        }
コード例 #38
0
ファイル: MetaField.cs プロジェクト: 0anion0/IBN
        /// <summary>
        /// Creates the specified name.
        /// </summary>
        /// <param name="Name">The name.</param>
        /// <param name="FriendlyName">Name of the friendly.</param>
        /// <param name="Description">The description.</param>
        /// <param name="DataType">Type of the data.</param>
        /// <returns></returns>
        public static MetaField Create(
			string name,
			string friendlyName,
			string description,
			MetaDataType dataType)
        {
            return MetaField.Create(MetaNamespace.UserRoot, name, friendlyName, description, dataType, 0);
        }
コード例 #39
0
            /// <summary>
            /// Method to generate a list of Sources in a ValuesDataSet
            /// This is done as a separate method since Values can could contain other VariableValue Types
            ///
            /// </summary>
            /// <param name="ds">ValuesDataSet with the values used in the timeSeries</param>
            /// <returns></returns>
            public static List<SourceType> datasetSources(ValuesDataSet ds, string valuesWhereClause)
            {
                /* generate a list
                 * create a distinct DataSet
                 * - new data view
                 * - set filter (no nulls)
                 * - use toTable with unique to get unique list
                 * foreach to generate qualifiers
                 * */
                string COLUMN = "SourceID";
                string TABLENAME = "sources";
                List<SourceType> list = new List<SourceType>();
                try
                {
                    DataView view = new DataView(ds.DataValues);
                    view.RowFilter = valuesWhereClause;

                    DataTable ids = view.ToTable(TABLENAME, true, new string[] {COLUMN});

                    foreach (DataRow r in ids.Rows)
                    {
                        try
                        {
                            //Object aId = r[COLUMN];

                            if (r[COLUMN] == DBNull.Value)
                            {
                                continue;
                            }
                            int? aId = Convert.ToInt32(r[COLUMN]);
                            ValuesDataSet.SourcesRow source = ds.Sources.FindBySourceID((int) aId.Value);
                            if (source != null)
                            {
                                SourceType t = new SourceType();
                                t.sourceID = source.SourceID;
                                t.sourceIDSpecified = true;

                                t.sourceCode = source.SourceID.ToString();

                                if (!String.IsNullOrEmpty(source.Organization)) t.organization = source.Organization;
                                t.sourceDescription = source.SourceDescription;
                                if (!source.IsSourceLinkNull())
                                {
                                    t.sourceLink = new string[] {source.SourceLink};
                                }

                                // create a contact
                                // only one for now
                                ContactInformationType contact = new ContactInformationType();
                                contact.typeOfContact = "main";
                                if (!String.IsNullOrEmpty(source.ContactName)) contact.contactName = source.ContactName;
                                if (!String.IsNullOrEmpty(source.Email))
                                {
                                    contact.email = new string[] {source.Email};
                                }
                                if (!String.IsNullOrEmpty(source.Phone))
                                {
                                    contact.phone = new string[] {source.Phone};
                                }
                                StringBuilder address = new StringBuilder();

                                if (!String.IsNullOrEmpty(source.Address))
                                    address.Append(source.Address + System.Environment.NewLine);
                                if (!String.IsNullOrEmpty(source.City)
                                    && !String.IsNullOrEmpty(source.State)
                                    && !String.IsNullOrEmpty(source.ZipCode))
                                    address.AppendFormat(",{0}, {1} {2}", source.City, source.State, source.ZipCode);

                                contact.address = new string[] {address.ToString()};
                                t.contactInformation = new ContactInformationType[] {contact};

                                if (!String.IsNullOrEmpty(source.Citation))
                                {
                                    t.citation = source.Citation;
                                }

                                if (source.MetadataID != 0 && source.ISOMetadataRow != null)
                                {
                                    MetaDataType m= new MetaDataType();
                                    m.topicCategory = source.ISOMetadataRow.TopicCategory;
                                    m.title = source.ISOMetadataRow.Title;
                                    m.@abstract = source.ISOMetadataRow.Abstract;
                                    m.profileVersion = source.ISOMetadataRow.ProfileVersion;
                                    if (!source.ISOMetadataRow.IsMetadataLinkNull())
                                    {
                                        m.metadataLink = source.ISOMetadataRow.MetadataLink;

                                    }
                                    t.metadata = m;
                                }
                                list.Add(t);
                            }
                        }
                        catch (Exception e)
                        {
                            log.Error("Error generating a qualifier " + r.ToString() + e.Message);
                        }
                    }
                    return list;
                }

                catch (Exception e)
                {
                    log.Error("Error generating a qualifiers " + e.Message);
                    // non fatal exceptions
                    return null;
                }
            }
コード例 #40
0
ファイル: MetaField.cs プロジェクト: 0anion0/IBN
        /// <summary>
        /// Creates the specified name.
        /// </summary>
        /// <param name="Name">The name.</param>
        /// <param name="FriendlyName">Name of the friendly.</param>
        /// <param name="Description">The description.</param>
        /// <param name="DataType">Type of the data.</param>
        /// <param name="AllowNulls">if set to <c>true</c> [allow nulls].</param>
        /// <param name="SaveHistory">if set to <c>true</c> [save history].</param>
        /// <param name="AllowSearch">if set to <c>true</c> [allow search].</param>
        /// <returns></returns>
        public static MetaField Create(string name,
			string friendlyName,
			string description,
			MetaDataType dataType,
			bool allowNulls,
			bool saveHistory,
			bool allowSearch)
        {
            return MetaField.Create(MetaNamespace.UserRoot, name, friendlyName, description, dataType, 0,
                allowNulls, saveHistory, false, allowSearch);
        }
コード例 #41
0
ファイル: MetaField.cs プロジェクト: 0anion0/IBN
        /// <summary>
        /// Creates the specified name.
        /// </summary>
        /// <param name="Name">The name.</param>
        /// <param name="FriendlyName">Name of the friendly.</param>
        /// <param name="Description">The description.</param>
        /// <param name="DataType">Type of the data.</param>
        /// <param name="Length">The length.</param>
        /// <returns></returns>
        public static MetaField Create(
			string name,
			string friendlyName,
			string description,
			MetaDataType dataType,
			int length)
        {
            return MetaField.Create(MetaNamespace.UserRoot, name, friendlyName, description, dataType, length,
                true, false, false, false);
        }
コード例 #42
0
ファイル: MetaType.cs プロジェクト: 0anion0/IBN
 public static MetaType Load(MetaDataType type)
 {
     return MetaType.Load((int)type);
 }
コード例 #43
0
 private MultiTagList getSingleton(MetaDataType type, ref MultiTagList list)
 {
     if (list == null) {
         lock (syncRoot) {
             if (list == null) {
                 list = new MultiTagList(this, type);
             }
         }
     }
     return list;
 }
コード例 #44
0
 public string GetMetaData(MetaDataType dataType)
 {
     var pData = LibVlcMethods.libvlc_media_get_meta(MHMedia, (LibvlcMetaT)dataType);
     return Marshal.PtrToStringAnsi(pData);
 }
コード例 #45
0
ファイル: QMetaLoader.cs プロジェクト: 0anion0/IBN
 protected static DbType MetaDataType2DbType(MetaDataType type)
 {
     switch (type)
     {
         case MetaDataType.BigInt:
             return DbType.Int64;
         case MetaDataType.Binary:
             return DbType.Binary;
         case MetaDataType.Bit:
             return DbType.Boolean;
         case MetaDataType.Char:
             return DbType.String;
         case MetaDataType.DateTime:
             return DbType.DateTime;
         case MetaDataType.Decimal:
             return DbType.Decimal;
         case MetaDataType.Float:
             return DbType.Double;
         case MetaDataType.Image:
             return DbType.Binary;
         case MetaDataType.Int:
             return DbType.Int32;
         case MetaDataType.Money:
             return DbType.Decimal;
         case MetaDataType.NChar:
             return DbType.String;
         case MetaDataType.NText:
             return DbType.String;
         case MetaDataType.NVarChar:
             return DbType.String;
         case MetaDataType.Real:
             return DbType.Single;
         case MetaDataType.UniqueIdentifier:
             return DbType.Guid;
         case MetaDataType.SmallDateTime:
             return DbType.Date;
         case MetaDataType.SmallInt:
             return DbType.Int16;
         case MetaDataType.SmallMoney:
             return DbType.Decimal;
         case MetaDataType.Text:
             return DbType.String;
         case MetaDataType.Timestamp:
             return DbType.Binary;
         case MetaDataType.TinyInt:
             return DbType.Byte;
         case MetaDataType.VarBinary:
             return DbType.Binary;
         case MetaDataType.VarChar:
             return DbType.String;
         case MetaDataType.Variant:
             return DbType.VarNumeric;
         case MetaDataType.Numeric:
             return DbType.VarNumeric;
         case MetaDataType.Sysname:
             return DbType.String;
         // MetaData Types [11/16/2004]
         case MetaDataType.Integer:
             return DbType.Int32;
         case MetaDataType.Boolean:
             return DbType.Boolean;
         case MetaDataType.Date:
             return DbType.DateTime;
         case MetaDataType.Email:
             return DbType.String;
         case MetaDataType.Url:
             return DbType.String;
         case MetaDataType.ShortString:
             return DbType.String;
         case MetaDataType.LongString:
             return DbType.String;
         case MetaDataType.LongHtmlString:
             return DbType.String;
     //				case MetaDataType.DictionarySingleValue:
     //					return DbType.StringFixedLength;
     //				case MetaDataType.DictionaryMultivalue:
     //					return DbType.StringFixedLength;
     //				case MetaDataType.EnumSingleValue:
     //					return DbType.StringFixedLength;
     //				case MetaDataType.EnumMultivalue:
     //					return DbType.StringFixedLength;
     //					//MultiStringValue = 38,
     //				case MetaDataType.File:
     //					return DbType.StringFixedLength;
     //				case MetaDataType.ImageFile:
     //					return DbType.StringFixedLength;
         default:
             throw new NotSupportedException("Unsuported MetaDataType");
     }
 }
コード例 #46
0
        /// <summary>
        /// Returns categories table from database for the given metadata type
        /// </summary>
        /// <param name="metadataType"></param>
        /// <returns></returns>
        private DataTable GetCategoryDataTableFrmDB(MetaDataType metadataType)
        {
            DataTable RetVal = null;
            MetadataElementType MDElementType = MetadataElementType.Indicator;
            string ColumnInfo = string.Empty;

            switch (metadataType)
            {
                case MetaDataType.Indicator:
                    MDElementType = MetadataElementType.Indicator;
                    break;

                case MetaDataType.Map:
                    MDElementType = MetadataElementType.Area;
                    break;

                case MetaDataType.Source:
                    MDElementType = MetadataElementType.Source;
                    break;

                default:
                    break;
            }

            RetVal = this.DBConnection.ExecuteDataTable(this.DBQueries.Metadata_Category.GetMetadataCategories(FilterFieldType.Type, DIQueries.MetadataElementTypeText[MDElementType]));

            return RetVal;
        }
コード例 #47
0
 private MetaField CreateMetaField(MetaDataContext mdContext, string metaDataNamespace, string name, MetaDataType type, int length, bool allowNulls, bool cultureSpecific)
 {
     var f = MetaField.Load(mdContext, name) ??
             MetaField.Create(mdContext, metaDataNamespace, name, name, string.Empty, type, length, allowNulls, cultureSpecific, false, false);
     return f;
 }
コード例 #48
0
        ///// <summary>
        ///// Removes categories from collection.
        ///// </summary>
        //public void RemoveCategoriesFromCollection()
        //{
        //    this.UpdatedCategories.Clear();
        //}
        /// <summary>
        /// Update category in metadata in database.
        /// </summary>
        /// <param name="oldCategories"></param>
        public void UpdateCategoryInMetadataIntoDB(Dictionary<int, string> oldCategories, MetaDataType mdType)
        {
            DataTable Table = null;
            MetadataInfo MetadataInfoObject = null;
            MetadataElementType MDElementType = MetadataElementType.Indicator;
            string MetadataColumnName = string.Empty;
            string MetadataString = string.Empty;
            string ElementNidColumnName = string.Empty;
            int ElementNid = 0;
            string MetadataText = string.Empty;
            DataTable CategoryTable;

            MetaDataBuilder MDBuilder = new MetaDataBuilder(this.DBConnection, this.DBQueries);

            // 1. get category table order by category_order
            CategoryTable = this.GetCategoryDataTableFrmDB(mdType);

            // 2. Get indicators/Area/Source from database where metadata text is not null or empty
            switch (mdType)
            {

                case MetaDataType.Indicator:
                    MDElementType = MetadataElementType.Indicator;
                    MetadataColumnName = DIColumns.Indicator.IndicatorInfo;
                    ElementNidColumnName = DIColumns.Indicator.IndicatorNId;

                    Table = this.DBConnection.ExecuteDataTable(this.DBQueries.Indicators.GetIndicator(FilterFieldType.None, String.Empty, FieldSelection.Heavy));
                    break;

                case MetaDataType.Map:
                    MDElementType = MetadataElementType.Area;
                    MetadataColumnName = DIColumns.Area_Map_Metadata.MetadataText;
                    ElementNidColumnName = DIColumns.Area_Map_Metadata.MetadataNId;

                    Table = this.DBConnection.ExecuteDataTable(this.DBQueries.Area.GetAreaMapMetadata(string.Empty));
                    break;

                case MetaDataType.Source:
                    MDElementType = MetadataElementType.Source;
                    MetadataColumnName = DIColumns.IndicatorClassifications.ICInfo;
                    ElementNidColumnName = DIColumns.IndicatorClassifications.ICNId;

                    Table = this.DBConnection.ExecuteDataTable(this.DBQueries.IndicatorClassification.GetIC(FilterFieldType.None, string.Empty, ICType.Source, FieldSelection.Heavy));
                    break;

                default:
                    break;
            }

            // update metedata into database
            foreach (DataRow IndicatorRow in Table.Rows)
            {
                // get metadata from row
                MetadataString = Convert.ToString(IndicatorRow[MetadataColumnName]);
                if (string.IsNullOrEmpty(MetadataString))
                {

                    XmlDocument XmlDoc = new XmlDocument();
                    DevInfo.Lib.DI_LibBAL.Metadata.MetadataConverter.InsertRootNode(XmlDoc);
                    MetadataString = XmlDoc.InnerXml;
                }
                //--check metadata string.
                if (!string.IsNullOrEmpty(MetadataString))
                {

                    // get metadataInfo object from metadata text
                    MetadataInfoObject = this.GetMetadataInfoFrmMetadataText(MetadataString, MDElementType);

                    if (MetadataInfoObject != null)
                    {

                        //-- update metadata categories into indicator metadataInfo object
                        MetadataInfoObject = this.UpdateCategryInMetadataInfo(MetadataInfoObject, oldCategories, CategoryTable);

                        ElementNid = Convert.ToInt32(IndicatorRow[ElementNidColumnName]);

                        // get new metadata text and update it into database
                        MetadataText = this.GetNewMetadataText(MetadataInfoObject);

                        MDBuilder.UpdateMetadataInfo(mdType, string.Empty, ElementNid, MetadataText);

                        #region"-- to be deleted --"
                        //switch (mdType)
                        //{
                        //    //-if Indicator
                        //    case MetaDataType.Indicator:
                        //        MetadataInfoObject = this.UpdateCategryInMetadataInfo(MetadataInfoObject, oldCategories, DIQueries.MetadataElementTypeText[MetadataElementType.Indicator]);
                        //        ElementNid = Convert.ToInt32(IndicatorRow[DIColumns.Indicator.IndicatorNId]);
                        //        MetadataText = this.GetNewMetadataText(MetadataInfoObject);
                        //        this.SaveMetadataIntoDatabase(MetaDataType.Indicator, ElementNid, MetadataText);
                        //        break;

                        //    //-If map
                        //    case MetaDataType.Map:
                        //        MetadataInfoObject = this.UpdateCategryInMetadataInfo(MetadataInfoObject, oldCategories, DIQueries.MetadataElementTypeText[MetadataElementType.Area]);
                        //        ElementNid = Convert.ToInt32(IndicatorRow[DIColumns.Area_Map_Metadata .MetadataNId ]);
                        //        MetadataText = this.GetNewMetadataText(MetadataInfoObject);
                        //        this.SaveMetadataIntoDatabase(MetaDataType.Map, ElementNid, MetadataText);
                        //        break;

                        //    //-If source.
                        //    case MetaDataType.Source:
                        //        MetadataInfoObject = this.UpdateCategryInMetadataInfo(MetadataInfoObject, oldCategories, DIQueries.MetadataElementTypeText[MetadataElementType.Source]);
                        //        ElementNid = Convert.ToInt32(IndicatorRow[DIColumns.IndicatorClassifications.ICNId]);
                        //        MetadataText = this.GetNewMetadataText(MetadataInfoObject);
                        //        this.SaveMetadataIntoDatabase(MetaDataType.Source, ElementNid, MetadataText);
                        //        break;
                        //    default:
                        //        break;
                        //}
                        #endregion
                    }

                    //else

                    ////--save metadata into database.
                    //{
                    //    switch (mdType)
                    //    {
                    //        case MetaDataType.Indicator:
                    //            ElementNid = Convert.ToInt32(IndicatorRow[DIColumns.Indicator.IndicatorNId]);
                    //            MetadataText = "";
                    //            this.SaveMetadataIntoDatabase(MetaDataType.Indicator, ElementNid, MetadataText);
                    //            break;
                    //        case MetaDataType.Map:
                    //            ElementNid = Convert.ToInt32(IndicatorRow[DIColumns .Area_Map_Metadata.MetadataNId]);
                    //            MetadataText = "";
                    //            this.SaveMetadataIntoDatabase(MetaDataType.Map, ElementNid, MetadataText);
                    //            break;
                    //        case MetaDataType.Source:
                    //            ElementNid = Convert.ToInt32(IndicatorRow[DIColumns .IndicatorClassifications .ICNId ]);
                    //            MetadataText = "";
                    //            this.SaveMetadataIntoDatabase(MetaDataType.Source, ElementNid, MetadataText);
                    //            break;
                    //        default:
                    //            break;
                    //    }
                    //}
                }
            }
        }
コード例 #49
0
        /// <summary>
        /// Returns true/false.True after successfully updation of xml text into database for the given element nid
        /// </summary>
        /// <param name="xmlText"></param>
        /// <param name="elementNid"></param>
        /// <returns></returns>
        public bool SaveMetadataTextIntoDB(string xmlText, int elementNid,MetaDataType elementType)
        {
            bool RetVal = false;
            MetaDataBuilder MetadataBuilderObj = new MetaDataBuilder(this.DBConnection, this.DBQueries);

            try
            {
                // update xml text into database
                MetadataBuilderObj.UpdateMetadataInfo(elementType, string.Empty, elementNid, xmlText);

                RetVal = true;
            }
            catch (Exception ex)
            {
                RetVal = false;
                ExceptionFacade.ThrowException(ex);
            }

            return RetVal;
        }
コード例 #50
0
ファイル: Event.cs プロジェクト: mono/heap-shot
        public readonly long Pointer; // pointer of the metadata type depending on mtype

        #endregion Fields

        #region Constructors

        MetadataEvent(LogFileReader reader, byte extendedInfo)
        {
            TimeDiff = reader.ReadULeb128 ();
            MType = (MetaDataType)reader.ReadByte ();
            Pointer = reader.ReadSLeb128 ();
            switch (MType) {
            case MetaDataType.Class:
                Image = reader.ReadSLeb128 ();
                Flags = reader.ReadULeb128 ();
                Name = reader.ReadNullTerminatedString ();
                break;
            case MetaDataType.Image:
                Flags = reader.ReadULeb128 ();
                Name = reader.ReadNullTerminatedString ();
                break;
            case MetaDataType.Assembly:
                Flags = reader.ReadULeb128 ();
                Name = reader.ReadNullTerminatedString ();
                break;
            case MetaDataType.Thread:
                Flags = reader.ReadULeb128 ();
                if (reader.Header.Format < 11 || (reader.Header.Format > 10 && extendedInfo == 0)) {
                    Name = reader.ReadNullTerminatedString ();
                }
                break;
            case MetaDataType.Domain:
                Flags = reader.ReadULeb128 ();
                if (extendedInfo == 0)
                    Name = reader.ReadNullTerminatedString ();
                break;
            case MetaDataType.Context:
                Flags = reader.ReadULeb128 ();
                Domain = reader.ReadSLeb128 ();
                break;
            default:
                throw new ArgumentException ("Unknown metadata type: " + MType);
            }
        }
コード例 #51
0
 public string GetMetaData(MetaDataType dataType)
 {
    return LibVlcMethods.libvlc_media_get_meta(m_hMedia, (libvlc_meta_t)dataType);
 }
コード例 #52
0
ファイル: MetaField.cs プロジェクト: 0anion0/IBN
        /// <summary>
        /// Creates the virtual.
        /// </summary>
        /// <param name="metaNamespace">The namespace.</param>
        /// <param name="name">The name.</param>
        /// <param name="friendlyName">Name of the friendly.</param>
        /// <param name="description">The description.</param>
        /// <param name="dataType">Type of the data.</param>
        /// <param name="length">The length.</param>
        /// <param name="allowNulls">if set to <c>true</c> [allow nulls].</param>
        /// <param name="saveHistory">if set to <c>true</c> [save history].</param>
        /// <param name="multilanguageValue">if set to <c>true</c> [multi language value].</param>
        /// <param name="allowSearch">if set to <c>true</c> [allow search].</param>
        /// <returns></returns>
        public static MetaField CreateVirtual(
			string metaNamespace,
			string name,
			string friendlyName,
			string description,
			MetaDataType dataType,
			int length,
			bool allowNulls,
			bool saveHistory,
			bool multilanguageValue,
			bool allowSearch)
        {
            #region ArgumentNullExceptions
            if (metaNamespace == null)
                throw new ArgumentNullException("Namespace", AsyncResources.GetConstantValue("ARG_NULL_ERR_MSG"));
            if (name == null)
                throw new ArgumentNullException("Name", AsyncResources.GetConstantValue("ARG_NULL_ERR_MSG"));
            if (friendlyName == null)
                throw new ArgumentNullException("FriendlyName", AsyncResources.GetConstantValue("ARG_NULL_ERR_MSG"));
            #endregion

            MetaField retVal = new MetaField();

            // Load MetaField Information [11/18/2004]
            retVal._id = -1;
            retVal._namespace = metaNamespace;
            retVal._name = name;
            retVal._friendlyName = friendlyName;

            retVal._description = description;

            retVal._dataType = dataType;
            retVal._length = length;

            retVal._allowNulls = allowNulls;
            retVal._saveHistory = saveHistory;
            retVal._multilanguageValue = multilanguageValue;
            retVal._allowSearch = allowSearch;

            retVal._systemMetaClassId = -1;

            return retVal;
        }
コード例 #53
0
 public void SetMetaData(MetaDataType dataType, string argument)
 {
    LibVlcMethods.libvlc_media_set_meta(m_hMedia, (libvlc_meta_t)dataType, argument.ToUtf8());
 }
コード例 #54
0
ファイル: MetaField.cs プロジェクト: 0anion0/IBN
        /// <summary>
        /// Creates the specified namespace.
        /// </summary>
        /// <param name="metaNamespace">The namespace.</param>
        /// <param name="name">The name.</param>
        /// <param name="friendlyName">Name of the friendly.</param>
        /// <param name="description">The description.</param>
        /// <param name="dataType">Type of the data.</param>
        /// <param name="length">The length.</param>
        /// <param name="allowNulls">if set to <c>true</c> [allow nulls].</param>
        /// <param name="saveHistory">if set to <c>true</c> [save history].</param>
        /// <param name="multilanguageValue">if set to <c>true</c> [multilanguage value].</param>
        /// <param name="allowSearch">if set to <c>true</c> [allow search].</param>
        /// <returns></returns>
        public static MetaField Create(
			string metaNamespace,
			string name,
			string friendlyName,
			string description,
			MetaDataType dataType,
			int length,
			bool allowNulls,
			bool saveHistory,
			bool multilanguageValue,
			bool allowSearch)
        {
            #region ArgumentNullExceptions
            if (metaNamespace == null)
                throw new ArgumentNullException("Namespace", AsyncResources.GetConstantValue("ARG_NULL_ERR_MSG"));
            if (name == null)
                throw new ArgumentNullException("Name", AsyncResources.GetConstantValue("ARG_NULL_ERR_MSG"));
            if (friendlyName == null)
                throw new ArgumentNullException("FriendlyName", AsyncResources.GetConstantValue("ARG_NULL_ERR_MSG"));
            #endregion

            SqlParameter Retval = new SqlParameter("@Retval", SqlDbType.Int, 4);
            Retval.Direction = ParameterDirection.Output;

            SqlHelper.ExecuteNonQuery(MetaDataContext.Current, CommandType.StoredProcedure, AsyncResources.GetConstantValue("SP_AddMetaField"),
                                        new SqlParameter("@Namespace", metaNamespace),
                                       new SqlParameter("@Name", name),
                                       new SqlParameter("@FriendlyName", friendlyName),
                                       new SqlParameter("@Description", description),
                                       new SqlParameter("@DataTypeId", (int)dataType),
                                       new SqlParameter("@Length", length),
                                       new SqlParameter("@AllowNulls", allowNulls),
                                       new SqlParameter("@SaveHistory", saveHistory),
                //new SqlParameter("@MultiLanguageValue", multilanguageValue),
                                       new SqlParameter("@AllowSearch", allowSearch),
                                       Retval
                                  );

            return MetaField.Load((int)Retval.Value);
        }
コード例 #55
0
ファイル: MappingMetaClass.cs プロジェクト: 0anion0/IBN
 public MetaObjectResolverEventArgs(object value, string destFieldName, MetaDataType destType)
 {
     _value = value;
     _destFieldName = destFieldName;
     _destType = destType;
 }
コード例 #56
0
        /// <summary>
        /// Get Metadata from Excel File
        /// </summary>
        /// <remarks>
        /// This method will Extract Metadata from excel file and make a string Containing Matadata in Xml Format .
        /// So this can  be stored in database
        /// </remarks>
        public String GetMetadataFromExcelFile(string excelFilePath, MetaDataType elementType, string fldrMetadataTemplatePath)
        {
            // Step 1 : Open Excel File for reading
            // Step2 : Get Mask and blank Metadata xml file from metadata template Folder
            // Step3 : Update Blank Metadata file from  metadata found in excel file. Metadata will be inserted in xml using
            // Position and path definded in Mask file.

            string RetVal = String.Empty;

            //Step1.  Open excel File
            // Open excel and get first worksheet
            this.DiExcel = new DIExcel(excelFilePath);
            MetadataSheet = DiExcel.GetWorksheet(0);

            // Matadata starts from 5th Row
            //this._MetadataStartRowIndexInExl = 4;

            // step2: Get Mask and blank xml file from Metadata Template Folder
            /////GetMetadataTemplateFilesForImport(elementType, fldrMetadataTemplatePath);

            // Step3: Update metadata blank document using metadata found in metadata excel.
            // Import will be done using Mask File. So check for Mask file
            //if (this._MetadataMaskFilePath.Length > 0 && File.Exists(this._MetadataMaskFilePath))
            //{

            //    if (this._MetadataFilePath.Length > 0 && File.Exists(this._MetadataFilePath))
            //    {
            //        int i = 0;
            //        XmlNode xn = null;
            //        XmlNodeList xnList = null;
            //        try
            //        {
            //            int temp = 0;

            //            // Load Blank xml Structure  as Metadata file
            //            MetadataDOM = new XmlDocument();
            //            MetadataDOM.Load(this._MetadataFilePath);

            //            // Load Mask File
            //            MetadataMaskDOM.Load(this._MetadataMaskFilePath);

            //            // Iterate all child elements of mask file.
            //            for (i = 0; i < MetadataMaskDOM.DocumentElement.ChildNodes.Count; i++)
            //            {
            //                try
            //                {
            //                    // Get Position and path information for Metadata
            //                    string[] nodes = MetadataMaskDOM.DocumentElement.ChildNodes[i].SelectNodes("Path")[0].InnerXml.Split('/');
            //                    string[] position = MetadataMaskDOM.DocumentElement.ChildNodes[i].SelectNodes("Position")[0].InnerXml.Split('/');

            //                    if (position.Length < 1)
            //                    {
            //                    }
            //                    else if (position.Length == 1)
            //                    {
            //                        if (MetadataMaskDOM.DocumentElement.ChildNodes[i].SelectNodes("Type")[0].InnerXml == "Element")
            //                        {
            //                            //dom.DocumentElement.InnerXml = this.rtbDataValue[temp].Text;
            //                            MetadataDOM.DocumentElement.InnerXml = this.DiExcel.GetCellValue(0, this._MetadataStartRowIndexInExl + temp, 1, this._MetadataStartRowIndexInExl + temp, 1);
            //                            temp++;
            //                        }
            //                        else if (MetadataMaskDOM.DocumentElement.ChildNodes[i].SelectNodes("Type")[0].InnerXml == "Attribute")
            //                        {
            //                            //dom.DocumentElement.Attributes.GetNamedItem(nodes[nodes.Length - 1]).Value = this.rtbDataValue[temp].Text;
            //                            MetadataDOM.DocumentElement.InnerXml = this.DiExcel.GetCellValue(0, this._MetadataStartRowIndexInExl + temp, 1, this._MetadataStartRowIndexInExl + temp, 1);
            //                            temp++;
            //                        }
            //                    }

            //                    else if (position.Length >= 2)
            //                    {
            //                        // Get the postion of n is postion array
            //                        int npos = position.Length;
            //                        //--check which position has the n
            //                        for (int l = 1; l < position.Length; l++)
            //                        {
            //                            if (position[l] == "n")
            //                            {
            //                                npos = l;
            //                                break;
            //                            }
            //                        }

            //                        // Select Root Node Like "Indicator_Info"
            //                        // Xnlist contain list of all node under rootNode like indicator_Info
            //                        xnList = MetadataDOM.DocumentElement.SelectNodes(nodes[1]);

            //                        xnList = MetadataDOM.DocumentElement.SelectNodes(nodes[1]);

            //                        // Handling for second Postion
            //                        // If n is not at second Postion then then  start from  node  first child under Indicator_Info(Document Element)
            //                        if (position[1] != "n")
            //                        {
            //                            xn = xnList[Convert.ToInt32(position[1]) - 1];
            //                        }
            //                        else
            //                        {
            //                            xn = MetadataDOM.DocumentElement;
            //                        }

            //                        // Iterate inside this node. till we reach at n postion
            //                        //--get the value of xn till the nth position
            //                        if (MetadataMaskDOM.DocumentElement.ChildNodes[i].SelectNodes("Type")[0].InnerXml == "Element")
            //                        {
            //                            for (int j = 2; j < npos; j++)
            //                            {
            //                                XmlNodeList xnTempList;
            //                                // Getting List of all child nodes .
            //                                // If our path nodes array contain Indicator_Info,Row1,FLD_VAL,ROWData,temp1
            //                                //In First Iteration we selcted all Fld_Val node under Row1
            //                                // In SEcond Iteration  we select AllRowDAta node under FLD_Val
            //                                // Continue until j=  postion of n .So we have all nodes inside nodelist for which n is applied
            //                                xnTempList = xn.SelectNodes(nodes[j]);
            //                                xn = xnTempList[Convert.ToInt32(position[j]) - 1];
            //                            }
            //                            // Insert  metadata value
            //                            if (npos == position.Length)
            //                            {
            //                                //xn.InnerXml = this.rtbDataValue[temp].Text;
            //                                xn.InnerXml = this.DiExcel.GetCellValue(0, this._MetadataStartRowIndexInExl + temp, 1, this._MetadataStartRowIndexInExl + temp, 1);
            //                                temp++;
            //                            }
            //                        }
            //                        else if (MetadataMaskDOM.DocumentElement.ChildNodes[i].SelectNodes("Type")[0].InnerXml == "Attribute")
            //                        {
            //                            for (int j = 2; j < npos - 1; j++)
            //                            {
            //                                XmlNodeList xnTempList;
            //                                xnTempList = xn.SelectNodes(nodes[j]);
            //                                xn = xnTempList[Convert.ToInt32(position[j]) - 1];
            //                            }
            //                            if (npos == position.Length)
            //                            {
            //                                xn.Attributes.GetNamedItem(nodes[nodes.Length - 1]).Value = this.DiExcel.GetCellValue(0, this._MetadataStartRowIndexInExl + temp, 1, this._MetadataStartRowIndexInExl + temp, 1);
            //                                temp++;
            //                            }
            //                        }

            //                        //--get the value of the nodes from the nth position
            //                        if (npos < position.Length)
            //                        {
            //                            // Get all row data for which we have n in  position
            //                            xnList = xn.SelectNodes(nodes[npos]);
            //                            //xnlist is value for total no of metadata paragraph required
            //                            for (int o = 0; o < xnList.Count; o++)
            //                            {
            //                                try
            //                                {
            //                                    xn = xnList[o];
            //                                    if (MetadataMaskDOM.DocumentElement.ChildNodes[i].SelectNodes("Type")[0].InnerXml == "Element")
            //                                    {
            //                                        // Handling for after n node
            //                                        for (int j = npos + 1; j < nodes.Length; j++)
            //                                        {
            //                                            XmlNodeList xnTempList;
            //                                            xnTempList = xn.SelectNodes(nodes[j]);
            //                                            xn = xnTempList[Convert.ToInt32(position[j]) - 1];
            //                                        }

            //                                        // Get Value of each metadata
            //                                        // xn.InnerXml = SetCharacterEntities(this.rtbDataValue[temp].Text);
            //                                        xn.InnerXml = SetCharacterEntities(this.DiExcel.GetCellValue(0, this._MetadataStartRowIndexInExl + temp, 1, this._MetadataStartRowIndexInExl + temp, 1).ToString());

            //                                        temp++;
            //                                    }
            //                                    else if (MetadataMaskDOM.DocumentElement.ChildNodes[i].SelectNodes("Type")[0].InnerXml == "Attribute")
            //                                    {
            //                                        for (int j = npos + 1; j < nodes.Length - 1; j++)
            //                                        {
            //                                            XmlNodeList xnTempList;
            //                                            xnTempList = xn.SelectNodes(nodes[j]);
            //                                            xn = xnTempList[Convert.ToInt32(position[j]) - 1];
            //                                        }

            //                                        //xn.Attributes.GetNamedItem(nodes[nodes.Length - 1]).Value = SetCharacterEntities(this.rtbDataValue[temp].Text);
            //                                        xn.Attributes.GetNamedItem(nodes[nodes.Length - 1]).Value = SetCharacterEntities(this.DiExcel.GetCellValue(0, this._MetadataStartRowIndexInExl + temp, 1, this._MetadataStartRowIndexInExl + temp, 1).ToString());
            //                                        temp++;
            //                                    }
            //                                }
            //                                catch (Exception ex)
            //                                {
            //                                }
            //                            }
            //                        }
            //                    }
            //                }
            //                catch (Exception ex)
            //                {
            //                }
            //            }
            //            // Get Metadata Text in RetVal
            //            RetVal = MetadataDOM.InnerXml; //MetadataDOM.Save(xmlFile);
            //            DiExcel.Close();

            //        }
            //        catch (Exception ex)
            //        {
            //            RetVal = String.Empty;
            //            DiExcel.Close();
            //        }
            //    }
            //}
            return RetVal;
        }
コード例 #57
0
ファイル: MediaFromFile.cs プロジェクト: kaiiak/NineSky
 public string GetMetaData(MetaDataType dataType)
 {
     IntPtr pData = LibVlcMethods.libvlc_media_get_meta(m_hMedia, (libvlc_meta_t)dataType);
     return Marshal.PtrToStringAnsi(pData);
 }
コード例 #58
0
 public string this[MetaDataType tag]
 {
     get { return MB.Library_GetFileTag(uri.OriginalString, tag); }
     set { MB.Library_SetFileTag(uri.OriginalString, tag, value); }
 }
コード例 #59
0
ファイル: Event.cs プロジェクト: facemao3/heap-shot
        public readonly long Pointer; // pointer of the metadata type depending on mtype

        #endregion Fields

        #region Constructors

        MetadataEvent(LogFileReader reader)
        {
            TimeDiff = reader.ReadULeb128 ();
            MType = (MetaDataType)reader.ReadByte ();
            Pointer = reader.ReadSLeb128 ();
            switch (MType) {
            case MetaDataType.Class:
                Image = reader.ReadSLeb128 ();
                Flags = reader.ReadULeb128 ();
                Name = reader.ReadNullTerminatedString ();
                break;
            case MetaDataType.Image:
                Flags = reader.ReadULeb128 ();
                Name = reader.ReadNullTerminatedString ();
                break;
            case MetaDataType.Thread:
                Flags = reader.ReadULeb128 ();
                Name = reader.ReadNullTerminatedString ();
                break;
            }
        }
コード例 #60
0
ファイル: Program.cs プロジェクト: miktemk/VidkaEditor
 private void UpdateMetadataFilename(string filenameMetaOld, string filenameMetaNew, string mediaFile, MetaDataType type)
 {
     if (!File.Exists(filenameMetaNew))
     {
         if (File.Exists(filenameMetaOld))
         {
             cxzxc("Renamed: " + filenameMetaOld + " -> " + filenameMetaNew);
             System.IO.File.Move(filenameMetaOld, filenameMetaNew);
         }
         else
             cxzxc("!!! No meta for " + mediaFile + " (" + type.ToString() + ")");
     }
     else
         cxzxc("ALREADY EXISTS " + filenameMetaNew);
 }