コード例 #1
0
 public BrandEntity(int id, string name, PathDescriptor cdnUrl, params SkinEntity[] skins)
 {
     this.Id     = id;
     this.Name   = name;
     this.CDNUrl = cdnUrl;
     this.Skins  = skins;
 }
コード例 #2
0
        private PathDescriptor ReplaceHttpsWithHttp()
        {
            if (this.IsEmpty())
            {
                return(this);
            }


            if (BasePathComponents[0] != "https:")
            {
                return(this);
            }

            var result = new PathDescriptor(BasePathComponents.ToArray(), Arguments.ToArray());

            result.BasePathComponents[0] = "http:";
            return(result);
        }
コード例 #3
0
        public PathDescriptor GetOverrideFileOrNull(PathDescriptor fileRelativePath, SkinCode skinCode)
        {
            if (this.Method == ABTestMethod.FullClient)
            {
                return(fileRelativePath);
            }

            foreach (var fileOverride in this.FilesOverride)
            {
                if (fileOverride.GetOriginalFile(skinCode).EndsWith(fileRelativePath))
                {
                    return(fileOverride.OverrideFile);
                }
            }


            return(null);
        }
コード例 #4
0
        public bool EndsWith(PathDescriptor path)
        {
            if (BasePathComponents.Length < path.BasePathComponents.Length)
            {
                return(false);
            }

            var k = this.BasePathComponents.Length - 1;

            for (int i = path.BasePathComponents.Length - 1; i >= 0; i--)
            {
                if (0 != string.Compare(path.BasePathComponents[i], this.BasePathComponents[k], true))
                {
                    return(false);
                }
                k--;
            }

            return(true);
        }
コード例 #5
0
 public ABTestCase(string id, bool isDefault, ABTestMethod method, string name, decimal usePercentage, string description, PathDescriptor clientPath)
 {
     this.Id            = id;
     this.IsDefault     = isDefault;
     this.Method        = method;
     this.Name          = name;
     this.UsePercentage = usePercentage;
     this.Description   = description;
     this.ClientPath    = clientPath;
     this.FilesOverride = new ABTestFileOverrideCollection();
 }
コード例 #6
0
 public ABTestFileOverride(string originalFile, string overrideFile)
 {
     _originalFile     = new PathDescriptor(originalFile);
     this.OverrideFile = new PathDescriptor(overrideFile);
 }
コード例 #7
0
 public EnvironmentConnection(string name, PathDescriptor configurationFilePath)
 {
     Name = name;
     ConfigurationFilePath = configurationFilePath;
 }