public override CacheDependency GetCacheDependency(string virtualPath, IEnumerable virtualPathDependencies, DateTime utcStart)
        {
            var view = getViewFromTestData(virtualPath);

            if (view != null)
            {
                return(null);
            }

            return(Previous.GetCacheDependency(virtualPath, virtualPathDependencies, utcStart));
        }
Exemple #2
0
        public void Hash(Blake2BConfig config, byte[] message)
        {
            var hasher = Blake2B.Create(new Blake2BConfig()
            {
                OutputSizeInBytes = 64
            });

            hasher.Init();
            hasher.Update(Previous.ToByteArray());
            hasher.Update(Representative.ToByteArray());
        }
 public override CacheDependency GetCacheDependency(string virtualPath, IEnumerable virtualPathDependencies, DateTime utcStart)
 {
     if (IsCustomDataTemplate(virtualPath))
     {
         return(TemplateVirtualFileCacheManager.SetPageCache(virtualPath));
     }
     else
     {
         return(Previous.GetCacheDependency(virtualPath, virtualPathDependencies, utcStart));
     }
 }
 public override VirtualFile GetFile(string virtualPath)
 {
     if (IsPathVirtual(virtualPath))
     {
         return(new TeclynVirtualFile(virtualPath));
     }
     else
     {
         return(Previous.GetFile(virtualPath));
     }
 }
        // </Snippet23>

        // <Snippet24>
        public override VirtualDirectory GetDirectory(string virtualDir)
        {
            if (IsPathVirtual(virtualDir))
            {
                return(new SampleVirtualDirectory(virtualDir, this));
            }
            else
            {
                return(Previous.GetDirectory(virtualDir));
            }
        }
 /// <summary>
 /// Internal usage only
 /// </summary>
 /// <param name="virtualPath"></param>
 /// <returns></returns>
 public override bool FileExists(string virtualPath)
 {
     if (FileExists(virtualPath, null))
     {
         return(true);
     }
     else
     {
         return(Previous.FileExists(virtualPath));
     }
 }
 public override bool FileExists(string virtualPath)
 {
     if (IsPathVirtual(virtualPath))
     {
         return(new S3File(virtualPath, this).Exists);
     }
     else
     {
         return(Previous.FileExists(virtualPath));
     }
 }
Exemple #8
0
        public override VirtualFile GetFile(string virtualPath)
        {
            foreach (var provider in Providers)
            {
                if (provider.IsVirtualFile(virtualPath) && provider.FileExists(virtualPath))
                {
                    return(provider.GetFile(virtualPath));
                }
            }

            return(Previous.GetFile(virtualPath));
        }
Exemple #9
0
        public override CacheDependency GetCacheDependency(string virtualPath, IEnumerable virtualPathDependencies, DateTime utcStart)
        {
            IViewResult result = PortalContext.Current.Request.Result as IViewResult;

            if (!IsRouteFile(virtualPath) || result == null)
            {
                return(Previous.GetCacheDependency(virtualPath, virtualPathDependencies, utcStart));
            }

            PortalTrace.Write("RoutePathProvider", "GetCacheDependency", "Creating new CacheDependency for path '{0}'.", virtualPath);
            return(new CacheDependency(HttpContext.Current.Server.MapPath(result.DependencyPath)));
        }
 //Handles the actual departing of trams from the station. Then checks if a tram can be put into the station in its place.
 override public void TramDepart(Tram tram)
 {
     lastDeparture = Time.Now();
     tram.moveToNext();
     logPassengersWaiting.WriteLine(Time.Now().ToString() + " , " + PassWaiting.ToString() + " , " + tram.PassCurr.ToString());
     logDwelltime.WriteLine(Time.Now().ToString() + " , " + (Time.Now() - tram.arrivaltime).ToString());
     new EndTransit(Time.Now() + this.TimeTransit(), tram, this.Next.Next);
     if (Previous.ReadyTram() != null)
     {
         new EndTransit(Time.Now(), Previous.ReadyTram(), this);
     }
 }
 public MatrixItemsStatusInquiry()
 {
     Save.SetVisible(false);
     Insert.SetVisible(false);
     Delete.SetVisible(false);
     CopyPaste.SetVisible(false);
     Next.SetVisible(false);
     Previous.SetVisible(false);
     First.SetVisible(false);
     Last.SetVisible(false);
     Cancel.SetVisible(false);
 }
