當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。