當前位置: 首頁>>代碼示例>>C#>>正文


C# ASObject.get方法代碼示例

本文整理匯總了C#中ASObject.get方法的典型用法代碼示例。如果您正苦於以下問題:C# ASObject.get方法的具體用法?C# ASObject.get怎麽用?C# ASObject.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ASObject的用法示例。


在下文中一共展示了ASObject.get方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: getMultipleList

        private List<ASObject> getMultipleList(ASObject policy)
        {
            if (policy == null)
                return null;
            List<ASObject> multipleList = null;
            object managers = policy.get("managers");
            if (managers != null && managers is object[])
            {
                multipleList = new List<ASObject>();
                foreach (object o in (object[])managers)
                {
                    if (o is ASObject)
                    {
                        multipleList.Add((ASObject)o);
                    }
                }
            }
            else if (managers != null && managers is List<ASObject>)
            {
                multipleList = new List<ASObject>();
                foreach (ASObject o in (List<ASObject>)managers)
                {
                    multipleList.Add(o);
                }
            }

            return multipleList;
        }
開發者ID:nbhopson,項目名稱:QMail,代碼行數:28,代碼來源:AccountManagerWindow.xaml.cs

示例2: OnMailEvent

        void OnMailEvent(MailWorker.Event eventType, ASObject mail, string[] updateFields)
        {
            switch (eventType)
            {
                case MailWorker.Event.Delete:
                    return;
                case MailWorker.Event.Create:
                    {
                        if (mail == null)
                            return;
                        MailWorker.instance.saveMailRecord(mail);

                        string folder = mail.getString("folder");
                        XElement folderXml = sxml.XPathSelectElement("/mailbox/folder[@name='" + folder + "']");
                        string count = folderXml.AttributeValue("count");
                        if (IsBool(mail.get("is_seen")))
                        {
                            if (count == "(1)" || count == "")
                                folderXml.SetAttributeValue("count", "");
                            else
                            {
                                count = count.Replace("(", "").Replace(")", "");
                                folderXml.SetAttributeValue("count", "(" + (NumberUtil.toLong(count) - 1) + ")");
                            }
                        }
                        else
                        {
                            if (count == "")
                                folderXml.SetAttributeValue("count", "(1)");
                            else
                            {
                                count = count.Replace("(", "").Replace(")", "");
                                folderXml.SetAttributeValue("count", "(" + (NumberUtil.toLong(count) + 1) + ")");
                            }
                        }

                        if (mail["mail_date"] is DateTime && !IsBool(mail.get("is_handled")))
                        {
                            DateTime time = (DateTime)mail["mail_date"];
                            string value = unhandledMailProvider.JudgeTimePhase(time);
                            folderXml = sxml.XPathSelectElement("/folder/folder[@value='" + value + "']");
                            if (folderXml != null)
                            {
                                count = folderXml.AttributeValue("count");
                                if (count == "")
                                    folderXml.SetAttributeValue("count", "(1)");
                                else
                                {
                                    count = count.Replace("(", "").Replace(")", "");
                                    folderXml.SetAttributeValue("count", "(" + (NumberUtil.toLong(count) + 1) + ")");
                                }
                            }
                        }
                    }
                    break;
                case MailWorker.Event.Update:
                    {
                        if (mail == null || updateFields == null || updateFields.Length == 0)
                            return;

                        MailWorker.instance.updateMail(mail, updateFields);

                        bool is_seen = false;
                        bool is_handled = false;
                        foreach (string s in updateFields)
                        {
                            if (s == "is_seen")
                                is_seen = true;
                            else if (s == "is_handled")
                                is_handled = true;
                        }

                        if (is_seen)
                        {
                            string folder = mail.getString("folder");
                            XElement folderXml = sxml.XPathSelectElement("/mailbox/folder[@name='" + folder + "']");
                            string count = folderXml.AttributeValue("count");
                            if (IsBool(mail.get("is_seen")))
                            {
                                if (count == "(1)" || count == "")
                                    folderXml.SetAttributeValue("count", "");
                                else
                                {
                                    count = count.Replace("(", "").Replace(")", "");
                                    folderXml.SetAttributeValue("count", "(" + (NumberUtil.toLong(count) - 1) + ")");
                                }
                            }
                            else
                            {
                                if (count == "")
                                    folderXml.SetAttributeValue("count", "(1)");
                                else
                                {
                                    count = count.Replace("(", "").Replace(")", "");
                                    folderXml.SetAttributeValue("count", "(" + (NumberUtil.toLong(count) + 1) + ")");
                                }
                            }
                        }

                        if (is_handled)
//.........這裏部分代碼省略.........
開發者ID:nbhopson,項目名稱:QMail,代碼行數:101,代碼來源:MailBoxBar.xaml.cs

示例3: getMultipleList

        private List<ASObject> getMultipleList(ASObject policy)
        {
            List<ASObject> multipleList = null;
            object distributors = policy.get("distributor");
            if (distributors != null && distributors is object[])
            {
                multipleList = new List<ASObject>();
                foreach (object o in (object[])distributors)
                {
                    if (o is ASObject)
                    {
                        multipleList.Add((ASObject)o);
                    }
                }
            }
            else if (distributors != null && distributors is List<ASObject>)
            {
                multipleList = new List<ASObject>();
                foreach (ASObject o in (List<ASObject>)distributors)
                {
                    multipleList.Add(o);
                }
            }

            return multipleList;
        }
開發者ID:nbhopson,項目名稱:QMail,代碼行數:26,代碼來源:EmailDistributorWindow.xaml.cs


注:本文中的ASObject.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。