• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# BubbleGroup类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中BubbleGroup的典型用法代码示例。如果您正苦于以下问题:C# BubbleGroup类的具体用法?C# BubbleGroup怎么用?C# BubbleGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BubbleGroup类属于命名空间,在下文中一共展示了BubbleGroup类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetPartyBlockedParticipants

 public Task GetPartyBlockedParticipants(BubbleGroup group, Action<DisaParticipant[]> result)
 {
     return Task.Factory.StartNew(() =>
     {
         var returnList = new List<DisaParticipant>();
         var fullChat = FetchFullChat(group.Address, group.IsExtendedParty);
         var iChatFull = fullChat.FullChat;
         var channelFull = iChatFull as ChannelFull;
         if (channelFull != null)
         {
             var kickedParticipants =  GetChannelParticipants(channelFull, new ChannelParticipantsKicked());
             foreach (var participant in kickedParticipants) 
             {
                 if (participant is ChannelParticipantKicked)
                 {
                     var id = TelegramUtils.GetUserIdFromChannelParticipant(participant);
                     if (id != null)
                     {
                         var user = _dialogs.GetUser(uint.Parse(id));
                         var name = TelegramUtils.GetUserName(user);
                         returnList.Add(new DisaParticipant(name, id));
                     }
                 }
             }
         }
         result(returnList.ToArray());
     });
 }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:28,代码来源:PartyBlockedParticipants.cs


示例2: UpdateGroupLegibleID

        internal static void UpdateGroupLegibleID(BubbleGroup bubbleGroup, Action finished = null)
        {
            var service = bubbleGroup.Service;

            if (!ServiceManager.IsRunning(service)) return;

            try
            {
                service.GetBubbleGroupLegibleId(bubbleGroup, legibleID =>
                {
                    bubbleGroup.LegibleId = legibleID;
                    if (finished == null)
                    {
                        BubbleGroupEvents.RaiseRefreshed(bubbleGroup);
                    }
                    else
                    {
                        finished();
                    }
                });
            }
            catch (Exception ex)
            {
                Utils.DebugPrint("Error updating bubble group legible ID: " + service.Information.ServiceName + ": " +
                                         ex.Message);
                if (finished != null)
                {
                    finished();
                }
            }
        }
开发者ID:akonsand,项目名称:DisaOpenSource,代码行数:31,代码来源:BubbleGroupUpdater.cs


示例3: UnblockPartyParticipant

 public Task UnblockPartyParticipant(BubbleGroup group, DisaParticipant participant, Action<bool> result)
 {
     return Task.Factory.StartNew(() =>
     {
         using (var client = new FullClientDisposable(this))
         {
             try
             {
                 var response = TelegramUtils.RunSynchronously(client.Client.Methods.ChannelsKickFromChannelAsync(new ChannelsKickFromChannelArgs
                 {
                     Channel = new InputChannel
                     {
                         ChannelId = uint.Parse(group.Address),
                         AccessHash = TelegramUtils.GetChannelAccessHash(_dialogs.GetChat(uint.Parse(group.Address)))
                     },
                     Kicked = false,
                     UserId = new InputUser
                     {
                         UserId = uint.Parse(participant.Address),
                         AccessHash = GetUserAccessHashIfForeign(participant.Address)
                     }
                 }));
                 result(true);
             }
             catch (Exception e)
             {
                 DebugPrint("#### Exception " + e);
                 result(false);
             }
         }
     });
 }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:32,代码来源:PartyBlockedParticipants.cs


示例4: CanAddPartyParticipant

 public Task CanAddPartyParticipant(BubbleGroup group, Action<bool> result)
 {
     return Task.Factory.StartNew(() =>
     {
         var fullChat = FetchFullChat(group.Address, group.IsExtendedParty);
         var partyParticipants = GetPartyParticipants(fullChat);
         if (!IsPartOfParty(partyParticipants))
         {
             result(false);
             return;
         }
         if (ChatAdminsEnabled(group.Address))
         {
             if (group.IsExtendedParty && IsDemocracyEnabled(group))
             {
                 //if democracy is enabled in a spergroup anyone can add members
                 result(true);
                 return;
             }
             if (!IsAdmin(group.Address, group.IsExtendedParty))
             {
                 result(false);
                 return;
             }
         }
         result(true);
     });
 }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:28,代码来源:PartyOptions.cs


