コード例 #1
0
 public PublishInfo(ITaskItem item)
 {
     this.key         = (item.ItemSpec != null) ? item.ItemSpec.ToLowerInvariant() : null;
     this.group       = item.GetMetadata("Group");
     this.state       = ResolveManifestFiles.StringToPublishState(item.GetMetadata("PublishState"));
     this.includeHash = item.GetMetadata("IncludeHash");
     this.targetPath  = item.GetMetadata("TargetPath");
 }
コード例 #2
0
            public void Add(ITaskItem item, bool includedByDefault)
            {
                string itemTargetPath = ResolveManifestFiles.GetItemTargetPath(item);

                if (!string.IsNullOrEmpty(itemTargetPath))
                {
                    string key = itemTargetPath.ToLowerInvariant();
                    ResolveManifestFiles.MapEntry entry = new ResolveManifestFiles.MapEntry(item, includedByDefault);
                    if (!this.dictionary.ContainsKey(key))
                    {
                        this.dictionary.Add(key, entry);
                    }
                }
            }
            public static ResolveManifestFiles.PublishFlags GetSatelliteFlags(ResolveManifestFiles.PublishState state, CultureInfo satelliteCulture, CultureInfo targetCulture, bool includeAllSatellites)
            {
                bool flag = IsSatelliteIncludedByDefault(satelliteCulture, targetCulture, includeAllSatellites);
                bool isDataFile = false;
                bool isPrerequisite = false;
                bool isPublished = false;
                switch (state)
                {
                    case ResolveManifestFiles.PublishState.Auto:
                        isPrerequisite = false;
                        isPublished = flag;
                        break;

                    case ResolveManifestFiles.PublishState.Include:
                        isPrerequisite = false;
                        isPublished = true;
                        break;

                    case ResolveManifestFiles.PublishState.Exclude:
                        isPrerequisite = false;
                        isPublished = false;
                        break;

                    case ResolveManifestFiles.PublishState.Prerequisite:
                        isPrerequisite = true;
                        isPublished = false;
                        break;
                }
                return new ResolveManifestFiles.PublishFlags(isDataFile, isPrerequisite, isPublished);
            }
            public static ResolveManifestFiles.PublishFlags GetFileFlags(ResolveManifestFiles.PublishState state, string fileExtension, bool includedByDefault)
            {
                bool isDataFile = false;
                bool isPrerequisite = false;
                bool isPublished = false;
                switch (state)
                {
                    case ResolveManifestFiles.PublishState.Auto:
                        isDataFile = includedByDefault && PathUtil.IsDataFile(fileExtension);
                        isPublished = includedByDefault;
                        break;

                    case ResolveManifestFiles.PublishState.Include:
                        isDataFile = false;
                        isPublished = true;
                        break;

                    case ResolveManifestFiles.PublishState.Exclude:
                        isDataFile = false;
                        isPublished = false;
                        break;

                    case ResolveManifestFiles.PublishState.DataFile:
                        isDataFile = true;
                        isPublished = true;
                        break;
                }
                return new ResolveManifestFiles.PublishFlags(isDataFile, isPrerequisite, isPublished);
            }
            public static ResolveManifestFiles.PublishFlags GetAssemblyFlags(ResolveManifestFiles.PublishState state, bool copyLocal)
            {
                bool isDataFile = false;
                bool isPrerequisite = false;
                bool isPublished = false;
                switch (state)
                {
                    case ResolveManifestFiles.PublishState.Auto:
                        isPrerequisite = !copyLocal;
                        isPublished = copyLocal;
                        break;

                    case ResolveManifestFiles.PublishState.Include:
                        isPrerequisite = false;
                        isPublished = true;
                        break;

                    case ResolveManifestFiles.PublishState.Exclude:
                        isPrerequisite = false;
                        isPublished = false;
                        break;

                    case ResolveManifestFiles.PublishState.Prerequisite:
                        isPrerequisite = true;
                        isPublished = false;
                        break;
                }
                return new ResolveManifestFiles.PublishFlags(isDataFile, isPrerequisite, isPublished);
            }