Ejemplo n.º 1
0
 public CacheAttribute(string group, string name, CacheMode cacheMode)
 {
     Group = group;
     Name = name;
     this.CacheMode = cacheMode;
     this.CacheType = CacheType.Fetch;
 }
		public NamedSQLQueryDefinition(
			string query,
			string resultSetRef,
			IList<string> querySpaces,
			bool cacheable,
			string cacheRegion,
			int timeout,
			int fetchSize,
			FlushMode flushMode,
			CacheMode? cacheMode,
			bool readOnly,
			string comment,
			IDictionary<string, string> parameterTypes,
			bool callable)
			: base(
				query.Trim(), /* trim done to workaround stupid oracle bug that cant handle whitespaces before a { in a sp */
				cacheable,
				cacheRegion,
				timeout,
				fetchSize,
				flushMode,
				cacheMode,
				readOnly,
				comment,
				parameterTypes
				)
		{
			this.resultSetRef = resultSetRef;
			this.querySpaces = querySpaces;
			this.callable = callable;
		}
        /// <summary>
        /// Initializes a new instance of the ImageListViewCacheManager class.
        /// </summary>
        /// <param name="owner">The owner control.</param>
        public ImageListViewCacheManager(ImageListView owner)
        {
            lockObject = new object();

            mImageListView = owner;
            mCacheMode = CacheMode.OnDemand;
            mCacheLimitAsItemCount = 0;
            mCacheLimitAsMemory = 20 * 1024 * 1024;
            mRetryOnError = owner.RetryOnError;

            toCache = new Stack<CacheItem>();
            thumbCache = new Dictionary<Guid, CacheItem>();
            editCache = new Dictionary<Guid, Image>();

            rendererToCache = new Stack<CacheItem>();
            rendererGuid = new Guid();
            rendererItem = null;

            memoryUsed = 0;
            memoryUsedByRemoved = 0;
            removedItems = new List<Guid>();

            mThread = new Thread(new ThreadStart(DoWork));
            mThread.IsBackground = true;

            stopping = false;
            stopped = false;
            disposed = false;

            mThread.Start();
            while (!mThread.IsAlive) ;
        }
 private JetImageLoaderConfig(Builder builder)
 {
     IsLogEnabled     = builder.IsLogEnabled;
     CacheMode        = builder.CacheMode;
     DownloaderImpl   = builder.DownloaderImpl;
     MemoryCacheImpl  = builder.MemoryCacheImpl;
     StorageCacheImpl = builder.StorageCacheImpl;
 }
Ejemplo n.º 5
0
 public DataMonitor(string connStr, string cmdStr, CommandType type, CacheMode mode)
 {
     _mode = mode;
     _conn = new SqlConnection(connStr);
     _cmd = new SqlCommand(cmdStr, _conn);
     _cmd.CommandType = type;
     if (_conn.State == ConnectionState.Closed)
         _conn.Open();
 }
Ejemplo n.º 6
0
        private static List<Book> loadFromWeb(CacheMode cMode, string[] testNumbers)
        {
            List<Book> books = new List<Book>();

            foreach (string number in testNumbers)
            {
                Book newBook = new Book(number);
                newBook.LoadFromApi(cMode == CacheMode.NO);
                books.Add(newBook);
            }

            return books;
        }
Ejemplo n.º 7
0
 public virtual ICache GetCacheHandler(CacheMode cacheMode)
 {
     switch (cacheMode)
     {
         case CacheMode.Local:
             return LocalCache;
         case CacheMode.Session:
             return SessionCache;
         case CacheMode.Request:
             return RequestCache;
         default:
             throw new NotImplementedException("CacheMode =" + cacheMode);
     }
 }
		public NamedQueryDefinition(
			string query,
			bool cacheable,
			string cacheRegion,
			int timeout,
			int fetchSize,
			FlushMode flushMode,
			CacheMode? cacheMode,
			bool readOnly,
			string comment,
			IDictionary<string,string> parameterTypes
			)
		{
			this.query = query;
			this.cacheable = cacheable;
			this.cacheRegion = cacheRegion;
			this.timeout = timeout;
			this.fetchSize = fetchSize;
			this.flushMode = flushMode;
			this.parameterTypes = parameterTypes;
			this.cacheMode = cacheMode;
			this.readOnly = readOnly;
			this.comment = comment;
		}