示例5: Find

        public BubbleGroupFinderResult Find()
        {
            var groups = new List<BubbleGroup>();

            // If a group is still valid for this grid, we don't need to search for it again
            // Turns out this is a bad optimisation - needs profiling
            //groups.AddRange(_parentGroups.Where(x => x.IsValidFor(_grid)));

            for (int y = 0; y < _grid.Height; y++)
            {
                for (int x = 0; x < _grid.Width; x++)
                {
                    if(!_stats.ContainsKey(_grid[x,y])) _stats.Add(_grid[x,y], 1);
                    else _stats[_grid[x, y]]++;

                    if (!groups.Any(group => group.Locations.Contains(new Point(x, y))))
                    {
                        _currentGroup = new BubbleGroup();
                        FindBubbleGroup(x, y);
                        if (_currentGroup.Locations.Count > 1 && _currentGroup.Colour != Bubble.None)
                        {
                            groups.Add(_currentGroup);
                        }
                    }
                }
            }
            return new BubbleGroupFinderResult(groups, _stats);
        }
开发者ID:gkinsman,项目名称:BubbleBurst,代码行数:28,代码来源:BubbleGroupFinder.cs


示例6: InsertDefaultIfNull

 private static void InsertDefaultIfNull(BubbleGroup group)
 {
     lock (_lock)
     {
         if (group.Settings == null)
         {
             using (var db = new SqlDatabase<BubbleGroupSettings>(GetPath()))
             {
                 var settings = new BubbleGroupSettings
                 {
                     Mute = false,
                     Unread = true,
                     Guid = group.ID,
                     LastUnreadSetTime = 0,
                     ReadTimes = null,
                     ParticipantNicknames = null,
                     NotificationLed = DefaultNotificationLedColor,
                     VibrateOption = null,
                     VibrateOptionCustomPattern = null,
                     Ringtone = null,
                 };
                 db.Add(settings);
                 group.Settings = settings;
             }
         }
     }
 }        
开发者ID:StefanTischler,项目名称:DisaOpenSource,代码行数:27,代码来源:BubbleGroupSettingsManager.cs


示例7: CreateUnified

        public static UnifiedBubbleGroup CreateUnified(List<BubbleGroup> groups, BubbleGroup primaryGroup)
        {
            lock (BubbleGroupDatabase.OperationLock)
            {
                var unifiedGroupsToKill = new HashSet<UnifiedBubbleGroup>();
                foreach (var group in groups)
                {
                    if (group.IsUnified)
                    {
                        unifiedGroupsToKill.Add(group.Unified);
                        @group.DeregisterUnified();
                    }
                }
                foreach (var unifiedGroup in unifiedGroupsToKill)
                {
                    BubbleGroupManager.BubbleGroupsRemove(unifiedGroup);
                }
                UnifiedBubbleGroupsDatabase.Remove(unifiedGroupsToKill);

                var unified = CreateUnifiedInternal(groups, primaryGroup);
                UnifiedBubbleGroupsDatabase.Add(unified,
                    new DisaUnifiedBubbleGroupEntry(unified.ID,
                        unified.Groups.Select(innerGroup => innerGroup.ID)
                        .ToArray(), primaryGroup.ID, primaryGroup.ID));
                BubbleGroupManager.BubbleGroupsAdd(unified);
                return unified;
            }
        }
开发者ID:Zaldroc,项目名称:DisaOpenSource,代码行数:28,代码来源:BubbleGroupFactory.cs


示例8: Delete

        public static void Delete(BubbleGroup group)
        {
            lock (BubbleGroupDatabase.OperationLock)
            {
                var unifiedGroup = @group as UnifiedBubbleGroup;
                if (unifiedGroup != null)
                {
                    DeleteUnified(unifiedGroup);
                    return;
                }

                var file = BubbleGroupDatabase.GetLocation(@group);

                if (File.Exists(file))
                {
                    File.Delete(file);
                }

                BubbleGroupSync.RemoveFromSync(@group);

                BubbleGroupSync.DeleteBubbleGroupIfHasAgent(@group);

                BubbleGroupManager.BubbleGroupsRemove(@group);
            }
        }
开发者ID:Zaldroc,项目名称:DisaOpenSource,代码行数:25,代码来源:BubbleGroupFactory.cs


