Example #1
0
        internal static void FromProject(this CoreGenDescription desc, XilinxProject proj, EPropAssoc assoc)
        {
            PropertyBag pbag = proj.PBag.Copy(assoc);

            if (assoc == EPropAssoc.CoreGenProj)
            {
                string fname = Path.GetFileNameWithoutExtension(desc.Path);
                string wdir  = "./tmp/" + fname + "/";
                pbag.PutProperty(EXilinxProjectProperties.CoreGen_WorkingDirectory, wdir);
            }
            IList <PropDesc> allProps = PropEnum.EnumProps(typeof(EXilinxProjectProperties));

            foreach (PropDesc pd in allProps)
            {
                if (!pd.IDs.ContainsKey(assoc))
                {
                    continue;
                }

                object value = pbag.GetProperty((EXilinxProjectProperties)pd.EnumValue);
                desc.Set(pd.IDs[assoc], PropEnum.ToString(value, assoc), value.GetType());
            }
        }