Exemple #12
0
 internal IEnumerable <string> WinningMoves()
 {
     if (Previous == null)
     {
         yield break;
     }
     foreach (var move in Previous.WinningMoves())
     {
         yield return(move);
     }
     yield return(Move.ToString());
 }
        public override bool DirectoryExists(string virtualDir)
        {
            ArgumentUtility.CheckNotNullOrEmpty("virtualDir", virtualDir);

            if (IsMappedPath(virtualDir))
            {
                var virtualDirectory = GetResourceVirtualDirectory(virtualDir);
                return(virtualDirectory.Exists);
            }

            return(Previous.DirectoryExists(virtualDir));
        }
 public override void EmitAddress(ILProcessor ilProcessor)
 {
     if (Previous.Type.Resolve().IsValueType)
     {
         Previous.EmitAddress(ilProcessor);
     }
     else
     {
         Previous.Emit(ilProcessor);
     }
     ilProcessor.Emit(OpCodes.Ldflda, Field);
 }
Exemple #15
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Previous != null?Previous.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ EqualityComparer <T> .Default.GetHashCode(Value);

                hashCode = (hashCode * 397) ^ (Continuations != null ? Continuations.GetHashCode() : 0);
                return(hashCode);
            }
        }
 public override string GetFileHash(string virtualPath, System.Collections.IEnumerable virtualPathDependencies)
 {
     if (IsVirtualPath(virtualPath))
     {
         string filepath = GetRealPath(virtualPath);
         return(FileHashHelper.ComputeMD5(filepath));
     }
     else
     {
         return(Previous.GetFileHash(virtualPath, virtualPathDependencies));
     }
 }
        public override bool FileExists(string virtualPath)
        {
            ArgumentUtility.CheckNotNullOrEmpty("virtualPath", virtualPath);

            if (IsMappedPath(virtualPath))
            {
                var file = GetResourceVirtualFile(virtualPath);
                return(file.Exists);
            }

            return(Previous.FileExists(virtualPath));
        }
Exemple #18
0
            public Walk Clone()
            {
                var walk = new Walk()
                {
                    Previous = new List <XY>(Previous.ToArray()),
                    XY       = XY.Clone(),
                    Dist     = Dist + 1,
                };

                Previous.Add(XY.Clone());
                return(walk);
            }
Exemple #19
0
        public override string GetFileHash(string virtualPath, IEnumerable virtualPathDependencies)
        {
            var physicalPath = _files[virtualPath];

            if (physicalPath.IsNotEmpty())
            {
                var baseHash = base.GetFileHash(virtualPath, virtualPathDependencies);
                return(baseHash + File.GetLastWriteTimeUtc(physicalPath).Ticks);
            }

            return(Previous.GetFileHash(virtualPath, virtualPathDependencies));
        }
 /// <summary>
 /// 文件是否存在
 /// </summary>
 /// <param name="virtualPath">相对路径</param>
 /// <returns></returns>
 public override bool FileExists(string virtualPath)
 {
     if (IsVirtualPath(virtualPath))
     {
         string filepath = GetRealPath(virtualPath);
         return(File.Exists(filepath));
     }
     else
     {
         return(Previous.FileExists(virtualPath));
     }
 }