示例9: GetPartyBlockedParticipantPicture

 public Task GetPartyBlockedParticipantPicture(BubbleGroup group, string address, Action<DisaThumbnail> result)
 {
     return Task.Factory.StartNew(() =>
     {
         result(GetThumbnail(address, false, true));
     });
 }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:7,代码来源:PartyBlockedParticipants.cs


示例10: CreateUnified

        public static UnifiedBubbleGroup CreateUnified(List<BubbleGroup> groups, BubbleGroup primaryGroup)
        {
            lock (BubbleGroupDatabase.OperationLock)
            {
                var unifiedGroupsToKill = new HashSet<UnifiedBubbleGroup>();
                foreach (var group in groups)
                {
                    if (group.IsUnified)
                    {
                        unifiedGroupsToKill.Add(group.Unified);
                        @group.DeregisterUnified();
                    }
                }
                foreach (var unifiedGroup in unifiedGroupsToKill)
                {
                    BubbleGroupManager.BubbleGroupsRemove(unifiedGroup);
                }
                BubbleGroupIndex.RemoveUnified(unifiedGroupsToKill.Select(x => x.ID).ToArray());

                var unified = CreateUnifiedInternal(groups, primaryGroup);
                BubbleGroupIndex.AddUnified(unified);
                BubbleGroupManager.BubbleGroupsAdd(unified);
                return unified;
            }
        }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:25,代码来源:BubbleGroupFactory.cs


示例11: LoadBubbles

 public Task<List<VisualBubble>> LoadBubbles(BubbleGroup @group, long fromTime, int max = 100)
 {
     return Task<List<VisualBubble>>.Factory.StartNew(() =>
     {
         return LoadBubblesForBubbleGroup(group, fromTime, max);
     });
 }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:7,代码来源:SyncAgent.cs


示例12: LoadBubblesForBubbleGroup

        private List<VisualBubble> LoadBubblesForBubbleGroup(BubbleGroup @group, long fromTime, int max)
        {
            var response = GetMessageHistory(group, fromTime, max);
            var messages = response as MessagesMessages;
            var messagesSlice = response as MessagesMessagesSlice;
            var messagesChannels = response as MessagesChannelMessages;
            if (messages != null)
            {
                _dialogs.AddChats(messages.Chats);
                _dialogs.AddUsers(messages.Users);
                //DebugPrint("Messages are as follows " + ObjectDumper.Dump(messages.Messages));
                messages.Messages.Reverse();
                return ConvertMessageToBubbles(messages.Messages);

            }
            if (messagesSlice != null)
            {
                _dialogs.AddChats(messagesSlice.Chats);
                _dialogs.AddUsers(messagesSlice.Users);
                //DebugPrint("Messages are as follows " + ObjectDumper.Dump(messagesSlice.Messages));
                messagesSlice.Messages.Reverse();
                return ConvertMessageToBubbles(messagesSlice.Messages);
            }
            if (messagesChannels != null)
            {
                _dialogs.AddChats(messagesChannels.Chats);
                _dialogs.AddUsers(messagesChannels.Users);
                messagesChannels.Messages.Reverse();
                var bubbles = ConvertMessageToBubbles(messagesChannels.Messages);
                SetExtendedFlag(bubbles);
                return bubbles;
            }
            return new List<VisualBubble>();
        }
开发者ID:harper10,项目名称:DisaOpenSource,代码行数:34,代码来源:SyncAgent.cs


示例13: UpdateName

        internal static void UpdateName(BubbleGroup bubbleGroup, Action finished = null)
        {
            var service = bubbleGroup.Service;

            if (!ServiceManager.IsRunning(service)) return;

            try
            {
                service.GetBubbleGroupName(bubbleGroup, title =>
                {
                    bubbleGroup.IsTitleSetFromService = true;
                    bubbleGroup.Title = title;
                    if (finished == null)
                    {
                        BubbleGroupEvents.RaiseRefreshed(bubbleGroup);
                        BubbleGroupEvents.RaiseInformationUpdated(bubbleGroup);
                    }
                    else
                    {
                        finished();
                    }
                });
            }
            catch (Exception ex)
            {
                Utils.DebugPrint("Error updating bubble group name: " + service.Information.ServiceName + ": " +
                                         ex.Message);
                if (finished != null)
                {
                    finished();
                }
            }
        }
开发者ID:akonsand,项目名称:DisaOpenSource,代码行数:33,代码来源:BubbleGroupUpdater.cs


