当前位置: 首页>>代码示例>>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;未经允许,请勿转载。