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


C# IProject.GetType方法代码示例

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


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

示例1: GetTargets

 public Dictionary<string, Target> GetTargets(IProject project)
 {
     var targets = new Dictionary<string, Target>();
     foreach(var m in project.GetType().GetMethods())
     if(m.DeclaringType != typeof(object))
         targets.Add(m.Name, new MethodTarget(project, m));
     return targets;
 }
开发者ID:danaxa,项目名称:Pencil,代码行数:8,代码来源:MethodTargetExtractor.cs

示例2: GetSuitableMethods

        private static IEnumerable<MethodInfo> GetSuitableMethods(IProject project)
        {
            var typesToExclude = new[] {typeof (Project), typeof (IProject), typeof (Object)};

            return from method in project.GetType().GetMethods()
                   where typesToExclude.None(t => t.Equals(method.DeclaringType))
                   where !method.IsSpecialName
                   select method;
        }
开发者ID:simoneb,项目名称:Pencil,代码行数:9,代码来源:MethodTargetExtractor.cs

示例3: MergeReferences

      public void MergeReferences(IProject otherProject)
      {
         var other = otherProject as VcppProject;
         if (other == null) throw new ArgumentException("VC++ projects can only be merged with other VC++ projects. Merging with " + otherProject.GetType() + " is not supported.");

         OutputWindow.WriteLine("Merging references is not yet supported for VC++ projects.");

         //var references = other.VcProject.VCReferences;
         //for (int i = 1; i <= references.Count; i++)
         //{
         //   VCReference reference = references.Item(i);
         //   OutputWindow.WriteLine("Copying reference " + reference.Name + "...");
         //   VcProject.VCReferences.Add(reference);
         //   OutputWindow.WriteLine("Copied reference " + reference.Name + ".");
         //}
      }
开发者ID:rodolfograve,项目名称:TEAM.ProjectMerger,代码行数:16,代码来源:VcppProject.cs

示例4: MergeReferences

      public void MergeReferences(IProject otherProject)
      {
         var other = otherProject as CSharpProject;
         if (other == null) throw new ArgumentException("C# projects can only be merged with other C# projects. Merging with " + otherProject.GetType() + " is not supported.");

         foreach (Reference reference in other.VsProject.References)
         {
            try
            {
               Reference newReference;
               if (reference.SourceProject == null)
               {
                  if (reference.Type == prjReferenceType.prjReferenceTypeActiveX)
                  {
                     OutputWindow.WriteLine("ActiveX references cannot be migrated.");
                  }
                  else if (reference.Type == prjReferenceType.prjReferenceTypeAssembly)
                  {
                     OutputWindow.WriteLine("Copying assembly reference " + reference.Name + "...");
                     var path = reference.Path;
                     newReference = VsProject.References.Add(path);
                     newReference.CopyLocal = reference.CopyLocal;
                     OutputWindow.WriteLine("Copied assembly reference " + newReference.Name + ".");
                  }
               }
               else
               {
                  OutputWindow.WriteLine("Copying reference to project " + reference.SourceProject.Name + "...");
                  newReference = VsProject.References.AddProject(reference.SourceProject);
                  OutputWindow.WriteLine("Copied reference to project " + reference.SourceProject.Name + ".");
               }
            }
            catch (Exception ex)
            {
               OutputWindow.WriteLine("Failed to merge reference " + reference.Name + ". " + ex);
            }
         }
      }
开发者ID:rodolfograve,项目名称:TEAM.ProjectMerger,代码行数:38,代码来源:CSharpProject.cs


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