本文整理汇总了C#中System.Object类的典型用法代码示例。如果您正苦于以下问题:C# System.Object类的具体用法?C# System.Object怎么用?C# System.Object使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
System.Object类属于命名空间,在下文中一共展示了System.Object类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FieldEditor
public FieldEditor(System.Object data)
{
this.data = data;
_fieldInfos = data.GetType().GetFields(BINDING);
for (var i = 0; i < _fieldInfos.Length; i++)
GuiFields.Add(GenerateGUI(_fieldInfos[i]));
}
示例2: Start
public void Start()
{
if (true)
{
var obj = new System.Object();
}
else
{
var obj2 = new System.Object();
}
}
示例3: Telegram
public Telegram(float time,
int sender,
int receiver,
int msg_type,
System.Object info)
{
this.DispatchTime = time;
this.Sender = sender;
this.Receiver = receiver;
this.MsgType = msg_type;
this.ExtraInfo = info;
}
示例4: MoCapDataBuffer
/// <summary>
/// Creates a new MoCap data buffer object.
/// </summary>
/// <param name="name">name of this buffer</param>
/// <param name="owner">game object that owns this buffer</param>
/// <param name="obj">game object to associate with this buffer</param>
/// <param name="data">arbitrary object to associate with this buffer</param>
///
public MoCapDataBuffer(string name, GameObject owner, GameObject obj, System.Object data = null)
{
// find any manipulators and store them
modifiers = owner.GetComponents<IModifier>();
// specifically find the delay manipulator and set the FIFO size accordingly
DelayModifier delayComponent = owner.GetComponent<DelayModifier>();
float delay = (delayComponent != null) ? delayComponent.delay : 0;
int delayInFrames = Mathf.Max(1, 1 + (int)(delay * 60)); // TODO: Find out or define framerate somewhere central
pipeline = new MoCapData[delayInFrames];
for (int i = 0; i < pipeline.Length; i++)
{
pipeline[i] = new MoCapData(this);
}
index = 0;
firstPush = true;
this.Name = name;
this.GameObject = obj;
this.DataObject = data;
}
示例5: Node
/// <summary>Make a new node with indicated item, and null link *</summary>
internal Node(System.Object x)
{
value = x;
}
示例6: Node
/**
* Constructs a node with the specified state.
*
* @param state
* the state in the state space to which the node corresponds.
*/
public Node(System.Object state)
{
this.state = state;
this.pathCost = 0.0;
}
示例7: UpdateInternal
protected override NodeRunningStatus UpdateInternal(OutputParam rInput, OutputParam rOutput)
{
NodeRunningStatus rIsFinish = NodeRunningStatus.Finish;
if (mActionStatus == NodeActionStaus.Ready)
{
Enter(rInput);
mNeedExit = true;
mActionStatus = NodeActionStaus.Running;
SetActiveNode(this);
}
if (mActionStatus == NodeActionStaus.Running)
{
rIsFinish = Execute(rInput, rOutput);
SetActiveNode(this);
if(rIsFinish != NodeRunningStatus.Executing)
{
mActionStatus = NodeActionStaus.Finish;
}
}
if (mActionStatus == NodeActionStaus.Finish)
{
if (mNeedExit) Exit(rInput, rIsFinish);
mActionStatus = NodeActionStaus.Ready;
mNeedExit = false;
SetActiveNode(null);
return rIsFinish;
}
return rIsFinish;
}
示例8: TransitionInternal
protected override void TransitionInternal(OutputParam rInput)
{
if (mNeedExit) Exit(rInput, NodeRunningStatus.TransitionError);
SetActiveNode(null);
mActionStatus = NodeActionStaus.Ready;
mNeedExit = false;
}
示例9: CreateTestFile
private static void CreateTestFile(TestContext context, string filename, string text)
{
using(StreamWriter writer = new StreamWriter(context.TestRunDirectory + filename))
{
writer.WriteLine(text);
writer.Flush();
}
}
示例10: Create
public virtual object Create (object parent, object configContext, XmlNode section)
{
#if XML_DEP
if (section.Attributes != null && section.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", section);
XmlNodeList reqHandlers = section.ChildNodes;
foreach (XmlNode child in reqHandlers) {
XmlNodeType ntype = child.NodeType;
if (ntype == XmlNodeType.Whitespace || ntype == XmlNodeType.Comment)
continue;
if (ntype != XmlNodeType.Element)
HandlersUtil.ThrowException ("Only elements allowed", child);
string name = child.Name;
if (name == "clear") {
if (child.Attributes != null && child.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", child);
WebRequest.PrefixList = new ArrayList ();
continue;
}
string prefix = HandlersUtil.ExtractAttributeValue ("prefix", child);
if (name == "add") {
string type = HandlersUtil.ExtractAttributeValue ("type", child, false);
if (child.Attributes != null && child.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", child);
throw new NotImplementedException ();
//WebRequest.PrefixList.Add (new WebRequestPrefixElement(prefix, type));
//continue;
}
if (name == "remove") {
if (child.Attributes != null && child.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", child);
throw new NotImplementedException ();
// WebRequest.RemovePrefix (prefix);
// continue;
}
HandlersUtil.ThrowException ("Unexpected element", child);
}
#endif
return null;
}
示例11: Config
public static void Config(TestContext context)
{
// <system.data>
// <DbProviderFactories>
// <add
// name="Firebird Data Provider"
// invariant="FirebirdSql.Data.FirebirdClient" description="Firebird"
// type="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory, FirebirdSql.Data.FirebirdClient, Version=2.5.2.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c"
// />
// </DbProviderFactories>
// </system.data>
ProviderChecker.Check(ProviderName, ConnectionString);
}
示例12: Create
public virtual object Create (object parent, object configContext, XmlNode section)
{
#if (XML_DEP)
if (section.Attributes != null && section.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", section);
XmlNodeList httpHandlers = section.ChildNodes;
foreach (XmlNode child in httpHandlers) {
XmlNodeType ntype = child.NodeType;
if (ntype == XmlNodeType.Whitespace || ntype == XmlNodeType.Comment)
continue;
if (ntype != XmlNodeType.Element)
HandlersUtil.ThrowException ("Only elements allowed", child);
string name = child.Name;
if (name == "clear") {
if (child.Attributes != null && child.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", child);
AuthenticationManager.Clear ();
continue;
}
string type = HandlersUtil.ExtractAttributeValue ("type", child);
if (child.Attributes != null && child.Attributes.Count != 0)
HandlersUtil.ThrowException ("Unrecognized attribute", child);
if (name == "add") {
AuthenticationManager.Register (CreateInstance (type, child));
continue;
}
if (name == "remove") {
AuthenticationManager.Unregister (CreateInstance (type, child));
continue;
}
HandlersUtil.ThrowException ("Unexpected element", child);
}
return AuthenticationManager.RegisteredModules;
#else
return null;
#endif
}
示例13: ConfigurationException
static internal void ThrowException (string msg, XmlNode node)
{
if (node != null && node.Name != String.Empty)
msg = msg + " (node name: " + node.Name + ") ";
throw new ConfigurationException (msg, node);
}
示例14: ExtractAttributeValue
static internal string ExtractAttributeValue (string attKey, XmlNode node)
{
return ExtractAttributeValue (attKey, node, false);
}
示例15: UpdateSelectedConsoleEntry
public void UpdateSelectedConsoleEntry()
{
//Debug.Log("sdf");
lastConsoleUpdateTime = Time.realtimeSinceStartup;
#if UNITY_EDITOR
System.Type type = null;
//if (consoleWindow == null) {
type = System.Type.GetType("UnityEditor.ConsoleWindow,UnityEditor");
FieldInfo fieldInfo = type.GetField("ms_ConsoleWindow",BindingFlags.NonPublic|BindingFlags.Static);
consoleWindow = fieldInfo.GetValue(null);
//}
//else {
// type = consoleWindow.GetType();
//}
if (consoleWindow == null) return;
FieldInfo activeContextField = type.GetField("m_ActiveContext",BindingFlags.Instance|BindingFlags.Static|BindingFlags.NonPublic);
string activeContext = (string)activeContextField.GetValue(consoleWindow);
FieldInfo activeContextIconField = type.GetField("m_ActiveContextIcon",BindingFlags.Instance|BindingFlags.Static|BindingFlags.NonPublic);
Texture2D activeContextIcon = (Texture2D)activeContextIconField.GetValue(consoleWindow);
if (lastConsoleRawText == activeContext) return;
FieldInfo activeTextField = type.GetField("m_ActiveText",BindingFlags.Instance|BindingFlags.Static|BindingFlags.NonPublic);
string activeText = (string)activeTextField.GetValue(consoleWindow);
currentFileLogEntry = null;
currentLogEntry = null;
forceClosed = false;
wantsReapint = true;
editor.editorWindow.Repaint();
lastConsoleRawText = activeContext;
//compiler error/warnings:
Regex regex = new Regex(@"(?<filename>^Assets/(?:\w+/)*(?:\w+\.\w+)+)\((?:(?<line>\d+),(?<column>\d+))\): ((?<type>warning|error) )?\w+: (?<message>(\.|\n)*)");
Match match = regex.Match(activeText);
if (match.Success) {
string fileName = match.Groups["filename"].Value;
int line = int.Parse(match.Groups["line"].Value);
int column = int.Parse(match.Groups["column"].Value);
string logType = match.Groups["type"].Value;
//string message = match.Groups["message"].Value;
UIDELogEntry logEntry = new UIDELogEntry();
logEntry.fileName = fileName;
logEntry.line = line;
logEntry.column = column;
logEntry.logType = logType;
logEntry.message = "";
if (logEntry.logType == "") {
logEntry.logType = "Unknown Assert";
}
if (fileName == editor.filePath) {
currentFileLogEntry = logEntry;
}
currentLogEntry = logEntry;
//lastEntryChangeTime = Time.realtimeSinceStartup;
return;
}
Regex conRegex = new Regex(@"(?<type>Assert|Log|Error) in file: (?<filename>Assets/(?:\w+/)*(?:\w+\.\w+)+) at line: (?:(?<line>\d+))");
Match conMatch = conRegex.Match(activeContext);
if (conMatch.Success) {
string fileName = conMatch.Groups["filename"].Value;
int line = int.Parse(conMatch.Groups["line"].Value);
int column = 0;
string logType = conMatch.Groups["type"].Value;
if (activeContextIcon != null) {
if (activeContextIcon.name == "d_console.infoicon.sml") {
logType = "Assert";
}
if (activeContextIcon.name == "d_console.erroricon.sml") {
logType = "Runtime Error";
}
}
//string message = activeText;
UIDELogEntry logEntry = new UIDELogEntry();
logEntry.fileName = fileName;
logEntry.line = line;
logEntry.column = column;
logEntry.logType = logType;
logEntry.message = "";
if (logEntry.logType == "") {
logEntry.logType = "Unknown Assert";
}
//d_console.infoicon.sml
//d_console.erroricon.sml
//Debug.Log(activeContextIcon);
if (fileName == editor.filePath) {
currentFileLogEntry = logEntry;
}
currentLogEntry = logEntry;
//Match dum = null;
//Debug.Log(dum.Index);
return;
}
//.........这里部分代码省略.........