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


C# Account.GetProperty方法代码示例

本文整理汇总了C#中Account.GetProperty方法的典型用法代码示例。如果您正苦于以下问题:C# Account.GetProperty方法的具体用法?C# Account.GetProperty怎么用?C# Account.GetProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Account的用法示例。


在下文中一共展示了Account.GetProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandleAccountReceivedRoster

 public void HandleAccountReceivedRoster(Account account)
 {
     if (account.ConnectionState == AccountConnectionState.Connected &&
         String.IsNullOrEmpty(account.GetProperty("AskedAboutOctyBot")) &&
         account.Roster[OCTYBOT_JID] == null)
     {
         account.SetProperty("AskedAboutOctyBot", "true");
         QApplication.Invoke(delegate {
             var octyDialog = new AddOctyDialog();
             if (octyDialog.Exec() == (int)QDialog.DialogCode.Accepted) {
                 AddOcty(account);
             }
         });
     }
 }
开发者ID:jrudolph,项目名称:synapse,代码行数:15,代码来源:OctyService.cs

示例2: AccountStatusWidget

        public AccountStatusWidget(Account account, RosterWidget parent, MainWindow parentWindow)
            : base(parent)
        {
            SetupUi();

            m_ParentWindow = parentWindow;

            m_EditProfileDialog = new EditProfileDialog(account, this.TopLevelWidget());

            m_AvatarLabel.Cursor = new QCursor(CursorShape.PointingHandCursor);
            m_AvatarLabel.Clicked += delegate {
                if (m_Account.ConnectionState == AccountConnectionState.Connected) {
                    m_EditProfileDialog.Show(2);
                    m_EditProfileDialog.ActivateWindow();
                } else {
                    // FIXME: It really wouldn't be so hard to make this work.
                    // On connect, check to see if it was changed and update server.
                    QMessageBox.Warning(this.TopLevelWidget(), "Synapse", "Cannot edit avatar when you're not connected.");
                }
            };

            m_Account = account;
            m_Account.ConnectionStateChanged += OnAccountStateChanged;
            m_Account.StatusChanged += OnAccountStateChanged;
            m_Account.MyVCardUpdated += HandleMyVCardUpdated;
            m_Account.AvatarManager.AvatarUpdated += HandleAvatarUpdated;
            OnAccountStateChanged(account);

            HandleAvatarUpdated(m_Account.Jid.Bare, null);

            HandleMyVCardUpdated(null, EventArgs.Empty);
            m_NameLabel.TextFormat = TextFormat.RichText;

            HandleAvatarUpdated(m_Account.Jid.Bare, m_Account.GetProperty("AvatarHash"));

            m_PresenceMenu = new QMenu(this);
            QObject.Connect(m_PresenceMenu, Qt.SIGNAL("aboutToShow()"), HandlePresenceMenuAboutToShow);
            QObject.Connect<QAction>(m_PresenceMenu, Qt.SIGNAL("triggered(QAction*)"), HandlePresenceMenuTriggered);

            QActionGroup group = new QActionGroup(this);
            group.Exclusive = true;

            m_AvailableAction = m_PresenceMenu.AddAction("Available");
            group.AddAction(m_AvailableAction);
            m_AvailableAction.Checkable = true;

            m_FreeToChatAction = m_PresenceMenu.AddAction("Free To Chat");
            group.AddAction(m_FreeToChatAction);
            m_FreeToChatAction.Checkable = true;

            m_AwayAction = m_PresenceMenu.AddAction("Away");
            group.AddAction(m_AwayAction);
            m_AwayAction.Checkable = true;

            m_ExtendedAwayAction = m_PresenceMenu.AddAction("Extended Away");
            group.AddAction(m_ExtendedAwayAction);
            m_ExtendedAwayAction.Checkable = true;

            m_DoNotDisturbAction = m_PresenceMenu.AddAction("Do Not Disturb");
            group.AddAction(m_DoNotDisturbAction);
            m_DoNotDisturbAction.Checkable = true;

            m_PresenceMenu.AddSeparator();

            m_OfflineAction = m_PresenceMenu.AddAction("Offline");
            group.AddAction(m_OfflineAction);
            m_OfflineAction.Checkable = true;
        }
开发者ID:jrudolph,项目名称:synapse,代码行数:68,代码来源:AccountStatusWidget.cs


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