本文整理汇总了C#中Microsoft.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.GetType方法的具体用法?C# Microsoft.GetType怎么用?C# Microsoft.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft
的用法示例。
在下文中一共展示了Microsoft.GetType方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InterpretKey
public static String InterpretKey(Microsoft.Xna.Framework.Input.Keys key)
{
if (m_CameraControls.ContainsKey(key))
return m_CameraControls[key];
else
return Enum.GetName(key.GetType(), key);
}
示例2: ResolveParameter
public override object ResolveParameter(ParameterDescriptor descriptor, Microsoft.AspNet.SignalR.Json.IJsonValue value)
{
if (value.GetType() == descriptor.ParameterType)
{
return value;
}
if (_valueField == null)
_valueField = value.GetType().GetField("_value", BindingFlags.Instance | BindingFlags.NonPublic);
var json = (string)_valueField.GetValue(value);
using (var reader = new StringReader(json))
return _serializer.Deserialize(reader, descriptor.ParameterType);
}
示例3: CalcIsHidden
public static bool CalcIsHidden(Microsoft.AnalysisServices.Design.Script calc)
{
//calc.CalculationProperty.Visible doesn't seem to work
object mdxCodeCalc = calc.GetType().InvokeMember("mdxCodeCalc", System.Reflection.BindingFlags.GetField | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance, null, calc, null);
bool bIsHidden = (bool)mdxCodeCalc.GetType().InvokeMember("IsHidden", System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public, null, mdxCodeCalc, null);
return bIsHidden;
}
示例4: GetItems
public static IEnumerable<Microsoft.Build.Evaluation.ProjectItem> GetItems(Microsoft.Build.Evaluation.Project project, string name)
{
MethodInfo getItems = project.GetType().GetMethod("GetItems", new Type[] { typeof(string) });
return (IEnumerable<Microsoft.Build.Evaluation.ProjectItem>)getItems.Invoke(project, new object[] { name });
}
示例5: GetStaticItemsInOrder
public static IEnumerable<Microsoft.Build.Evaluation.ProjectItem> GetStaticItemsInOrder(Microsoft.Build.Evaluation.Project project)
{
project.ReevaluateIfNecessary();
PropertyInfo allEvaluatedItems = project.GetType().GetProperty("AllEvaluatedItems");
return (IEnumerable<Microsoft.Build.Evaluation.ProjectItem>)allEvaluatedItems.GetValue(project, null);
}
示例6: GetQueryDefinition
internal static string GetQueryDefinition(Database d, NamedComponent nc, Microsoft.AnalysisServices.Binding b, List<DataItem> columnsNeeded)
{
StringBuilder sQuery = new StringBuilder();
if (b is DsvTableBinding)
{
DsvTableBinding oDsvTableBinding = (DsvTableBinding)b;
DataSourceView oDSV = d.DataSourceViews[oDsvTableBinding.DataSourceViewID];
DataTable oTable = oDSV.Schema.Tables[oDsvTableBinding.TableID];
if (oTable == null)
{
throw new Exception("DSV table " + oDsvTableBinding.TableID + " not found");
}
else if (!oTable.ExtendedProperties.ContainsKey("QueryDefinition") && oTable.ExtendedProperties.ContainsKey("DbTableName"))
{
foreach (DataColumn oColumn in oTable.Columns)
{
bool bFoundColumn = false;
if (columnsNeeded == null)
{
bFoundColumn = true;
}
else
{
foreach (DataItem di in columnsNeeded)
{
if (GetColumnBindingForDataItem(di).TableID == oTable.TableName && GetColumnBindingForDataItem(di).ColumnID == oColumn.ColumnName)
{
bFoundColumn = true;
}
}
}
if (bFoundColumn)
{
if (sQuery.Length == 0)
{
sQuery.Append("select ");
}
else
{
sQuery.Append(",");
}
if (!oColumn.ExtendedProperties.ContainsKey("ComputedColumnExpression"))
{
sQuery.Append(sq).Append((oColumn.ExtendedProperties["DbColumnName"] ?? oColumn.ColumnName).ToString()).AppendLine(fq);
}
else
{
sQuery.Append(oColumn.ExtendedProperties["ComputedColumnExpression"].ToString()).Append(" as ").Append(sq).Append((oColumn.ExtendedProperties["DbColumnName"] ?? oColumn.ColumnName).ToString()).AppendLine(fq);
}
}
}
if (sQuery.Length == 0)
{
throw new Exception("There was a problem constructing the query.");
}
sQuery.Append("from ");
if (oTable.ExtendedProperties.ContainsKey("DbSchemaName")) sQuery.Append(sq).Append(oTable.ExtendedProperties["DbSchemaName"].ToString()).Append(fq).Append(".");
sQuery.Append(sq).Append(oTable.ExtendedProperties["DbTableName"].ToString());
sQuery.Append(fq).Append(" ").Append(sq).Append(oTable.ExtendedProperties["FriendlyName"].ToString()).AppendLine(fq);
}
else if (oTable.ExtendedProperties.ContainsKey("QueryDefinition"))
{
sQuery.AppendLine("select *");
sQuery.AppendLine("from (");
sQuery.AppendLine(oTable.ExtendedProperties["QueryDefinition"].ToString());
sQuery.AppendLine(") x");
}
else
{
throw new Exception("Current the code does not support this type of query.");
}
}
else if (b is QueryBinding)
{
QueryBinding oQueryBinding = (QueryBinding)b;
sQuery.Append(oQueryBinding.QueryDefinition);
}
else if (b is ColumnBinding)
{
ColumnBinding cb = (ColumnBinding)b;
object parent = cb.Parent;
DataTable dt = d.DataSourceViews[0].Schema.Tables[cb.TableID];
if (nc is DimensionAttribute)
{
DimensionAttribute da = (DimensionAttribute)nc;
if (da.Parent.KeyAttribute.KeyColumns.Count != 1)
{
throw new Exception("Attribute " + da.Parent.KeyAttribute.Name + " has a composite key. This is not supported for a key attribute of a dimension.");
}
string sDsvID = ((DimensionAttribute)nc).Parent.DataSourceView.ID;
columnsNeeded.Add(new DataItem(cb.Clone()));
columnsNeeded.Add(da.Parent.KeyAttribute.KeyColumns[0]);
return GetQueryDefinition(d, nc, new DsvTableBinding(sDsvID, cb.TableID), columnsNeeded);
}
else
{
throw new Exception("GetQueryDefinition does not currently support a ColumnBinding on a object of type " + nc.GetType().Name);
//.........这里部分代码省略.........
示例7: VisitFieldReference
private static void VisitFieldReference(Microsoft.Cci.IFieldReference fieldReference, Microsoft.CodeAnalysis.Emit.Context context)
{
Debug.Assert(fieldReference != null);
// Visit containing type
VisitTypeReference(fieldReference.GetContainingType(context), context);
// Translate substituted field to original definition
Microsoft.Cci.ISpecializedFieldReference specializedField = fieldReference.AsSpecializedFieldReference;
if (specializedField != null)
{
fieldReference = specializedField.UnspecializedVersion;
}
// Visit field type
VisitTypeReference(fieldReference.GetType(context), context);
}
示例8: VisitMethodReference
private static void VisitMethodReference(Microsoft.Cci.IMethodReference methodReference, Microsoft.CodeAnalysis.Emit.Context context)
{
Debug.Assert(methodReference != null);
// Visit containing type
VisitTypeReference(methodReference.GetContainingType(context), context);
// Visit generic arguments if any
Microsoft.Cci.IGenericMethodInstanceReference genericInstance = methodReference.AsGenericMethodInstanceReference;
if (genericInstance != null)
{
foreach (var arg in genericInstance.GetGenericArguments(context))
{
VisitTypeReference(arg, context);
}
methodReference = genericInstance.GetGenericMethod(context);
}
// Translate substituted method to original definition
Microsoft.Cci.ISpecializedMethodReference specializedMethod = methodReference.AsSpecializedMethodReference;
if (specializedMethod != null)
{
methodReference = specializedMethod.UnspecializedVersion;
}
// Visit parameter types
VisitParameters(methodReference.GetParameters(context), context);
if (methodReference.AcceptsExtraArguments)
{
VisitParameters(methodReference.ExtraParameters, context);
}
// Visit return value type
VisitTypeReference(methodReference.GetType(context), context);
if (methodReference.ReturnValueIsModified)
{
foreach (var typeModifier in methodReference.ReturnValueCustomModifiers)
{
VisitTypeReference(typeModifier.GetModifier(context), context);
}
}
}
示例9: GetTabularERDiagramFromSandboxEditor
public static Microsoft.AnalysisServices.Common.ERDiagram GetTabularERDiagramFromSandboxEditor(Microsoft.AnalysisServices.Common.SandboxEditor editor)
{
Microsoft.AnalysisServices.Common.DiagramDisplay diagramDisplay = (Microsoft.AnalysisServices.Common.DiagramDisplay)editor.GetType().InvokeMember("GetCurrentDiagramDisplay", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.InvokeMethod | System.Reflection.BindingFlags.NonPublic, null, editor, new object[] { });
Microsoft.AnalysisServices.Common.ERDiagram diagram = null;
if (diagramDisplay != null)
{
diagram = diagramDisplay.Diagram as Microsoft.AnalysisServices.Common.ERDiagram;
}
return diagram;
}
示例10: RegisterLanguageService
public virtual void RegisterLanguageService(Microsoft.VisualStudio.IntegrationHelper.LanguageService languageService){
if (languageService == null) throw new ArgumentNullException();
languageService.SetSite(this);
((IServiceContainer)this).AddService(languageService.GetType(), languageService, true);
int lcid = this.GetProviderLocale();
languageService.scLanguageService.culture = lcid == 0 ? CultureInfo.InvariantCulture : new CultureInfo(lcid);
}