Exemple #21
0
        /// <summary>
        /// Returns a hash code for this instance.
        /// </summary>
        /// <returns>
        /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
        /// </returns>
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = EqualityComparer <T> .Default.GetHashCode(Current);

                hashCode = (hashCode * 397) ^ CurrentIndex;
                hashCode = (hashCode * 397) ^ Previous.GetHashCode();
                hashCode = (hashCode * 397) ^ PreviousIndex;
                return(hashCode);
            }
        }
Exemple #22
0
 public override void Calculate()
 {
     // Odd number HIGH inputs
     if (Previous.Select(x => x.Value == Bit.HIGH).Count() % 2 != 0)
     {
         Value = Bit.HIGH;
     }
     else
     {
         Value = Bit.LOW;
     }
 }
 public override bool FileExists(string virtualPath)
 {
     if (IsThemePath(virtualPath))
     {
         // just pretend it exists
         return(true);
     }
     else
     {
         return(Previous.FileExists(virtualPath));
     }
 }
Exemple #24
0
        public void SetPreviousProcessor(IProcessor prev)
        {
            if (Previous == null)
            {
                Previous = new List <IProcessor>();
            }

            if (prev != null && prev is IProcessor && !Previous.Contains(prev as IProcessor))
            {
                Previous.Add(prev as IProcessor);
            }
        }
Exemple #25
0
        public override VirtualFile GetFile(string virtualPath)
        {
            if (IsEmbeddedView(virtualPath))
            {
                string virtualPathAppRelative = VirtualPathUtility.ToAppRelative(virtualPath);
                var    fullyQualifiedViewName = virtualPathAppRelative.Substring(virtualPathAppRelative.LastIndexOf("/", System.StringComparison.Ordinal) + 1, virtualPathAppRelative.Length - 1 - virtualPathAppRelative.LastIndexOf("/", System.StringComparison.Ordinal));

                return(new EasyManResourceVirtualFile(GetViewMetadata(fullyQualifiedViewName), virtualPath));
            }

            return(Previous.GetFile(virtualPath));
        }
Exemple #26
0
        public override bool MoveCart(Cart cart)
        {
            if (!Previous.CanMoveTo(cart))
            {
                return(true);
            }

            Cart          = null;
            Previous.Cart = cart;
            cart.Current  = Previous;
            return(true);
        }
Exemple #27
0
 /// <summary>
 /// Gets a value that indicates whether a file exists in the virtual file system.
 /// </summary>
 /// <param name="virtualPath">The path to the virtual file.</param>
 /// <returns>
 /// true if the file exists in the virtual file system; otherwise, false.
 /// </returns>
 public override bool FileExists(string virtualPath)
 {
     if (IsPathVirtual(virtualPath))
     {
         VirtualFileMasterPage file = (VirtualFileMasterPage)GetFile(virtualPath);
         return((file == null) ? false : true);
     }
     else
     {
         return(Previous.FileExists(virtualPath));
     }
 }
 public override bool DirectoryExists(string virtualDir)
 {
     if (IsPathVirtual(virtualDir))
     {
         SampleVirtualDirectory dir = (SampleVirtualDirectory)GetDirectory(virtualDir);
         return(dir.Exists);
     }
     else
     {
         return(Previous.DirectoryExists(virtualDir));
     }
 }
 public override bool FileExists(string virtualPath)
 {
     if (IsPathVirtual(virtualPath))
     {
         SampleVirtualFile file = (SampleVirtualFile)GetFile(virtualPath);
         return(file.Exists);
     }
     else
     {
         return(Previous.FileExists(virtualPath));
     }
 }
Exemple #30
0
        public void Hash(Blake2BConfig config, byte[] message)
        {
            var hasher = Blake2B.Create(new Blake2BConfig()
            {
                OutputSizeInBytes = 64
            });

            hasher.Init();
            hasher.Update(Previous.ToByteArray());
            hasher.Update(Destination.ToByteArray());
            hasher.Update(Balance.ToByteArray());
        }
 void Awake()
 {
     instance = this;
 }