当前位置: 首页>>代码示例>>C#>>正文


C# Bam.Interfaces方法代码示例

本文整理汇总了C#中Bam.Interfaces方法的典型用法代码示例。如果您正苦于以下问题:C# Bam.Interfaces方法的具体用法?C# Bam.Interfaces怎么用?C# Bam.Interfaces使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bam的用法示例。


在下文中一共展示了Bam.Interfaces方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Convert

 public static void Convert(
     System.Type conversionClass,
     Bam.Core.Settings settings,
     Bam.Core.Module module,
     VSSolutionBuilder.VSSettingsGroup vsSettingsGroup,
     string condition)
 {
     var moduleType = typeof(Bam.Core.Module);
     var vsSettingsGroupType = typeof(VSSolutionBuilder.VSSettingsGroup);
     var stringType = typeof(string);
     foreach (var i in settings.Interfaces())
     {
         var method = conversionClass.GetMethod("Convert", new[] { i, moduleType, vsSettingsGroupType, stringType });
         if (null == method)
         {
             throw new Bam.Core.Exception("Unable to locate method {0}.Convert({1}, {2}, {3})",
                 conversionClass.ToString(),
                 i.ToString(),
                 moduleType,
                 vsSettingsGroupType,
                 stringType);
         }
         try
         {
             method.Invoke(null, new object[] { settings, module, vsSettingsGroup, condition });
         }
         catch (System.Reflection.TargetInvocationException exception)
         {
             throw new Bam.Core.Exception(exception.InnerException, "VisualStudio conversion error:");
         }
     }
 }
开发者ID:knocte,项目名称:BuildAMation,代码行数:32,代码来源:Conversion.cs

示例2: Convert

 public static void Convert(
     System.Type conversionClass,
     Bam.Core.Settings toolSettings,
     Bam.Core.Module module,
     XcodeBuilder.Configuration configuration)
 {
     var moduleType = typeof(Bam.Core.Module);
     var xcodeConfigurationType = typeof(XcodeBuilder.Configuration);
     foreach (var i in toolSettings.Interfaces())
     {
         var method = conversionClass.GetMethod("Convert", new[] { i, moduleType, xcodeConfigurationType });
         if (null == method)
         {
             throw new Bam.Core.Exception("Unable to locate method {0}.Convert({1}, {2}, {3})",
                 conversionClass.ToString(),
                 i.ToString(),
                 moduleType,
                 xcodeConfigurationType);
         }
         try
         {
             method.Invoke(null, new object[] { toolSettings, module, configuration });
         }
         catch (System.Reflection.TargetInvocationException exception)
         {
             throw new Bam.Core.Exception(exception.InnerException, "Xcode conversion error:");
         }
     }
 }
开发者ID:knocte,项目名称:BuildAMation,代码行数:29,代码来源:Conversion.cs

示例3: Convert

 Convert(
     System.Type conversionClass,
     Bam.Core.Settings toolSettings,
     Bam.Core.StringArray commandLine)
 {
     var stringArrayType = typeof(Bam.Core.StringArray);
     foreach (var i in toolSettings.Interfaces())
     {
         var method = conversionClass.GetMethod("Convert", new[] { i, stringArrayType });
         if (null == method)
         {
             throw new Bam.Core.Exception("Unable to locate method {0}.Convert({1}, {2})",
                 conversionClass.ToString(),
                 i.ToString(),
                 stringArrayType);
         }
         var commands = new Bam.Core.StringArray();
         try
         {
             method.Invoke(null, new object[] { toolSettings, commands });
         }
         catch (System.Reflection.TargetInvocationException exception)
         {
             throw new Bam.Core.Exception(exception.InnerException, "Command line conversion error:");
         }
         commandLine.AddRange(commands);
     }
 }
开发者ID:knocte,项目名称:BuildAMation,代码行数:28,代码来源:Conversion.cs

示例4: CreateDeltaSettings

        CreateDeltaSettings(
            Bam.Core.Settings sharedSettings,
            Bam.Core.Module module)
        {
            var attributeType = typeof(Bam.Core.SettingsExtensionsAttribute);

            var moduleSpecificSettings = System.Activator.CreateInstance(module.Settings.GetType(), module, false) as SettingsBase;
            var sharedInterfaces = sharedSettings.Interfaces();
            foreach (var i in module.Settings.Interfaces())
            {
                var attributeArray = i.GetCustomAttributes(attributeType, false);
                if (0 == attributeArray.Length)
                {
                    throw new Bam.Core.Exception("Settings interface {0} is missing attribute {1}",
                        i.ToString(), attributeType.ToString());
                }

                var attribute = attributeArray[0] as Bam.Core.SettingsExtensionsAttribute;

                // if we match any of the shared interfaces, get a delta
                // otherwise, just clone the interface
                if (sharedInterfaces.Any(item => item == i))
                {
                    var deltaMethod = attribute.GetMethod("Delta", new[] { i, i, i });
                    if (null != deltaMethod)
                    {
                        Bam.Core.Log.DebugMessage("Executing {0}", deltaMethod.Name);
                        deltaMethod.Invoke(null, new[] { moduleSpecificSettings, this, sharedSettings });
                    }
                    else
                    {
                        throw new Bam.Core.Exception("Unable to find method {0}.Delta(this {1}, {1}, {1)",
                            attribute.ExtensionsClassName, i.ToString());
                    }
                }
                else
                {
                    var cloneMethod = attribute.GetMethod("Clone", new[] { i, i });
                    if (null != cloneMethod)
                    {
                        Bam.Core.Log.DebugMessage("Executing {0}", cloneMethod.Name);
                        cloneMethod.Invoke(null, new[] { moduleSpecificSettings, this });
                    }
                    else
                    {
                        throw new Bam.Core.Exception("Unable to find method {0}.Clone(this {1}, {1})",
                            attribute.ExtensionsClassName, i.ToString());
                    }
                }
            }

            return moduleSpecificSettings;
        }
开发者ID:knocte,项目名称:BuildAMation,代码行数:53,代码来源:SettingsBase.cs


注:本文中的Bam.Interfaces方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。