Ejemplo n.º 9
0
 public CacheReadAttribute(CacheMode mode, bool shouldInvalidateOnError) : base(mode, shouldInvalidateOnError)
 {
 }
Ejemplo n.º 10
0
 void HandleCacheFlushing(CacheMode newCacheMode, int cacheDelta, Texture newTexture)
 {
     if (currentCacheMode != newCacheMode || m_RenderState.Texture != (newTexture == null ? null : newTexture.sfTexture) || m_CacheSize + cacheDelta >= CacheSize) {
         FlushCache();
         m_RenderState.Texture = (newTexture == null ? null : newTexture.sfTexture);
         currentCacheMode = newCacheMode;
     }
 }
Ejemplo n.º 11
0
 public CacheReadAttribute(CacheMode mode, string lifeSpanRepresentation, bool shouldInvalidateOnError) : base(mode, lifeSpanRepresentation, shouldInvalidateOnError)
 {
 }
		public override IDetachedQuery SetCacheMode(CacheMode cacheMode)
		{
			cacheModeWasSet = true;
			return base.SetCacheMode(cacheMode);
		}
Ejemplo n.º 13
0
 /// <inheritdoc />
 public async Task <IMessage> GetMessageAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
 => (await(SocketGroupChannel as IMessageChannel).GetMessageAsync(id, mode, options))
 ?.Abstract();
Ejemplo n.º 14
0
 /// <inheritdoc />
 async Task <IReadOnlyCollection <IVoiceChannel> > IGuild.GetVoiceChannelsAsync(CacheMode mode, RequestOptions options)
 {
     if (mode == CacheMode.AllowDownload)
     {
         return(await GetVoiceChannelsAsync(options).ConfigureAwait(false));
     }
     else
     {
         return(ImmutableArray.Create <IVoiceChannel>());
     }
 }
Ejemplo n.º 15
0
        public void Start(CacheMode mode)
        {
            if(_dep != null)
                Stop();

            _dep = new SqlDependency(_cmd);
            _dep.OnChange += new OnChangeEventHandler(this.OnDataChange);
        
            if (OnData != null)
            {
                log.DebugFormat("DataMonitor [{0}] bubbled notification event to host.", Id);
                DataTable dt = GetData();
                if (mode != CacheMode.Initialize)
                    OnData(this, dt);
            }
        }
 /// <inheritdoc />
 IAsyncEnumerable <IReadOnlyCollection <IGuildUser> > IGuildChannel.GetUsersAsync(CacheMode mode, RequestOptions options)
 {
     return(mode == CacheMode.AllowDownload
         ? ChannelHelper.GetUsersAsync(this, Guild, Discord, null, null, options)
         : ImmutableArray.Create <IReadOnlyCollection <IGuildUser> >(Users).ToAsyncEnumerable());
 }
Ejemplo n.º 17
0
 public Task <IReadOnlyCollection <IAuditLogEntry> > GetAuditLogsAsync(int limit = 100, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null, ulong?beforeId = null, ulong?userId = null, ActionType?actionType = null)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 18
0
 /// <inheritdoc />
 public async Task <IReadOnlyCollection <IVoiceChannel> > GetVoiceChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
 => (await(SocketGuild as IGuild).GetVoiceChannelsAsync(mode, options))
 .Select(VoiceChannelAbstractionExtensions.Abstract)
 .ToArray();
Ejemplo n.º 19
0
 /// <inheritdoc />
 public async Task <IVoiceChannel> GetVoiceChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
 => (await(SocketGuild as IGuild).GetVoiceChannelAsync(id, mode, options))
 ?.Abstract();
