private static Microsoft.VisualStudio.ProjectSystem.Properties.IRule GetRule(Microsoft.VisualStudio.ProjectSystem.Properties.IPropertyPagesCatalog catalog, string file, string itemType, string itemName)
 {
     if ((catalog == null))
     {
         return(null);
     }
     return(catalog.BindToContext(SchemaName, file, itemType, itemName));
 }
 private void InitializeFallbackRule()
 {
     if ((this.configuredProject == null))
     {
         return;
     }
     Microsoft.Build.Framework.XamlTypes.Rule unboundRule = RazorComponentWithTargetPath.deserializedFallbackRule;
     if ((unboundRule == null))
     {
         System.IO.Stream           xamlStream   = null;
         System.Reflection.Assembly thisAssembly = System.Reflection.Assembly.GetExecutingAssembly();
         try
         {
             xamlStream = thisAssembly.GetManifestResourceStream("XamlRuleToCode:RazorComponentWithTargetPath.xaml");
             Microsoft.Build.Framework.XamlTypes.IProjectSchemaNode root           = ((Microsoft.Build.Framework.XamlTypes.IProjectSchemaNode)(System.Xaml.XamlServices.Load(xamlStream)));
             System.Collections.Generic.IEnumerator <System.Object> ruleEnumerator = root.GetSchemaObjects(typeof(Microsoft.Build.Framework.XamlTypes.Rule)).GetEnumerator();
             for (
                 ; ((unboundRule == null) &&
                    ruleEnumerator.MoveNext());
                 )
             {
                 Microsoft.Build.Framework.XamlTypes.Rule t = ((Microsoft.Build.Framework.XamlTypes.Rule)(ruleEnumerator.Current));
                 if (System.StringComparer.OrdinalIgnoreCase.Equals(t.Name, SchemaName))
                 {
                     unboundRule      = t;
                     unboundRule.Name = "7bce92b9d442fe435263d738937cc0845b32e8219c968e23697081db5a869f4a";
                     RazorComponentWithTargetPath.deserializedFallbackRule = unboundRule;
                 }
             }
         }
         finally
         {
             if ((xamlStream != null))
             {
                 ((System.IDisposable)(xamlStream)).Dispose();
             }
         }
     }
     this.configuredProject.Services.AdditionalRuleDefinitions.AddRuleDefinition(unboundRule, "FallbackRuleCodeGenerationContext");
     Microsoft.VisualStudio.ProjectSystem.Properties.IPropertyPagesCatalog catalog = this.configuredProject.Services.PropertyPagesCatalog.GetMemoryOnlyCatalog("FallbackRuleCodeGenerationContext");
     this.fallbackRule = catalog.BindToContext(unboundRule.Name, this.file, this.itemType, this.itemName);
 }
 private void InitializeFallbackRule()
 {
     if ((this.configuredProject == null))
     {
         return;
     }
     Microsoft.Build.Framework.XamlTypes.Rule unboundRule = RazorExtension.deserializedFallbackRule;
     if ((unboundRule == null))
     {
         System.IO.Stream           xamlStream   = null;
         System.Reflection.Assembly thisAssembly = System.Reflection.Assembly.GetExecutingAssembly();
         try
         {
             xamlStream = thisAssembly.GetManifestResourceStream("XamlRuleToCode:RazorExtension.xaml");
             Microsoft.Build.Framework.XamlTypes.IProjectSchemaNode root           = ((Microsoft.Build.Framework.XamlTypes.IProjectSchemaNode)(System.Xaml.XamlServices.Load(xamlStream)));
             System.Collections.Generic.IEnumerator <System.Object> ruleEnumerator = root.GetSchemaObjects(typeof(Microsoft.Build.Framework.XamlTypes.Rule)).GetEnumerator();
             for (
                 ; ((unboundRule == null) &&
                    ruleEnumerator.MoveNext());
                 )
             {
                 Microsoft.Build.Framework.XamlTypes.Rule t = ((Microsoft.Build.Framework.XamlTypes.Rule)(ruleEnumerator.Current));
                 if (System.StringComparer.OrdinalIgnoreCase.Equals(t.Name, SchemaName))
                 {
                     unboundRule      = t;
                     unboundRule.Name = "e8ad5dd707beca947f7c014baa70b46c1d7a7fd6c8b49a5511ab299d8e1a3c70";
                     RazorExtension.deserializedFallbackRule = unboundRule;
                 }
             }
         }
         finally
         {
             if ((xamlStream != null))
             {
                 ((System.IDisposable)(xamlStream)).Dispose();
             }
         }
     }
     this.configuredProject.Services.AdditionalRuleDefinitions.AddRuleDefinition(unboundRule, "FallbackRuleCodeGenerationContext");
     Microsoft.VisualStudio.ProjectSystem.Properties.IPropertyPagesCatalog catalog = this.configuredProject.Services.PropertyPagesCatalog.GetMemoryOnlyCatalog("FallbackRuleCodeGenerationContext");
     this.fallbackRule = catalog.BindToContext(unboundRule.Name, this.file, this.itemType, this.itemName);
 }