コード例 #1
0
        private void LoadXamlSourcesForAssembly(Assembly assembly)
        {
            var names = assembly.GetManifestResourceNames();
            foreach (var name in names)
            {
                if (name.Contains("PresentationFramework"))
                {
                    continue;
                }

                var stream = assembly.GetManifestResourceStream(name);
                foreach (Resource resource in new ResourceReader(stream))
                {
                    if (resource.Name.EndsWith("baml"))
                    {
                        string xaml = new BamlTranslator((Stream)resource.Value).ToString();
                        string sourceName = resource.Name.Replace(".baml", "");
                        ParseXamlSource(sourceName, xaml);
                    }
                }
            }
        }
コード例 #2
0
 public void Remove(BamlTranslator.Property value)
 {
     this.list.Remove(value);
 }
コード例 #3
0
 public PropertyDeclaration(string name, BamlTranslator.TypeDeclaration declaringType)
 {
     this.name = name;
     this.declaringType = declaringType;
 }
コード例 #4
0
 // Methods
 public Property(BamlTranslator.PropertyType propertyType)
 {
     this.propertyType = propertyType;
 }
コード例 #5
0
 // Methods
 public void Add(BamlTranslator.Property value)
 {
     this.list.Add(value);
 }
コード例 #6
0
 private static double ReadPathDouble(BamlTranslator.BamlBinaryReader reader, bool isInt)
 {
     if (isInt)
     {
         return (reader.ReadInt32() * 1E-06);
     }
     return reader.ReadCompressedDouble();
 }
コード例 #7
0
 private static void AddPathPoint(BamlTranslator.BamlBinaryReader reader, StringBuilder sb, bool flag1, bool flag2)
 {
     sb.AppendFormat("{0},{1} ", ReadPathDouble(reader, flag1), ReadPathDouble(reader, flag2));
 }
コード例 #8
0
 private static void AddPathPoint(BamlTranslator.BamlBinaryReader reader, StringBuilder sb)
 {
     sb.AppendFormat("{0},{1} ", reader.ReadCompressedDouble(), reader.ReadCompressedDouble());
 }
コード例 #9
0
            internal static object ParseStreamGeometry(BamlTranslator.BamlBinaryReader reader)
            {
                byte num;
                StringBuilder sb = new StringBuilder();
                bool flag = false;
                char lastCommandChar = '\0';
                Label_000A:
                num = reader.ReadByte();
                bool flag2 = (num & 0x10) == 0x10;
                bool flag3 = (num & 0x20) == 0x20;
                bool flag4 = (num & 0x40) == 0x40;
                bool flag5 = (num & 0x80) == 0x80;
                switch ((num & 15))
                {
                    case 0:
                        flag = flag3;
                        AddPathCommand('M', ref lastCommandChar, sb);
                        AddPathPoint(reader, sb, flag4, flag5);
                        goto Label_000A;

                    case 1:
                        AddPathCommand('L', ref lastCommandChar, sb);
                        AddPathPoint(reader, sb, flag4, flag5);
                        goto Label_000A;

                    case 2:
                        AddPathCommand('Q', ref lastCommandChar, sb);
                        AddPathPoint(reader, sb, flag4, flag5);
                        AddPathPoint(reader, sb);
                        goto Label_000A;

                    case 3:
                        AddPathCommand('C', ref lastCommandChar, sb);
                        AddPathPoint(reader, sb, flag4, flag5);
                        AddPathPoint(reader, sb);
                        AddPathPoint(reader, sb);
                        goto Label_000A;

                    case 4:
                        {
                            AddPathCommand('L', ref lastCommandChar, sb);
                            int num2 = reader.ReadInt32();
                            for (int i = 0; i < num2; i++)
                            {
                                AddPathPoint(reader, sb);
                            }
                            goto Label_000A;
                        }
                    case 5:
                        {
                            AddPathCommand('Q', ref lastCommandChar, sb);
                            int num4 = reader.ReadInt32();
                            for (int j = 0; j < num4; j++)
                            {
                                AddPathPoint(reader, sb);
                            }
                            goto Label_000A;
                        }
                    case 6:
                        {
                            AddPathCommand('C', ref lastCommandChar, sb);
                            int num6 = reader.ReadInt32();
                            for (int k = 0; k < num6; k++)
                            {
                                AddPathPoint(reader, sb);
                            }
                            goto Label_000A;
                        }
                    case 7:
                        {
                            double num8 = ReadPathDouble(reader, flag4);
                            double num9 = ReadPathDouble(reader, flag5);
                            byte num10 = reader.ReadByte();
                            bool flag6 = (num10 & 15) != 0;
                            bool flag7 = (num10 & 240) != 0;
                            double num11 = reader.ReadCompressedDouble();
                            double num12 = reader.ReadCompressedDouble();
                            double num13 = reader.ReadCompressedDouble();
                            sb.AppendFormat("A {0},{1} {2} {3} {4} {5},{6} ", new object[] { num11, num12, num13, flag6 ? 1 : 0, flag7 ? 1 : 0, num8, num9 });
                            lastCommandChar = 'A';
                            goto Label_000A;
                        }
                    case 8:
                        if (!flag)
                        {
                            if (sb.Length > 0)
                            {
                                sb.Remove(sb.Length - 1, 0);
                            }
                            break;
                        }
                        sb.Append("Z");
                        break;

                    case 9:
                        sb.Insert(0, flag2 ? "F1 " : "F0 ");
                        lastCommandChar = 'F';
                        goto Label_000A;

                    default:
                        throw new InvalidOperationException();
                }
                return sb.ToString();
            }
コード例 #10
0
 internal string GetXmlNamespace(BamlTranslator.TypeDeclaration type)
 {
     BamlTranslator.ClrNamespace namespace2 = new BamlTranslator.ClrNamespace(type.Namespace, type.Assembly);
     return (string)this.reverseTable[namespace2];
 }