Ejemplo n.º 20
0
 /// <inheritdoc />
 public async Task <ITextChannel> GetSystemChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
 => (await(SocketGuild as IGuild).GetSystemChannelAsync(mode, options))
 .Abstract();
Ejemplo n.º 21
0
 /// <inheritdoc />
 public async Task <IGuildUser> GetOwnerAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
 => (await(SocketGuild as IGuild).GetOwnerAsync(mode, options))
 .Abstract();
Ejemplo n.º 22
0
 public CacheAttribute(string group, string name, CacheMode cacheMode, CacheType cacheType)
     : this(group, name, cacheMode)
 {
     CacheType = cacheType;
 }
Ejemplo n.º 23
0
 public CacheReadAttribute(CacheMode mode) : base(mode)
 {
 }
Ejemplo n.º 24
0
 public IAsyncEnumerable <IReadOnlyCollection <IMessage> > GetMessagesAsync(IMessage fromMessage, Direction dir, int limit = 100, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 25
0
 /// <inheritdoc />
 public async Task <IReadOnlyCollection <IAuditLogEntry> > GetAuditLogsAsync(int limit = 100, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
 => (await(SocketGuild as IGuild).GetAuditLogsAsync(limit, mode, options))
 .Select(AuditLogEntryAbstractionExtensions.Abstract)
 .ToArray();
Ejemplo n.º 26
0
 public Task <IUser> GetUserAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 27
0
 /// <summary> Override the current session cache mode, just for this query.
 /// </summary>
 /// <param name="cacheMode">The cache mode to use. </param>
 /// <returns> this (for method chaining) </returns>
 public IQuery SetCacheMode(CacheMode cacheMode)
 {
     this.cacheMode = cacheMode;
     return(this);
 }
Ejemplo n.º 28
0
 public IAsyncEnumerable <IReadOnlyCollection <IUser> > GetUsersAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 29
0
 /// <inheritdoc />
 public IAsyncEnumerable <IReadOnlyCollection <IMessage> > GetMessagesAsync(int limit = 100, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
 => (SocketGroupChannel as IMessageChannel).GetMessagesAsync(limit, mode, options)
 .Select(x => x
         .Select(MessageAbstractionExtensions.Abstract)
         .ToArray());
        public static IAsyncEnumerable <IReadOnlyCollection <IMessage> > GetMessagesAsync(ISocketMessageChannel channel, DiscordSocketClient discord, MessageCache messages,
                                                                                          ulong?fromMessageId, Direction dir, int limit, CacheMode mode, RequestOptions options)
        {
            if (dir == Direction.Around)
            {
                throw new NotImplementedException(); //TODO: Impl
            }
            IReadOnlyCollection <SocketMessage> cachedMessages        = null;
            IAsyncEnumerable <IReadOnlyCollection <IMessage> > result = null;

            if (dir == Direction.After && fromMessageId == null)
            {
                return(AsyncEnumerable.Empty <IReadOnlyCollection <IMessage> >());
            }

            if (dir == Direction.Before || mode == CacheMode.CacheOnly)
            {
                if (messages != null) //Cache enabled
                {
                    cachedMessages = messages.GetMany(fromMessageId, dir, limit);
                }
                else
                {
                    cachedMessages = ImmutableArray.Create <SocketMessage>();
                }
                result = ImmutableArray.Create(cachedMessages).ToAsyncEnumerable <IReadOnlyCollection <IMessage> >();
            }

            if (dir == Direction.Before)
            {
                limit -= cachedMessages.Count;
                if (mode == CacheMode.CacheOnly || limit <= 0)
                {
                    return(result);
                }

                //Download remaining messages
                ulong?minId = cachedMessages.Count > 0 ? cachedMessages.Min(x => x.Id) : fromMessageId;
                var   downloadedMessages = ChannelHelper.GetMessagesAsync(channel, discord, minId, dir, limit, options);
                return(result.Concat(downloadedMessages));
            }
            else
            {
                if (mode == CacheMode.CacheOnly)
                {
                    return(result);
                }

                //Dont use cache in this case
                return(ChannelHelper.GetMessagesAsync(channel, discord, fromMessageId, dir, limit, options));
            }
        }
Ejemplo n.º 31
0
 public QueryOptions SetCacheMode(CacheMode mode)
 {
     action += criteria => criteria.SetCacheMode(mode);
     return this;
 }
Ejemplo n.º 32
0
 /// <inheritdoc />
 IQueryableOptions IQueryableOptions.SetCacheMode(CacheMode cacheMode) => SetCacheMode(cacheMode);
Ejemplo n.º 33
0
 public SetCacheModeOpenSessionEvent(CacheMode cacheMode)
 {
     this.cacheMode = cacheMode;
 }
Ejemplo n.º 34
0
 /// <summary>
 /// Override the current session cache mode, just for this query.
 /// </summary>
 /// <param name="cacheMode">The cache mode to use.</param>
 /// <returns><see langword="this"/> (for method chaining).</returns>
 public NhQueryableOptions SetCacheMode(CacheMode cacheMode)
 {
     CacheMode = cacheMode;
     return(this);
 }
Ejemplo n.º 35
0
        /// <summary>
        /// Initializes a new instance of the ImageListView class.
        /// </summary>
        public ImageListView()
        {
            SetRenderer(new ImageListViewRenderer());

            AllowColumnClick = true;
            AllowColumnResize = true;
            AllowDrag = false;
            AllowDuplicateFileNames = false;
            AllowPaneResize = true;
            BackColor = SystemColors.Window;
            mBorderStyle = BorderStyle.Fixed3D;
            mCacheMode = CacheMode.OnDemand;
            mCacheLimitAsItemCount = 0;
            mCacheLimitAsMemory = 20 * 1024 * 1024;
            mColumns = new ImageListViewColumnHeaderCollection(this);
            mDefaultImage = ImageListViewResources.image;
            mErrorImage = ImageListViewResources.exclamation;
            HeaderFont = this.Font;
            mItems = new ImageListViewItemCollection(this);
            mPaneWidth = 240;
            mRetryOnError = true;
            mSelectedItems = new ImageListViewSelectedItemCollection(this);
            mSortColumn = ColumnType.Name;
            mSortOrder = SortOrder.None;
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.Opaque |
                ControlStyles.Selectable | ControlStyles.UserMouse, true);
            Text = string.Empty;
            mThumbnailSize = new Size(96, 96);
            mUseEmbeddedThumbnails = UseEmbeddedThumbnails.Auto;
            mView = View.Thumbnails;

            mViewOffset = new Point(0, 0);
            hScrollBar = new HScrollBar();
            vScrollBar = new VScrollBar();
            hScrollBar.Visible = false;
            vScrollBar.Visible = false;
            hScrollBar.Scroll += new ScrollEventHandler(hScrollBar_Scroll);
            vScrollBar.Scroll += new ScrollEventHandler(vScrollBar_Scroll);
            layoutManager = new ImageListViewLayoutManager(this);
            forceRefresh = false;

            navigationManager = new ImageListViewNavigationManager(this);

            cacheManager = new ImageListViewCacheManager(this);
            itemCacheManager = new ImageListViewItemCacheManager(this);

            disposed = false;
        }
Ejemplo n.º 36
0
 //IUser
 Task <IDMChannel> IUser.GetDMChannelAsync(CacheMode mode, RequestOptions options)
 => Task.FromResult <IDMChannel>(GlobalUser.DMChannel);
Ejemplo n.º 37
0
 public CacheReadAttribute(CacheMode mode, string lifeSpanRepresentation) : base(mode, lifeSpanRepresentation)
 {
 }
        /// <summary>
        /// Checks that specified cache exists and stops all Ignite instances.
        /// </summary>
        // ReSharper disable once UnusedParameter.Local
        private static void CheckCacheAndStop(string gridName, string cacheName, IgniteDbConfiguration cfg,
            CacheMode cacheMode = CacheMode.Partitioned)
        {
            try
            {
                Assert.IsNotNull(cfg);

                var ignite = Ignition.TryGetIgnite(gridName);
                Assert.IsNotNull(ignite);

                var metaCache = ignite.GetCache<object, object>(cacheName + "_metadata");
                Assert.IsNotNull(metaCache);
                Assert.AreEqual(cacheMode, metaCache.GetConfiguration().CacheMode);

                if (cacheMode == CacheMode.Partitioned)
                    Assert.AreEqual(1, metaCache.GetConfiguration().Backups);

                var dataCache = ignite.GetCache<object, object>(cacheName + "_data");
                Assert.IsNotNull(dataCache);
                Assert.AreEqual(cacheMode, dataCache.GetConfiguration().CacheMode);

                if (cacheMode == CacheMode.Partitioned)
                    Assert.AreEqual(0, dataCache.GetConfiguration().Backups);
            }
            finally
            {
                Ignition.StopAll(true);
            }
        }
 public SetCacheModeEvent(CacheMode cacheMode)
 {
     this.cacheMode = cacheMode;
 }
 public IAuditQuery SetCacheMode(CacheMode cacheMode) {
     this.cacheMode = cacheMode;
     return this;
 }
Ejemplo n.º 41
0
 /// <inheritdoc />
 async Task <IReadOnlyCollection <ICategoryChannel> > IGuild.GetCategoriesAsync(CacheMode mode, RequestOptions options)
 {
     if (mode == CacheMode.AllowDownload)
     {
         return(await GetCategoryChannelsAsync(options).ConfigureAwait(false));
     }
     else
     {
         return(null);
     }
 }
Ejemplo n.º 42
0
        /// <summary>
        /// Initializes a new instance of the ImageListView class.
        /// </summary>
        public ImageListView()
        {
            mColors = new ImageListViewColor();
            SetRenderer(new ImageListViewRenderer());

            AllowColumnClick = true;
            AllowColumnResize = true;
            AllowDrag = false;
            AllowDuplicateFileNames = false;
            AllowPaneResize = true;
            mBorderStyle = BorderStyle.Fixed3D;
            mCacheMode = CacheMode.OnDemand;
            mCacheLimitAsItemCount = 0;
            mCacheLimitAsMemory = 20 * 1024 * 1024;
            mColumns = new ImageListViewColumnHeaderCollection(this);
            ResourceManager manager = new ResourceManager("Manina.Windows.Forms.ImageListViewResources",
                Assembly.GetExecutingAssembly());
            mDefaultImage = manager.GetObject("DefaultImage") as Image;
            mErrorImage = manager.GetObject("ErrorImage") as Image;
            HeaderFont = this.Font;
            mItems = new ImageListViewItemCollection(this);
            MultiSelect = true;
            mPaneWidth = 240;
            mRetryOnError = true;
            mSelectedItems = new ImageListViewSelectedItemCollection(this);
            mCheckedItems = new ImageListViewCheckedItemCollection(this);
            mSortColumn = ColumnType.Name;
            mSortOrder = SortOrder.None;
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.Opaque |
                ControlStyles.Selectable | ControlStyles.UserMouse, true);
            ScrollBars = true;
            mShowCheckBoxes = false;
            mCheckBoxAlignment = ContentAlignment.BottomRight;
            mCheckBoxPadding = new Size(2, 2);
            mShowFileIcons = false;
            mIconAlignment = ContentAlignment.TopRight;
            mIconPadding = new Size(2, 2);
            Text = string.Empty;
            mThumbnailSize = new Size(96, 96);
            mUseEmbeddedThumbnails = UseEmbeddedThumbnails.Auto;
            mView = View.Thumbnails;

            mViewOffset = new Point(0, 0);
            hScrollBar = new HScrollBar();
            vScrollBar = new VScrollBar();
            hScrollBar.Visible = false;
            vScrollBar.Visible = false;
            hScrollBar.Scroll += new ScrollEventHandler(hScrollBar_Scroll);
            vScrollBar.Scroll += new ScrollEventHandler(vScrollBar_Scroll);
            layoutManager = new ImageListViewLayoutManager(this);
            forceRefresh = false;

            navigationManager = new ImageListViewNavigationManager(this);

            cacheManager = new ImageListViewCacheManager(this);
            itemCacheManager = new ImageListViewItemCacheManager(this);

            disposed = false;
        }
Ejemplo n.º 43
0
 /// <inheritdoc />
 IAsyncEnumerable <IReadOnlyCollection <IMessage> > IMessageChannel.GetMessagesAsync(int limit, CacheMode mode, RequestOptions options)
 => SocketChannelHelper.GetMessagesAsync(this, Discord, _messages, null, Direction.Before, limit, mode, options);
Ejemplo n.º 44
0
 /// <inheritdoc />
 IAsyncEnumerable <IReadOnlyCollection <IMessage> > IMessageChannel.GetMessagesAsync(IMessage fromMessage, Direction dir, int limit, CacheMode mode, RequestOptions options)
 {
     if (mode == CacheMode.AllowDownload)
     {
         return(GetMessagesAsync(fromMessage, dir, limit, options));
     }
     else
     {
         return(AsyncEnumerable.Empty <IReadOnlyCollection <IMessage> >());
     }
 }
Ejemplo n.º 45
0
		private DataPoint CreateDataPoint(CacheMode mode)
		{
			DataPoint dp = null;
			
			using (ISession s = OpenSession())
			{
				s.CacheMode = CacheMode.Ignore;
				
				using (ITransaction t = s.BeginTransaction())
				{
					dp = new DataPoint();
					dp.X = 0.1M;
					dp.Y = (decimal)System.Math.Cos((double)dp.X);
					dp.Description = "original";
					s.Save(dp);
					t.Commit();
				}
			}
			
			return dp;
		}
Ejemplo n.º 46
0
 /// <inheritdoc />
 IAsyncEnumerable <IReadOnlyCollection <IMessage> > IMessageChannel.GetMessagesAsync(IMessage fromMessage, Direction dir, int limit, CacheMode mode, RequestOptions options)
 => SocketChannelHelper.GetMessagesAsync(this, Discord, _messages, fromMessage.Id, dir, limit, mode, options);
Ejemplo n.º 47
0
 /// <inheritdoc />
 IAsyncEnumerable <IReadOnlyCollection <IGuildUser> > IGuildChannel.GetUsersAsync(CacheMode mode, RequestOptions options)
 => ImmutableArray.Create <IReadOnlyCollection <IGuildUser> >(Users).ToAsyncEnumerable();
Ejemplo n.º 48
0
 // INestedChannel
 /// <inheritdoc />
 Task <ICategoryChannel> INestedChannel.GetCategoryAsync(CacheMode mode, RequestOptions options)
 => Task.FromResult(Category);
		/// <summary> Override the current session cache mode, just for this query. </summary>
		/// <param name="cacheMode">The cache mode to use. </param>
		/// <returns> this (for method chaining) </returns>
		public virtual IDetachedQuery SetCacheMode(CacheMode cacheMode)
		{
			this.cacheMode = cacheMode;
			return this;
		}
Ejemplo n.º 50
0
 //IGuildChannel
 /// <inheritdoc />
 Task <IGuildUser> IGuildChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options)
 => Task.FromResult <IGuildUser>(GetUser(id));