示例14: RaiseSyncReset

 internal static void RaiseSyncReset(BubbleGroup group)
 {
     if (_syncReset != null)
     {
         _syncReset(group);
     }
 }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:7,代码来源:BubbleGroupEvents.cs


示例15: GetLocation

        public static string GetLocation(BubbleGroup theGroup)
        {
            var tableLocation = GetServiceLocation(theGroup.Service.Information);
            var groupLocation = Path.Combine(tableLocation,
                theGroup.Service.Information.ServiceName + "^" + theGroup.ID + ".group");

            return groupLocation;
        }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:8,代码来源:BubbleGroupDatabase.cs


示例16: UnifiedBubbleGroup

 public UnifiedBubbleGroup(List<BubbleGroup> groups, BubbleGroup primaryGroup,
     VisualBubble initialBubble, string id = null)
     : base(initialBubble, id, false)
 {
     _unifiedService = initialBubble.Service;
     Groups = groups;
     PrimaryGroup = primaryGroup;
     SendingGroup = primaryGroup;
 }
开发者ID:Zaldroc,项目名称:DisaOpenSource,代码行数:9,代码来源:UnifiedBubbleGroup.cs


示例17: UpdatePhoto

        public static bool UpdatePhoto(BubbleGroup bubbleGroup, Action<DisaThumbnail> finished)
        {
            var service = bubbleGroup.Service;

            if (!ServiceManager.IsRunning(service))
                return false;

            if (bubbleGroup.Service.Information.UsesInternet && !Platform.HasInternetConnection())
                return false;

            try
            {
                service.GetBubbleGroupPhoto(bubbleGroup, photo =>
                {
                    if (photo != null && photo.Failed)
                    {
                        if (finished != null)
                        {
                            finished(bubbleGroup.Photo);
                        }
                        return;
                    }

                    Action<DisaThumbnail> callbackFinished = thePhoto =>
                    {
                        bubbleGroup.Photo = thePhoto;
                        bubbleGroup.IsPhotoSetFromService = true;
                        if (finished != null)
                        {
                            finished(bubbleGroup.Photo);
                        }
                    };

                    if (photo == null && bubbleGroup.IsParty)
                    {
                        BubbleGroupUtils.StitchPartyPhoto(bubbleGroup, callbackFinished);
                    }
                    else
                    {
                        callbackFinished(photo);
                    }
                });
            }
            catch (Exception ex)
            {
                Utils.DebugPrint("Error updating bubble group photo: " + 
                                         service.Information.ServiceName + ": " + ex.Message);
                if (finished != null)
                {
                    finished(null);
                }
            }

            return true;
        }
开发者ID:akonsand,项目名称:DisaOpenSource,代码行数:55,代码来源:BubbleGroupUpdater.cs


示例18: BubbleGroupsAdd

 public static void BubbleGroupsAdd(BubbleGroup group, bool initialLoad = false)
 {
     lock (BubbleGroupsLock)
     {
         BubbleGroups.Add(group);
         if (!initialLoad && !(group is UnifiedBubbleGroup))
         {
             BubbleGroupIndex.Add(group);
         }
     }
 }
开发者ID:harper10,项目名称:DisaOpenSource,代码行数:11,代码来源:BubbleGroupManager.cs


示例19: Generate

 private static BubbleGroupCache Generate(BubbleGroup group, string guid)
 {
     var bubbleGroupCache = new BubbleGroupCache
     {
         Name = group.Title,
         Photo = group.Photo,
         Participants = group.Participants.ToList(),
         Guid = guid,
     };
     return bubbleGroupCache;
 }
开发者ID:akonsand,项目名称:DisaOpenSource,代码行数:11,代码来源:BubbleGroupCacheManager.cs


示例20: CanSetPartyAllMembersAdministratorsRestriction

 public Task CanSetPartyAllMembersAdministratorsRestriction(BubbleGroup group, Action<bool> result)
 {
     return Task.Factory.StartNew(() =>
     {
         if (!group.IsExtendedParty && IsCreator(group.Address, group.IsExtendedParty))
         {
             result(true);
         }
         else
         {
             result(false);
         }
     });
 }
开发者ID:harper10,项目名称:DisaOpenSource,代码行数:14,代码来源:PartyOptionsSettings.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Bucket类代码示例发布时间:2022-05-24
下一篇:
C# Btree类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap