예제 #1
0
        public Dependencies GetDependencyByQuestionId(Question question, Answers answers = null, string response_id = null)
        {
            Dependencies dependencies = new Dependencies(null);

            try
            {
                if (answers.Count > 0)
                {
                    if (RecordExists("dsto_dependency", "yref_question", question.Key))
                    {
                        if (!string.IsNullOrEmpty(answers.FirstOrDefault().AnswerText) && int.TryParse(answers.FirstOrDefault().AnswerText, out int n) && question.DataType.Equals(DataTypes.Numeric))
                        {
                            for (int occurance = 0; occurance < int.Parse(answers.FirstOrDefault().AnswerText); occurance++)
                            {
                                string query = $"select * from dsto_dependency where [yref_question] = '{question.Key}' and Deleted=0";
                                var    table = DbInfo.ExecuteSelectQuery(query);
                                if (table.Rows.Count > 0)
                                {
                                    foreach (DataRow row in table.Rows)
                                    {
                                        Dependency dependency = dependencies.Add();
                                        InitDependency(dependency, row, occurance, response_id);
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    string query = $"select * from dsto_dependency where [yref_question] = '{question.Key}' and Deleted=0";
                    var    table = DbInfo.ExecuteSelectQuery(query);
                    if (table.Rows.Count > 0)
                    {
                        foreach (DataRow row in table.Rows)
                        {
                            Dependency dependency = dependencies.Add();
                            InitDependency(dependency, row);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dependencies);
        }
예제 #2
0
 public Pack()
 {
     ExecutionPolicy = ExecutionPolicy.Manual;
     Dependencies.Add(nameof(Test));
     ProcessModules = new ModuleList
     {
         new StartProcess("dotnet")
         .WithArgument("pack")
         .WithArgument("../../src/NetlifySharp/NetlifySharp.csproj", true)
         .WithArgument("--no-build")
         .WithArgument("--no-restore")
         .WithArgument("-o", Config.FromContext(ctx => ctx.FileSystem.GetOutputDirectory("packages").Path.FullPath), true)
         .WithArgument(Config.FromSetting <string>(BuildProperties))
         .LogOutput(),
         new ReadFiles(Config.FromContext(ctx => $"{ctx.FileSystem.GetOutputDirectory("packages")}/*.nupkg")),
         new ExecuteIf(Config.FromContext(ctx => ctx.ContainsKey("DAVIDGLICK_CERTPASS") && ctx.FileSystem.GetRootFile("../../digicert-davidglick.pfx").Exists))
         {
             new StartProcess("nuget")
             .WithArgument("sign")
             .WithArgument(Config.FromDocument(doc => doc.Source.FullPath), true)
             .WithArgument("-CertificatePath", Config.FromContext(ctx => ctx.FileSystem.GetRootFile("../../digicert-davidglick.pfx").Path.FullPath), true)
             .WithArgument("-CertificatePassword", Config.FromSetting <string>("DAVIDGLICK_CERTPASS"), true)
             .WithArgument("-Timestamper", "http://timestamp.digicert.com", true)
             .WithArgument("-NonInteractive")
             .LogOutput()
         }
     };
 }
예제 #3
0
        public ToolbarButton()
        {
            // HTML Id of the button
            AssignId = @"ExportItemList";

            // Name of the Javascript Command to be fired on the button click
            Command = @"ExportItemList";

            // Label for the button
            Name = Resources.ToolbarButtonName;

            // Tool tip for the button
            Title = Resources.ToolbarButtonTooltip;

            // Ribbon toolbar tab for the button
            PageId = Constants.PageIds.HomePage;

            // The group inside homepage tab, where we want to show the button
            GroupId = Constants.GroupIds.HomePage.ManageGroup;

            // Insert the button before "Where Used Button"
            InsertBefore = @"WhereUsedBtn";

            // Add "ButtonGroup" resource group as a dependancy of the extension
            Dependencies.Add <ButtonGroup>();

            // Apply the extension to Dashboard view
            Apply.ToView(Constants.Views.DashboardView, "DashboardToolbar");

            Apply.ToView("*", "Toolbar");
        }
예제 #4
0
        void AddRabbitMqSources(XElement elementToUse)
        {
            if (elementToUse == null)
            {
                return;
            }
            if (Dependencies == null)
            {
                Dependencies = new List <IResourceForTree>();
            }
            var dependenciesFromXml = from desc in elementToUse.Descendants()
                                      where (desc.Name.LocalName.Contains("DsfPublishRabbitMQActivity") || desc.Name.LocalName.Contains("DsfConsumeRabbitMQActivity")) && desc.HasAttributes
                                      select desc;
            var xElements = dependenciesFromXml as List <XElement> ?? dependenciesFromXml.ToList();

            foreach (var element in xElements)
            {
                var resourceIdAsString = element.AttributeSafe("RabbitMQSourceResourceId");
                var uniqueIdAsString   = element.AttributeSafe("UniqueID");
                Guid.TryParse(uniqueIdAsString, out Guid uniqueId);
                Guid.TryParse(resourceIdAsString, out Guid resId);
                var resourceForTree = Dependencies.FirstOrDefault(tree => tree.ResourceID == resId);
                if (resourceForTree == null)
                {
                    Dependencies.Add(
                        new ResourceForTree
                    {
                        ResourceID   = resId,
                        UniqueID     = uniqueId,
                        ResourceName = "",
                        ResourceType = "RabbitMQSource"
                    });
                }
            }
        }
예제 #5
0
 /// <summary>
 /// Registers this feature as depending on the given feature. This means that this feature won't be activated unless
 /// the dependant feature is active. This also causes this feature to be activated after the other feature.
 /// </summary>
 /// <param name="featureTypeName">The <see cref="Type.FullName"/> of the feature that this feature depends on.</param>
 protected void DependsOn(string featureTypeName)
 {
     Dependencies.Add(new List <string>
     {
         featureTypeName
     });
 }
예제 #6
0
        public PluginRibbonToolbarButton()
        {
            // The unique identifier used for the html element created.
            AssignId = "PublishedSummaryButton";

            // The name of the command to execute when clicked
            Command = "PublishedSummary";

            // The label of the button.
            Name = "Published Summary";

            // The page tab to assign this extension to. See Constants.PageIds.
            PageId = Constants.PageIds.HomePage;

            // Option GroupId, put this into an existing group (not capable if using a .ascx Control)
            GroupId = Constants.GroupIds.HomePage.ShareGroup;

            // The tooltip label that will get applied.
            Title = "Published Summary";

            // Add a dependency to the resource group that contains the files/commands that this toolbar extension will use.
            Dependencies.Add <PluginResourceGroup>();

            // apply the extension to a specific view.
            Apply.ToView(Constants.Views.DashboardView, "DashboardToolbar");
        }
예제 #7
0
        public FeedsPipeline()
        {
            Dependencies.Add(nameof(PostsPipeline));
            ProcessModules = new ModuleList(
                // Pull documents from other pipelines
                new ReplaceDocuments(Dependencies.ToArray()),

                // Set metadata for the feeds module
                new SetMetaDataItems(
                    async(input, context) =>
            {
                var post    = input.AsKontent <Article>();
                var html    = await ParseHtml(input, context);
                var article = html?.GetElementsByTagName("article").FirstOrDefault()?.InnerHtml ?? "";

                return(new MetadataItems
                {
                    { FeedKeys.Title, post.Title },
                    { FeedKeys.Content, post.Description },
                    { FeedKeys.Description, post.Description },
                    { FeedKeys.Image, post.OgImage.FirstOrDefault()?.Url },      // TODO: make that a local image!
                    { FeedKeys.Published, post.PublishDate },
                    { FeedKeys.Content, article }
                });
            }),
                new GenerateFeeds()
                .WithFeedTitle("Petr Svihlik - blog")     //TODO: load from Kontent
                .WithFeedDescription("Blog about all that matters to me - technology, life, leadership, and Developer Relations.")
                .WithFeedCopyright($"{DateTime.Today.Year}")
                );
            OutputModules = new ModuleList(
                new WriteFiles()
                );
        }
예제 #8
0
        void IDependencyVisitor.List(ListDependency dependency)
        {
            var elements = dependency.Items.Select(instanceFor).ToArray();
            var instance = new EnumerableInstance(elements);

            Dependencies.Add(dependency.DependencyType, instance);
        }
        public void AddCompiledShader(ShaderCompilationTarget target, List <string> dependencyPaths, CompilationResult result)
        {
            string[] defines = new string[target.ShaderMacros.Length];
            for (int i = 0; i < target.ShaderMacros.Length; ++i)
            {
                defines[i] = target.ShaderMacros[i].Name;
            }
            var sourceShader = new SourceShader {
                Name = target.Path + target.Stage.Extension, Defines = defines
            };

            lock (CompiledShaders)
            {
                CompiledShaders[sourceShader] = result;
                TimeStamps[target.Path]       = target.CurrentTimeStamp;

                foreach (var dependency in dependencyPaths)
                {
                    TimeStamps[dependency] = File.GetLastWriteTime(dependency).Ticks;
                }
                if (!Dependencies.TryGetValue(target.Path, out HashSet <string> cacheDependencyPaths))
                {
                    cacheDependencyPaths = new HashSet <string>();
                    Dependencies.Add(target.Path, cacheDependencyPaths);
                }
                foreach (var dependencyPath in dependencyPaths)
                {
                    cacheDependencyPaths.Add(dependencyPath);
                }
            }
        }
예제 #10
0
    public Api()
    {
        Dependencies.Add(nameof(Code));
        DependencyOf.Add(nameof(Content));

        ProcessModules = new ModuleList
        {
            new ConcatDocuments(nameof(Code)),
            new CacheDocuments(
                new AnalyzeCSharp()
                .WhereNamespaces(ns => ns.StartsWith("Spectre.Console") && !ns.Contains("Analyzer") &&
                                 !ns.Contains("Testing") && !ns.Contains("Examples"))
                .WherePublic(true)
                .WithCssClasses("code", "cs")
                .WithDestinationPrefix("api")
                .WithAssemblySymbols()
                .WithImplicitInheritDoc(false),
                new ExecuteConfig(Config.FromDocument((doc, ctx) =>
            {
                // Calculate a type name to link lookup for auto linking
                string name = null;

                var kind = doc.GetString(CodeAnalysisKeys.Kind);
                switch (kind)
                {
                case "NamedType":
                    name = doc.GetString(CodeAnalysisKeys.DisplayName);
                    break;

                case "Method":
                    var containingType = doc.GetDocument(CodeAnalysisKeys.ContainingType);
                    if (containingType != null)
                    {
                        name =
                            $"{containingType.GetString(CodeAnalysisKeys.DisplayName)}.{doc.GetString(CodeAnalysisKeys.DisplayName)}";
                    }
                    break;
                }

                if (name != null)
                {
                    var typeNameLinks = ctx.GetRequiredService <TypeNameLinks>();
                    typeNameLinks.Links.AddOrUpdate(WebUtility.HtmlEncode(name), ctx.GetLink(doc),
                                                    (_, _) => string.Empty);
                }

                // Add metadata
                var metadataItems = new MetadataItems
                {
                    { WebKeys.Xref, doc.GetString(CodeAnalysisKeys.CommentId) },
                    { WebKeys.Layout, "api/_layout.cshtml" },
                    { Constants.Hidden, true }
                };

                var contentProvider = doc.ContentProvider.CloneWithMediaType(MediaTypes.Html);
                metadataItems.Add(WebKeys.ContentType, ContentType.Content);
                return(doc.Clone(metadataItems, contentProvider));
            }))).WithoutSourceMapping()
        };
    }
예제 #11
0
    public ExampleSyntax()
    {
        Dependencies.Add(nameof(ExampleCode));
        DependencyOf.Add(nameof(Content));

        ProcessModules = new ModuleList
        {
            new ConcatDocuments(nameof(Code)),
            new ConcatDocuments(nameof(ExampleCode)),
            new CacheDocuments(
                new AnalyzeCSharp()
                .WhereNamespaces(true)
                .WherePublic()
                .WithCssClasses("code", "cs")
                .WithDestinationPrefix("syntax")
                .WithAssemblySymbols()
                // we need to load Spectre.Console for compiling, but we don't need to process it in Statiq
                .WhereNamespaces(i => !i.StartsWith("Spectre.Console"))
                .WithImplicitInheritDoc(false),
                new ExecuteConfig(Config.FromDocument((doc, _) =>
            {
                // Add metadata
                var metadataItems = new MetadataItems
                {
                    // Calculate an xref that includes a "api-" prefix to avoid collisions
                    { WebKeys.Xref, "syntax-" + doc.GetString(CodeAnalysisKeys.CommentId) },
                };

                var contentProvider = doc.ContentProvider;
                return(doc.Clone(metadataItems, contentProvider));
            }))).WithoutSourceMapping()
        };
    }
        public SerializedModuleMetadata(IModuleMetadata metadata)
        {
            Assert(metadata != null);

            if (metadata.Module == default || metadata.Version == default)
            {
                throw new ArgumentException("Neither the metadata's module nor its version must be the respective type's default value.", nameof(metadata));
            }

            Module                 = metadata.Module;
            Version                = metadata.Version;
            ReleaseDate            = metadata.ReleaseDate;
            Name                   = metadata.Name;
            Description            = metadata.Description;
            Author                 = metadata.Author;
            EntryAssemblyCommand   = metadata.EntryAssemblyCommand;
            EntryAssemblyArguments = metadata.EntryAssemblyArguments;

            foreach (var(module, versionRange) in metadata.Dependencies)
            {
                if (Dependencies == null)
                {
                    Dependencies = new Dictionary <ModuleIdentifier, ModuleVersionRange>();
                }

                Dependencies.Add(module, versionRange);
            }
        }
예제 #13
0
        public SyntaxHighlighterButton()
        {
            // The unique identifier used for the html element created.
            AssignId = "cm_syntaxhighlight";

            // The name of the command to execute when clicked
            Command = "SyntaxHighlighterCommand";

            // The label of the button.
            Name = "Enable Syntax Highlighting";

            // The page tab to assign this extension to. See Constants.PageIds.
            PageId = Constants.PageIds.HomePage;

            // The tooltip label that will get applied.
            Title = "Enable Syntax Highlighting";

            // Add a dependency to the resource group that contains the files/commands that this toolbar extension will use.
            Dependencies.Add <SyntaxHighlighterResourceGroup>();

            // apply the extension to a specific view.
            Apply.ToView("TemplateBuildingBlockView", "ItemToolbar");
            Apply.ToView("SchemaView", "ItemToolbar");
            Apply.ToView("ComponentVew", "ItemToolbar");
            Apply.ToView("ComponentTemplateView", "ItemToolbar");
            Apply.ToView("PageTemplateView", "ItemToolbar");
        }
예제 #14
0
        public GoToLocationExtension()
        {
            // The unique identifier used for the html element created.
            AssignId = "RibbonToolbarGoToLocationButton";

            // The name of the command to execute when clicked
            Command = "GoToLocationCommand";

            // The label of the button.
            Name = "Go To Location";

            // The page tab to assign this extension to. See Constants.PageIds.
            PageId = Constants.PageIds.HomePage;

            // Option GroupId, put this into an existing group
            GroupId = Constants.GroupIds.HomePage.ManageGroup;
            //GroupId = "GoToLocationGroup";

            // The tooltip label that will get applied.
            Title = "Go To Location";

            // Add a dependency to the resource group that contains the files/commands that this toolbar extension will use.
            Dependencies.Add <GoToLocationResouceGroup>();

            // apply the extension to a specific view.
            Apply.ToView(Constants.Views.ComponentView);
            Apply.ToView(Constants.Views.PageView);
            Apply.ToView(Constants.Views.SchemaView);
            Apply.ToView(Constants.Views.ComponentTemplateView);
            Apply.ToView(Constants.Views.PageTemplateView);
            Apply.ToView("TemplateBuildingBlockView");
        }
예제 #15
0
        public OptionalArgumentVariable(Variable inner, ParameterInfo parameter) : base(inner.VariableType)
        {
            Inner      = inner;
            _parameter = parameter;

            Dependencies.Add(Inner);
        }
예제 #16
0
            private void PopulateDependencies(string logicalName)
            {
                var properties = TestBase.GetType(logicalName).GetProperties();

                // Loop through all properties for the given entity, that define relationships
                foreach (var property in properties.Where(p =>
                                                          // Skip Properties to Ignore
                                                          !PropertiesToIgnore.Contains(p.Name.ToLower()) &&
                                                          // Only process Properties that contain an attribute logical name, and a Relationship Schema Name
                                                          p.ContainsCustomAttributeTypes(typeof(AttributeLogicalNameAttribute), typeof(RelationshipSchemaNameAttribute))))
                {
                    var attribute    = property.GetAttributeLogicalName();
                    var propertyType = property.PropertyType.GetCustomAttribute <EntityLogicalNameAttribute>(true);
                    if (!Dependencies.TryGetValue(propertyType.LogicalName, out EntityDependencyRelationship relationship))
                    {
                        relationship = new EntityDependencyRelationship(logicalName, propertyType.LogicalName, attribute, LogicalName == propertyType.LogicalName);
                        Dependencies.Add(propertyType.LogicalName, relationship);
                    }
                    else
                    {
                        relationship.Attributes.Add(attribute);
                    }
                }

                PopulateHardCodedDependencies(logicalName);
            }
예제 #17
0
파일: Layer.cs 프로젝트: curabuild-alex/cb
        public void FindDependenciesRecursive(LayerList registryLayers)
        {
            foreach (var section in _slice.Sections.Where(s => s.SectionType == SliceSection.Type.DEP))
            {
                foreach (var line in section.Lines)
                {
                    var semName = new SemName(line);
                    var dep     = registryLayers.FindLayer(semName.NamePart);
                    if (dep != null)
                    {
                        Dependencies.Add(dep);
                        dep.FindDependenciesRecursive(registryLayers);
                    }
                }
            }

            if (Dependencies.Count == 0)
            {
                foreach (var section in _slice.Sections.Where(s => s.SectionType == SliceSection.Type.OS))
                {
                    foreach (var line in section.Lines)
                    {
                        var semName = new SemName(line);
                        if (semName.NamePart != Name)
                        {
                            var os = registryLayers.FindLayer(semName.NamePart);
                            if (os != null)
                            {
                                Dependencies.Add(os);
                            }
                        }
                    }
                }
            }
        }
예제 #18
0
        public void AddDependency()
        {
            OpenFileDialog fileDialog = new OpenFileDialog();

            fileDialog.InitialDirectory = System.IO.Directory.GetCurrentDirectory();
            fileDialog.FileName         = "";
            fileDialog.RestoreDirectory = true;
            fileDialog.Filter           = "MSI Merge Modules (*.msm)|*.msm";
            fileDialog.Multiselect      = true;
            if (fileDialog.ShowDialog() == true)
            {
                foreach (var fileName in fileDialog.FileNames)
                {
                    try
                    {
                        var             iswixDependency = new IsWiXDependency(fileName);
                        DependencyModel dependency      = new DependencyModel();
                        dependency.RequiredId       = iswixDependency.RequiredId;
                        dependency.RequiredLanguage = iswixDependency.RequiredLanguage;
                        dependency.RequiredVersion  = iswixDependency.RequiredVersion;
                        _iswixDependencies.Add(iswixDependency);
                        if (!Dependencies.Contains(dependency))
                        {
                            Dependencies.Add(dependency);
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
            }
        }
예제 #19
0
        public Recent()
        {
            Dependencies.Add(nameof(Issues));

            ProcessModules = new ModuleList
            {
                new GenerateJson(
                    Config.FromContext(ctx => ctx.Outputs
                                       .FromPipeline(nameof(Issues))
                                       .SelectMany(doc => doc
                                                   .GetList <Issue>("Issues")
                                                   .Where(i => i.Recent)
                                                   .Select(i => new
                {
                    ProjectKey = doc.GetString("ProjectKey"),
                    CreatedAt  = i.CreatedAt,
                    Link       = i.Link,
                    Title      = i.Title
                }))
                                       .OrderByDescending(x => x.CreatedAt)))
                .WithCamelCase(),
                new MinifyJs(),
                new SetDestination((NormalizedPath)"data/issues/recent/all.json")
            };

            OutputModules = new ModuleList
            {
                new WriteFiles()
            };
        }
예제 #20
0
        public override void Create()
        {
            Parts.Clear();
            // Part1
            if (GetPart1Dependencies() != null)
            {
                var part1 = Factory.CreateSegment(Drawing, GetPart1Dependencies());
                if (part1 != null)
                {
                    Parts.Add(part1);
                }
            }

            // Cross Part
            if (GetCrossPartDependencies() != null)
            {
                var crossPart = Factory.CreateCircle(Drawing, GetCrossPartDependencies());
                Parts.Add(crossPart);
            }

            Dependencies.Clear();
            Children.Clear();
            if (Parts != null)
            {
                foreach (IFigure f in Parts)
                {
                    Children.Add(f);
                    foreach (IPoint p in f.Dependencies)
                    {
                        Dependencies.Add(p);
                    }
                }
            }
        }
예제 #21
0
        public TridionVisionRibbonToolbarButton()
        {
            // The unique identifier used for the html element created.
            AssignId = "TridionVisionButton";

            // Using command instead of .ascx so we can position it correctly
            Command = "TridionVisionCommand";

            // The label of the button.
            Name = "Auto-classify Images";

            // The tooltip label that will get applied.
            Title = "Auto-classify Images";

            // The page tab to assign this extension to. See Constants.PageIds.
            PageId = Constants.PageIds.HomePage;

            // Option GroupId, put this into an existing group
            GroupId = "TridionVision";

            // We need to add our resource group as a dependency to this extension
            Dependencies.Add <TridionVisionResourceGroup>();

            // apply the extension to a specific view.
            Apply.ToView(Constants.Views.DashboardView, "DashboardToolbar");
        }
예제 #22
0
            private void PopulateDependencies(IEnumerable <PropertyInfo> properties)
            {
                foreach (var property in properties.Where(p => !PropertiesToIgnore.Contains(p.Name.ToLower())))
                {
                    if (property.PropertyType == typeof(EntityReference))
                    {
                        var attribute = property.GetCustomAttribute(typeof(AttributeLogicalNameAttribute)) as AttributeLogicalNameAttribute;
                        if (attribute == null)
                        {
                            continue;
                        }
                        Dependencies.Add(attribute.LogicalName);
                        continue;
                    }

                    if (!property.PropertyType.IsGenericType || property.PropertyType.GetGenericTypeDefinition() != typeof(IEnumerable <>))
                    {
                        continue;
                    }

                    var genericTypes = property.PropertyType.GetGenericArguments();
                    if (genericTypes.Length != 1)
                    {
                        continue;
                    }
                    var genericType = genericTypes[0];
                    if (!typeof(Entity).IsAssignableFrom(genericType))
                    {
                        continue;
                    }

                    Dependents.Add(EntityHelper.GetEntityLogicalName(genericType));
                }
            }
예제 #23
0
        private void Initialize(int currentLevel, string name, float baseValue, string iconPath, List <string> dependancies, int baseIterationCount, bool addLevelToName)
        {
            BaseValue   = baseValue;
            Value       = baseValue * currentLevel;
            Level       = currentLevel;
            TmpValueKey = name;
            LevelKey    = GetLevelKey(name);

            Key  = TmpValueKey + currentLevel;
            Icon = iconPath + name + currentLevel + ".png";

            if (!addLevelToName)
            {
                Icon = iconPath + name + ".png";
            }

            IterationCount = baseIterationCount + 2 * currentLevel;

            if (currentLevel != 1)
            {
                Dependencies.Add(TmpValueKey + (currentLevel - 1));
            }

            if (dependancies != null)
            {
                foreach (var dep in dependancies)
                {
                    Dependencies.Add(dep);
                }
            }
        }
예제 #24
0
        public DiscoveriesFeed()
        {
            Dependencies.Add(nameof(Discoveries));

            ProcessModules = new ModuleList
            {
                new ReplaceDocuments(nameof(Discoveries)),
                new TakeDocuments(10),
                new GenerateFeeds()
                .WithAtomPath("feeds/discoveries.atom")
                .WithRssPath("feeds/discoveries.rss")
                .WithFeedTitle("Recent Discoveries From Discover .NET")
                .WithFeedDescription("A new discovery (almost) every day.")
                .WithItemTitle(Config.FromDocument(doc => doc.GetString("Title")))
                .WithItemDescription(Config.FromDocument(doc => doc.GetString("Description")))
                .WithItemPublished(Config.FromDocument(doc => (DateTime?)doc.GetDateTime("DiscoveryDate")))
                .WithItemLink(Config.FromDocument((doc, ctx) => TypeHelper.Convert <Uri>(ctx.GetLink(doc.GetString("Link"), true))))
                .WithItemId(Config.FromDocument((doc, ctx) => TypeHelper.Convert <Uri>(ctx.GetLink(doc.GetString("Link"), true))))
                .WithItemImageLink(null)
            };

            OutputModules = new ModuleList
            {
                new WriteFiles()
            };
        }
예제 #25
0
        public MyAssembly Add(string assemblyInfo)
        {
            var asm = new MyAssembly(assemblyInfo, this);

            Dependencies.Add(asm);
            return(asm);
        }
예제 #26
0
        private void Read(BinaryReader br, Archive parent)
        {
            FileTableOffset = br.ReadUInt32();
            FileTableSize   = br.ReadUInt32();

            Crc                     = br.ReadUInt64();
            FileEntryCount          = br.ReadUInt32();
            FileSegmentCount        = br.ReadUInt32();
            ResourceDependencyCount = br.ReadUInt32();

            // read tables
            for (int i = 0; i < FileEntryCount; i++)
            {
                var entry = new FileEntry(br, parent);

                if (!FileEntries.ContainsKey(entry.NameHash64))
                {
                    FileEntries.Add(entry.NameHash64, entry);
                }
                else
                {
                    // TODO
                }
            }

            for (int i = 0; i < FileSegmentCount; i++)
            {
                FileSegments.Add(new FileSegment(br, i));
            }

            for (int i = 0; i < ResourceDependencyCount; i++)
            {
                Dependencies.Add(new Dependency(br, i));
            }
        }
예제 #27
0
 public void CreateSkinDependency(FileItem referenceFile)
 {
   MpeCore.Classes.VersionProvider.SkinVersion skinVersion = new MpeCore.Classes.VersionProvider.SkinVersion();
   DependencyItem dep;
   CheckSkinDependency(out dep);
   if (dep != null)
   {
     Dependencies.Items.Remove(dep);
   }
   dep = CreateStrictDependency(skinVersion);
   Version versionSkin = null;
   string fileName = referenceFile.LocalFileName;
   if (!Path.IsPathRooted(fileName))
   {
     fileName = Path.Combine(Path.GetDirectoryName(ProjectSettings.ProjectFilename), fileName);
     fileName = Path.GetFullPath(fileName);
   }
   if (File.Exists(fileName))
   {
     XmlDocument doc = new XmlDocument();
     doc.Load(fileName);
     XmlNode node = doc.SelectSingleNode("/controls/skin/version");
     if (node != null && node.InnerText != null)
     {
       versionSkin = new Version(node.InnerText);
       dep.MinVersion = new VersionInfo(versionSkin);
       dep.MaxVersion = new VersionInfo(versionSkin);
     }
   }
   Dependencies.Add(dep);
 }
예제 #28
0
            public Pack()
            {
                ExecutionPolicy = ExecutionPolicy.Manual;

                Dependencies.Add(nameof(Build));

                ProcessModules = new ModuleList
                {
                    new ThrowExceptionIf(Config.ContainsSettings("DAVIDGLICK_CERTPASS").IsFalse(), "DAVIDGLICK_CERTPASS setting missing"),
                    new ReadFiles("src/**/*.csproj"),
                    new StartProcess("dotnet")
                    .WithArgument("pack")
                    .WithArgument("--no-build")
                    .WithArgument("--no-restore")
                    .WithArgument("-o", Config.FromContext(ctx => ctx.FileSystem.GetOutputPath().FullPath), true)
                    .WithArgument(Config.FromDocument(doc => doc.Source.FullPath), true)
                    .WithParallelExecution(false)
                    .LogOutput(),
                    new ReadFiles(Config.FromContext(ctx => ctx.FileSystem.GetOutputPath("*.nupkg").FullPath)),
                    new StartProcess("nuget")
                    .WithArgument("sign")
                    .WithArgument(Config.FromDocument(doc => doc.Source.FullPath), true)
                    .WithArgument("-CertificatePath", Config.FromContext(ctx => ctx.FileSystem.GetRootFile("davidglick.pfx").Path.FullPath), true)
                    .WithArgument("-CertificatePassword", Config.FromSetting("DAVIDGLICK_CERTPASS"), true)
                    .WithArgument("-Timestamper", "http://timestamp.digicert.com", true)
                    .WithArgument("-NonInteractive")
                    .WithParallelExecution(false)
                    .LogOutput()
                };
            }
        protected IssuePages(TotalIssueCounts totals)
        {
            Dependencies.Add(nameof(Issues));

            ProcessModules = new ModuleList
            {
                new ExecuteConfig(
                    Config.FromContext(ctx => ctx.Outputs
                                       .FromPipeline(nameof(Issues))
                                       .Where(doc => DocumentPredicate == null || DocumentPredicate(doc))
                                       .SelectMany(doc => doc
                                                   .GetList <Issue>("Issues")
                                                   .Where(i => IssuePredicate == null || IssuePredicate(i))
                                                   .Select(i => new PagedIssue(i, doc)))
                                       .OrderByDescending(x => x.CreatedAt)
                                       .Partition(24, count => SetTotal(count, totals))
                                       .Select(x => ctx.CreateDocument(new MetadataItems
                {
                    { "Page", x.Key },
                    { "Issues", x.ToList() }
                })))),
                new GenerateJson(Config.FromDocument(doc => doc["Issues"]))
                .WithCamelCase(),
                new MinifyJs(),
                new SetDestination(Destination)
            };

            OutputModules = new ModuleList
            {
                new WriteFiles()
            };
        }
예제 #30
0
        private void AddDotnetSources(XElement elementToUse)
        {
            if (elementToUse == null)
            {
                return;
            }
            if (Dependencies == null)
            {
                Dependencies = new List <IResourceForTree>();
            }
            var dependenciesFromXml = from desc in elementToUse.Descendants()
                                      where (desc.Name.LocalName.Contains("DsfEnhancedDotNetDllActivity")) && desc.HasAttributes
                                      select desc;
            var xElements = dependenciesFromXml as List <XElement> ?? dependenciesFromXml.ToList();

            foreach (var element in xElements)
            {
                var  resourceIdAsString = element.AttributeSafe("SourceId");
                var  resourceName       = element.AttributeSafe("ResourceName");
                var  actionTypeStr      = element.AttributeSafe("Type");
                var  resourceType       = GetResourceTypeFromString(actionTypeStr);
                Guid resId;
                Guid.TryParse(resourceIdAsString, out resId);
                var resourceForTree = Dependencies.FirstOrDefault(tree => tree.ResourceID == resId);
                if (resourceForTree == null)
                {
                    Dependencies.Add(CreateResourceForTree(resId, Guid.Empty, resourceName, resourceType));
                }
            }
        }