本文整理汇总了C#中IObjectSource类的典型用法代码示例。如果您正苦于以下问题:C# IObjectSource类的具体用法?C# IObjectSource怎么用?C# IObjectSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IObjectSource类属于命名空间,在下文中一共展示了IObjectSource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BaseTypeViewSource
public BaseTypeViewSource (EvaluationContext ctx, IObjectSource objectSource, object type, object obj)
{
this.ctx = ctx;
this.type = type;
this.obj = obj;
this.objectSource = objectSource;
}
示例2: CreateNode
static ObjectValue CreateNode (EvaluationContext ctx, IObjectSource objectSource, object type, object obj, BindingFlags bindingFlags, string label)
{
FilteredMembersSource src = new FilteredMembersSource (ctx, objectSource, type, obj, bindingFlags);
src.Connect ();
ObjectValue val = ObjectValue.CreateObject (src, new ObjectPath (label), "", "", ObjectValueFlags.Group|ObjectValueFlags.ReadOnly|ObjectValueFlags.NoRefresh, null);
val.ChildSelector = "";
return val;
}
示例3: CreateRawView
public static ObjectValue CreateRawView (EvaluationContext ctx, IObjectSource objectSource, object obj)
{
RawViewSource src = new RawViewSource (ctx, objectSource, obj);
src.Connect ();
ObjectValue val = ObjectValue.CreateObject (src, new ObjectPath ("Raw View"), "", "", ObjectValueFlags.Group|ObjectValueFlags.ReadOnly|ObjectValueFlags.NoRefresh, null);
val.ChildSelector = "";
return val;
}
示例4: FilteredMembersSource
public FilteredMembersSource (EvaluationContext ctx, IObjectSource objectSource, object type, object obj, BindingFlags bindingFlags)
{
this.ctx = ctx;
this.obj = obj;
this.type = type;
this.bindingFlags = bindingFlags;
this.objectSource = objectSource;
}
示例5: CreateBaseTypeView
public static ObjectValue CreateBaseTypeView (EvaluationContext ctx, IObjectSource objectSource, object type, object obj)
{
BaseTypeViewSource src = new BaseTypeViewSource (ctx, objectSource, type, obj);
src.Connect ();
string tname = ctx.Adapter.GetDisplayTypeName (ctx, type);
ObjectValue val = ObjectValue.CreateObject (src, new ObjectPath ("base"), tname, "{" + tname + "}", ObjectValueFlags.Type|ObjectValueFlags.ReadOnly|ObjectValueFlags.NoRefresh, null);
val.ChildSelector = "";
return val;
}
示例6: RemoteRawValue
public RemoteRawValue(EvaluationContext gctx, IObjectSource source, object targetObject)
{
this.ctx = gctx.Clone ();
ctx.Options.AllowTargetInvoke = true;
ctx.Options.AllowMethodEvaluation = true;
this.targetObject = targetObject;
this.source = source;
Connect ();
}
示例7: ZyanServerQueryHandler
/// <summary>
/// Creates ZyanServerQueryHandler instance.
/// </summary>
/// <param name="source">IObjectSource instance</param>
public ZyanServerQueryHandler(IObjectSource source)
{
if (source == null)
{
throw new ArgumentNullException("source");
}
InnerHandler = new ServerQueryHandler(new ZyanObjectQueryHandler(source));
}
示例8: ObjectValueHasChildren
public virtual bool ObjectValueHasChildren (EvaluationContext ctx, IObjectSource objectSource, object type, object obj, bool dereferenceProxy)
{
if (obj is EvaluationResult)
return false;
if (IsArray (ctx, obj))
return true;
if (IsPrimitive (ctx, obj))
return false;
bool showRawView = false;
// If there is a proxy, it has to show the members of the proxy
object proxy = obj;
if (dereferenceProxy) {
proxy = GetProxyObject (ctx, obj);
if (proxy != obj) {
type = GetValueType (ctx, proxy);
showRawView = true;
}
}
TypeDisplayData tdata = GetTypeDisplayData (ctx, type);
bool groupPrivateMembers = ctx.Options.GroupPrivateMembers && (ctx.Options.GroupUserPrivateMembers || IsExternalType (ctx, type));
BindingFlags flattenFlag = ctx.Options.FlattenHierarchy ? (BindingFlags)0 : BindingFlags.DeclaredOnly;
BindingFlags nonNonPublicFlag = groupPrivateMembers || showRawView ? (BindingFlags)0 : BindingFlags.NonPublic;
BindingFlags staticFlag = ctx.Options.GroupStaticMembers ? (BindingFlags)0 : BindingFlags.Static;
BindingFlags access = BindingFlags.Public | BindingFlags.Instance | flattenFlag | nonNonPublicFlag | staticFlag;
// Load all members to a list before creating the object values,
// to avoid problems with objects being invalidated due to evaluations in the target,
List<ValueReference> list = new List<ValueReference> ();
list.AddRange (GetMembersSorted (ctx, objectSource, type, proxy, access));
object tdataType = type;
foreach (ValueReference val in list) {
try {
object decType = val.DeclaringType;
if (decType != null && decType != tdataType) {
tdataType = decType;
tdata = GetTypeDisplayData (ctx, decType);
}
DebuggerBrowsableState state = tdata.GetMemberBrowsableState (val.Name);
if (state == DebuggerBrowsableState.Never)
continue;
return true;
} catch (Exception ex) {
ctx.WriteDebuggerError (ex);
}
}
if (IsArray (ctx, proxy))
return true;
if (ctx.Options.GroupStaticMembers && HasMembers (ctx, type, proxy, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | flattenFlag))
return true;
if (groupPrivateMembers && HasMembers (ctx, type, proxy, BindingFlags.Instance | BindingFlags.NonPublic | flattenFlag | staticFlag))
return true;
if (!ctx.Options.FlattenHierarchy) {
object baseType = GetBaseType (ctx, type, false);
if (baseType != null)
return true;
}
return false;
}
示例9: Object
public static CommandTokenMatcher Object(String CaptureName, IObjectSource Source, Func<Actor, MudObject, MatchPreference> ScoreFunc, ObjectMatcherSettings Settings = ObjectMatcherSettings.UnderstandMe)
{
return new ObjectMatcher(CaptureName, Source, ScoreFunc, Settings);
}
示例10: GetMembersSorted
internal IEnumerable<ValueReference> GetMembersSorted (EvaluationContext ctx, IObjectSource objectSource, object t, object co, BindingFlags bindingFlags)
{
List<ValueReference> list = new List<ValueReference> ();
foreach (ValueReference vr in GetMembers (ctx, t, co, bindingFlags)) {
vr.ParentSource = objectSource;
list.Add (vr);
}
list.Sort (delegate (ValueReference v1, ValueReference v2) {
return v1.Name.CompareTo (v2.Name);
});
return list;
}
示例11: GetMember
public ValueReference GetMember (EvaluationContext ctx, IObjectSource objectSource, object t, object co, string name)
{
ValueReference m = GetMember (ctx, t, co, name);
if (m != null)
m.ParentSource = objectSource;
return m;
}
示例12: GetMembers
public IEnumerable<ValueReference> GetMembers (EvaluationContext ctx, IObjectSource objectSource, object t, object co)
{
foreach (ValueReference val in GetMembers (ctx, t, co, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static)) {
val.ParentSource = objectSource;
yield return val;
}
}
示例13: GetObjectValueChildren
public ObjectValue[] GetObjectValueChildren (EvaluationContext ctx, IObjectSource objectSource, object obj, int firstItemIndex, int count)
{
return GetObjectValueChildren (ctx, objectSource, GetValueType (ctx, obj), obj, firstItemIndex, count, true);
}
示例14: CreateStaticsNode
public static ObjectValue CreateStaticsNode (EvaluationContext ctx, IObjectSource objectSource, object type, object obj, BindingFlags bindingFlags)
{
return CreateNode (ctx, objectSource, type, obj, bindingFlags, "Static members");
}
示例15: ObjectMatcher
public ObjectMatcher(String CaptureName, IObjectSource ObjectSource, ObjectMatcherSettings Settings = ObjectMatcherSettings.UnderstandMe)
{
this.CaptureName = CaptureName;
this.ObjectSource = ObjectSource;
this.Settings = Settings;
}