本文整理汇总了C#中ASObject.Add方法的典型用法代码示例。如果您正苦于以下问题:C# ASObject.Add方法的具体用法?C# ASObject.Add怎么用?C# ASObject.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ASObject
的用法示例。
在下文中一共展示了ASObject.Add方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToRequestObject
public FluorineFx.ASObject ToRequestObject()
{
FluorineFx.ASObject retVal = new ASObject();
retVal.Add("sigTime", _sigTime);
retVal.Add("token", _token);
retVal.Add("flashRevision", _flashRevision);
retVal.Add("userId", _userId);
return retVal;
}
示例2: WriteData
public void WriteData(AMFWriter writer, object data)
{
var collection = data as NameObjectCollectionBase;
var attributes = collection.GetType().GetCustomAttributes(typeof(DefaultMemberAttribute), false);
if (attributes != null && attributes.Length > 0)
{
var defaultMemberAttribute = attributes[0] as DefaultMemberAttribute;
var pi = collection.GetType().GetProperty(defaultMemberAttribute.MemberName, new[] { typeof(string) });
if (pi != null)
{
var aso = new ASObject();
for (var i = 0; i < collection.Keys.Count; i++)
{
var key = collection.Keys[i];
var value = pi.GetValue(collection, new object[]{ key });
aso.Add(key, value);
}
writer.WriteASO(ObjectEncoding.AMF0, aso);
return;
}
}
//We could not access an indexer so write out as it is.
writer.WriteObject(ObjectEncoding.AMF0, data);
}
示例3: WriteData
public void WriteData(AMFWriter writer, object data)
{
NameObjectCollectionBase collection = data as NameObjectCollectionBase;
object[] attributes = collection.GetType().GetCustomAttributes(typeof(DefaultMemberAttribute), false);
if (attributes != null && attributes.Length > 0)
{
DefaultMemberAttribute defaultMemberAttribute = attributes[0] as DefaultMemberAttribute;
PropertyInfo pi = collection.GetType().GetProperty(defaultMemberAttribute.MemberName, new Type[] { typeof(string) });
if (pi != null)
{
ASObject aso = new ASObject();
for (int i = 0; i < collection.Keys.Count; i++)
{
string key = collection.Keys[i];
object value = pi.GetValue(collection, new object[]{ key });
aso.Add(key, value);
}
writer.WriteByte(AMF3TypeCode.Object);
writer.WriteAMF3Object(aso);
return;
}
}
//We could not access an indexer so write out as it is.
writer.WriteByte(AMF3TypeCode.Object);
writer.WriteAMF3Object(data);
}
示例4: ReadData
public object ReadData(AMFReader reader, ClassDefinition classDefinition) {
ASObject aso = new ASObject(_typeIdentifier);
reader.AddAMF3ObjectReference(aso);
string key = reader.ReadAMF3String();
aso.TypeName = _typeIdentifier;
while (key != string.Empty) {
object value = reader.ReadAMF3Data();
aso.Add(key, value);
key = reader.ReadAMF3String();
}
return aso;
}
示例5: SubmitQuery
public object SubmitQuery(string url, string sql)
{
Hashtable result = new Hashtable();
try
{
DomainUrl domainUrl = new DomainUrl(url);
Driver driver = DriverFactory.GetDriver(domainUrl);
using (IDbConnection dbConnection = driver.OpenConnection())
{
IDbCommand command = driver.GetDbCommand(sql, dbConnection);
IDbDataAdapter adapter = driver.GetDbDataAdapter();
adapter.SelectCommand = command;
DataSet dataSet = new DataSet();
adapter.Fill(dataSet);
ASObject asoResult = new ASObject();
DataTable dataTable = dataSet.Tables[0];
ArrayList rows = new ArrayList(dataTable.Rows.Count);
for (int i = 0; i < dataTable.Rows.Count; i++)
{
DataRow dataRow = dataTable.Rows[i];
ASObject asoRow = new ASObject();
for (int j = 0; j < dataTable.Columns.Count; j++)
{
DataColumn column = dataTable.Columns[j];
asoRow.Add(column.ColumnName, dataRow[column]);
}
rows.Add(asoRow);
}
result["result"] = rows;
}
}
catch (Exception ex)
{
result["message"] = ex.Message;
}
return result;
}
示例6: ConvertDataTable
private ArrayList ConvertDataTable(DataTable dataTable)
{
ArrayList result = new ArrayList(dataTable.Rows.Count);
for(int i = 0; i < dataTable.Rows.Count; i++)
{
DataRow dataRow = dataTable.Rows[i];
ASObject aso = new ASObject(_remoteClass);
for(int j = 0; j < dataTable.Columns.Count; j++)
{
DataColumn column = dataTable.Columns[j];
/*
object value = null;
if( !dataRow.IsNull(column) )
value = dataRow[column];
*/
aso.Add(column.ColumnName, dataRow[column]);
}
result.Add(aso);
}
return result;
}
示例7: saveMail
private ASObject saveMail(Mail_Message m, string uid, string mail_uid, string file)
{
workInfo.IsNewMail = true;
DirectoryInfo dirinfo = Directory.GetParent(store_path + file);
string dir = dirinfo.FullName + "/" + uid + ".parts";
Directory.CreateDirectory(dir);
ASObject record = new ASObject();
record.Add("uuid", uid);
record.Add("owner_user_id", wos.library.Desktop.instance.loginedPrincipal.id);
try
{
string subject = m.Subject;
if (subject == null)
subject = "";
else if (subject.IndexOf("&#") != -1)
{
subject = HttpUtility.HtmlDecode(subject);
}
record.Add("subject", subject);
}
catch (Exception)
{
record.Add("subject", "");
}
try
{
record.Add("sender", m.Sender == null ? "" : m.Sender.ToString());
}
catch (Exception)
{
record.Add("sender", "");
}
try
{
record.Add("mail_to", m.To == null ? "" : m.To.ToString());
if (m.To != null && m.To.Mailboxes.Count() > 0)
record.Add("mail_to_label", getMailBoxLabel(m.To.Mailboxes[0]));
}
catch (Exception)
{
record.Add("mail_to", "");
}
try
{
record.Add("reply_to", m.ReplyTo == null ? "" : m.ReplyTo.ToString());
}
catch (Exception)
{
record.Add("reply_to", "");
}
try
{
record.Add("mail_from", m.From == null ? "" : m.From.ToString());
if (m.From != null && m.From.Count > 0)
{
record.Add("mail_from_label", getMailBoxLabel(m.From[0]));
record.Add("contact_mail", m.From[0].Address);
}
}
catch (Exception)
{
record.Add("mail_from", "");
record.Add("contact_mail", "");
}
//阅读回折
if (m.DispositionNotificationTo != null && m.DispositionNotificationTo.Count > 0)
record.Add("flags", "RECEIPT");
else
record.Add("flags", "RECENT");
try
{
if (Setting.IsSpamMail(m))
{
record.Add("mail_type", (int)DBWorker.MailType.SpamMail);
record.Add("folder", "SPAM");
}
else
{
record.Add("mail_type", (int)DBWorker.MailType.RecvMail);
record.Add("folder", "INBOX");
}
}
catch (Exception)
{
record.Add("mail_type", (int)DBWorker.MailType.RecvMail);
record.Add("folder", "INBOX");
}
try
{
record.Add("cc", m.Cc == null ? "" : m.Cc.ToString());
}
catch (Exception)
{
record.Add("cc", "");
}
try
{
//.........这里部分代码省略.........
示例8: SendLoginInfo
private void SendLoginInfo()
{
ASObject body = new ASObject();
body.Add("username", Username.ToLower());
body.Add("password", Password);
body.Add("authToken", AuthToken);
body.Add("clientVersion", ClientVersion);
body.Add("ipAddress", IPAddress);
body.Add("locale", "en_US");
body.Add("domain", "lolclient.lol.riotgames.com");
body.Add("operatingSystem", "LolService");
body.Add("securityAnswer", null);
body.Add("oldPassword", null);
body.Add("partnerCredentials", null);
body.TypeName = "com.riotgames.platform.login.AuthenticationCredentials";
Notify result = base.InvokeRemotingMessage("loginService", "login", new object[] { body });
if (RtmpUtil.IsError(result))
{
ErrorMessage error = RtmpUtil.GetError(result);
Form1.Log("Error = " + error.faultString);
return;
}
ASObject args = (ASObject)RtmpUtil.GetBodies(result).FirstOrDefault().Item1;
ASObject AccountSummary = (ASObject)args["accountSummary"];
this.SessionToken = (string)args["token"];
this.AccountID = Convert.ToInt32(AccountSummary["accountId"]);
Form1.Log("SessionToken = " + SessionToken);
Form1.Log("Account ID: " + AccountID);
}