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


C# ASObject.Add方法代码示例

本文整理汇总了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;
 }
开发者ID:replic8tor,项目名称:Rustler,代码行数:9,代码来源:BasicSessionInfo.cs

示例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);
        }
开发者ID:mstaessen,项目名称:fluorinefx,代码行数:25,代码来源:AMF0NameObjectCollectionWriter.cs

示例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);
        }
开发者ID:apakian,项目名称:fluorinefx,代码行数:27,代码来源:AMF3NameObjectCollectionWriter.cs

示例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;
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:12,代码来源:AMF3TypedASObjectReader.cs

示例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;
        }
开发者ID:DarkActive,项目名称:daFluorineFx,代码行数:38,代码来源:SqlService.cs

示例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;
		}
开发者ID:ByteSempai,项目名称:Ubiquitous,代码行数:21,代码来源:DataTableTypeAttribute.cs

示例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
            {
//.........这里部分代码省略.........
开发者ID:nbhopson,项目名称:QMail,代码行数:101,代码来源:MailReceiveWorker.cs

示例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);
        }
开发者ID:Gabrola,项目名称:LolService,代码行数:31,代码来源:LolRTMPSClient.cs


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