Ejemplo n.º 51
0
		/// <summary>
		/// Initializes a new instance of the ImageListView class.
		/// </summary>
		public ImageListView()
		{
			// Renderer parameters
			controlSuspended = false;
			rendererSuspendCount = 0;
			rendererNeedsPaint = true;

			mColors = ImageListViewColor.Default;
			Renderer = new ImageListViewRenderer();

			// Property defaults
			AutoRotateThumbnails = true;
			AllowCheckBoxClick = true;
			AllowColumnClick = true;
			AllowColumnResize = true;
			AllowDrag = false;
			AllowDuplicateFileNames = false;
			AllowPaneResize = true;
			mBorderStyle = BorderStyle.Fixed3D;
			mCacheMode = CacheMode.OnDemand;
			mCacheLimitAsItemCount = 0;
			mCacheLimitAsMemory = 20 * 1024 * 1024;
			mColumns = new ImageListViewColumnHeaderCollection(this);
			resources = new ResourceManager("Manina.Windows.Forms.ImageListViewResources", typeof(ImageListView).Assembly);
			mDefaultImage = resources.GetObject("DefaultImage") as Image;
			mErrorImage = resources.GetObject("ErrorImage") as Image;
			mRatingImage = resources.GetObject("RatingImage") as Image;
			mEmptyRatingImage = resources.GetObject("EmptyRatingImage") as Image;
			GroupHeaderFont = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold);
			ColumnHeaderFont = new Font("Microsoft Sans Serif", 8.25f);
			mIntegralScroll = false;
			mItems = new ImageListViewItemCollection(this);
			MultiSelect = true;
			mPaneWidth = 240;
			mRetryOnError = true;
			mSelectedItems = new ImageListViewSelectedItemCollection(this);
			mCheckedItems = new ImageListViewCheckedItemCollection(this);
			mSortColumn = 0;
			mGroupColumn = 0;
			mSortOrder = SortOrder.None;
			mGroupOrder = SortOrder.None;
			SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.Opaque | ControlStyles.Selectable | ControlStyles.UserMouse, true);
			ScrollBars = true;
			ShellIconFallback = true;
			ShellIconFromFileContent = true;
			Size = new Size(120, 100);
			mShowCheckBoxes = false;
			mCheckBoxAlignment = ContentAlignment.BottomRight;
			mCheckBoxPadding = new Size(2, 2);
			mShowFileIcons = false;
			mIconAlignment = ContentAlignment.TopRight;
			mIconPadding = new Size(2, 2);
			Text = string.Empty;
			mThumbnailSize = new Size(96, 96);
			mUseEmbeddedThumbnails = UseEmbeddedThumbnails.Auto;
			mUseWIC = UseWIC.Auto;
			mView = View.Thumbnails;
			mViewOffset = new Point(0, 0);
			mShowScrollBars = true;

			// Child controls
			hScrollBar = new HScrollBar();
			vScrollBar = new VScrollBar();
			hScrollBar.Visible = false;
			vScrollBar.Visible = false;
			hScrollBar.Scroll += hScrollBar_Scroll;
			vScrollBar.Scroll += vScrollBar_Scroll;
			Controls.Add(hScrollBar);
			Controls.Add(vScrollBar);

			// Groups
			groups = new ImageListViewGroupCollection(this);
			showGroups = false;

			// Lazy refresh timer
			lazyRefreshTimer = new System.Timers.Timer();
			lazyRefreshTimer.Interval = ImageListViewRenderer.LazyRefreshInterval;
			lazyRefreshTimer.Enabled = false;
			lazyRefreshTimer.Elapsed += lazyRefreshTimer_Tick;
			lazyRefreshCallback = new RefreshDelegateInternal(Refresh);

			// Helpers
			layoutManager = new ImageListViewLayoutManager(this);
			navigationManager = new ImageListViewNavigationManager(this);

			// Cache nabagers
			defaultAdaptor = new ImageListViewItemAdaptors.FileSystemAdaptor();
			thumbnailCache = new ImageListViewCacheThumbnail(this);
			shellInfoCache = new ImageListViewCacheShellInfo(this);
			metadataCache = new ImageListViewCacheMetadata(this);

			disposed = false;
		}
Ejemplo n.º 52
0
 async Task <IReadOnlyCollection <IAuditLogEntry> > IGuild.GetAuditLogsAsync(int limit, CacheMode cacheMode, RequestOptions options)
 {
     if (cacheMode == CacheMode.AllowDownload)
     {
         return((await GetAuditLogsAsync(limit, options).FlattenAsync().ConfigureAwait(false)).ToImmutableArray());
     }
     else
     {
         return(ImmutableArray.Create <IAuditLogEntry>());
     }
 }