当前位置: 首页>>代码示例>>C#>>正文


C# Manifest类代码示例

本文整理汇总了C#中Manifest的典型用法代码示例。如果您正苦于以下问题:C# Manifest类的具体用法?C# Manifest怎么用?C# Manifest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Manifest类属于命名空间,在下文中一共展示了Manifest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Init

		public void Init(Manifest m, Dictionary<string, string> info)
		{
			var sheet = new Sheet(SheetType.BGRA, info["Image"]);
			var res = Game.Renderer.Resolution;
			bounds = new Rectangle(0, 0, res.Width, res.Height);
			sprite = new Sprite(sheet, new Rectangle(0, 0, 1024, 480), TextureChannel.Alpha);
		}
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:7,代码来源:ModChooserLoadScreen.cs

示例2: ManifestModel

 public ManifestModel(Manifest manifest)
 {
     this.ID = manifest.ID;
     this.Date = manifest.Date;
     this.Cost = manifest.Cost;
     this.Remark = manifest.Remark;
 }
开发者ID:KINGGUOKUN,项目名称:Account,代码行数:7,代码来源:ManifestModel.cs

示例3: Create

        public Manifest Create(Manifest manifest)
        {
            try
            {
                if (ApiUrl == string.Empty)
                {
                    throw new Exception(Errors.ERR_CONFIGM_MISSING_APIURL);
                }
                
               var uriBuilder = new UriBuilder(ApiUrl + "/manifests");

                if (DevKey != string.Empty)
                {
                    uriBuilder.Query = "subscription-key=" + DevKey;
                }

                var strManifest = ModelManager.ModelToJson(manifest);

                var json = Rest.Post(uriBuilder.Uri, strManifest);

                manifest = ModelManager.JsonToModel<Manifest>(json);
            }
            catch (Exception err)
            {
                var errString = string.Format(Errors.ERR_CONFIGM_MODEL_NOT_CREATED, manifest.name) + ", " + err.Message;
                if (err.InnerException != null)
                    errString += ", " + err.InnerException.Message;
                throw new Exception(errString);
            }

            return manifest;
        }
开发者ID:MSFTImagine,项目名称:microservices-iot-azure,代码行数:32,代码来源:ConfigAdminSDK.cs

示例4: ManifestValidatesManifestFiles

        public void ManifestValidatesManifestFiles()
        {
            // Arrange
            var manifest = new Manifest
            {
                Metadata = new ManifestMetadata
                {
                    Id = "Foobar",
                    Version = "1.0",
                    Authors = "test-author",
                    Description = "desc",
                },
                Files = new List<ManifestFile> {
                    new ManifestFile {
                        Source = "|",
                        Target = "<"
                    },
                    new ManifestFile {
                        Source = @"foo\bar\|>",
                        Target = "lib"
                    },
                    new ManifestFile {
                        Source = @"foo\**\*.cs",
                        Exclude = "Exclude|"
                    }
                }
            };

            // Act and Assert
            ExceptionAssert.Throws<ValidationException>(() => Manifest.Validate(manifest),
                "Source path '|' contains invalid characters.\r\nTarget path '<' contains invalid characters.\r\nSource path 'foo\\bar\\|>' contains invalid characters.\r\nExclude path 'Exclude|' contains invalid characters.");
        }
开发者ID:sistoimenov,项目名称:NuGet2,代码行数:32,代码来源:ManifestTest.cs

示例5: DotNetNugDirectory

 public DotNetNugDirectory(DirectoryName directoryName)
     : base(directoryName)
 {
     var manifestFile = GetChildFile("MANIFEST.json");
     var manifestContent = manifestFile.ReadToEnd();
     _manifest = JsonUtil.Get<Manifest>(manifestContent);
 }
开发者ID:wbinford,项目名称:nu,代码行数:7,代码来源:DotNetNugDirectory.cs

示例6: Init

		public override void Init(Manifest m, Dictionary<string, string> info)
		{
			loadInfo = info;

			// Avoid standard loading mechanisms so we
			// can display loadscreen as early as possible
			r = Game.Renderer;
			if (r == null) return;

			sheet = new Sheet(SheetType.BGRA, Platform.ResolvePath(loadInfo["Image"]));
			var res = r.Resolution;
			bounds = new Rectangle(0, 0, res.Width, res.Height);

			borderTop = new Sprite(sheet, new Rectangle(161, 128, 62, 33), TextureChannel.Alpha);
			borderBottom = new Sprite(sheet, new Rectangle(161, 223, 62, 33), TextureChannel.Alpha);
			borderLeft = new Sprite(sheet, new Rectangle(128, 161, 33, 62), TextureChannel.Alpha);
			borderRight = new Sprite(sheet, new Rectangle(223, 161, 33, 62), TextureChannel.Alpha);
			cornerTopLeft = new Sprite(sheet, new Rectangle(128, 128, 33, 33), TextureChannel.Alpha);
			cornerTopRight = new Sprite(sheet, new Rectangle(223, 128, 33, 33), TextureChannel.Alpha);
			cornerBottomLeft = new Sprite(sheet, new Rectangle(128, 223, 33, 33), TextureChannel.Alpha);
			cornerBottomRight = new Sprite(sheet, new Rectangle(223, 223, 33, 33), TextureChannel.Alpha);

			nodLogo = new Sprite(sheet, new Rectangle(0, 256, 256, 256), TextureChannel.Alpha);
			gdiLogo = new Sprite(sheet, new Rectangle(256, 256, 256, 256), TextureChannel.Alpha);
			evaLogo = new Sprite(sheet, new Rectangle(256, 64, 128, 64), TextureChannel.Alpha);
			nodPos = new float2(bounds.Width / 2 - 384, bounds.Height / 2 - 128);
			gdiPos = new float2(bounds.Width / 2 + 128, bounds.Height / 2 - 128);
			evaPos = new float2(bounds.Width - 43 - 128, 43);

			brightBlock = new Sprite(sheet, new Rectangle(320, 0, 16, 35), TextureChannel.Alpha);
			dimBlock = new Sprite(sheet, new Rectangle(336, 0, 16, 35), TextureChannel.Alpha);

			versionText = m.Mod.Version;
		}
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:34,代码来源:CncLoadScreen.cs

示例7: DigestMismatchException

 /// <summary>
 /// Creates a new digest mismatch exception.
 /// </summary>
 /// <param name="expectedDigest">The digest value the <see cref="Store.Model.Implementation"/> was supposed to have.</param>
 /// <param name="actualDigest">The digest value that was actually calculated.</param>
 /// <param name="expectedManifest">The <see cref="Manifest"/> that resulted in the <paramref name="expectedDigest"/>; may be <seealso langword="null"/>.</param>
 /// <param name="actualManifest">The <see cref="Manifest"/> that resulted in the <paramref name="actualDigest"/>.</param>
 public DigestMismatchException(string expectedDigest = null, string actualDigest = null, Manifest expectedManifest = null, Manifest actualManifest = null)
     : base(GetMessage(expectedDigest, actualDigest, expectedManifest, actualManifest))
 {
     ExpectedDigest = expectedDigest;
     ActualDigest = actualDigest;
     ExpectedManifest = expectedManifest;
     ActualManifest = actualManifest;
 }
开发者ID:modulexcite,项目名称:0install-win,代码行数:15,代码来源:DigestMismatchException.cs

示例8: CreateSuccess

 public static ManifestLoadResult CreateSuccess(string path, Manifest m)
 {
     return new ManifestLoadResult
     {
         Path = path,
         Manifest = m
     };
 }
开发者ID:Boddlnagg,项目名称:VisualRust,代码行数:8,代码来源:ManifestLoadResult.cs

示例9: ModContentPromptLogic

        public ModContentPromptLogic(Widget widget, Manifest mod, ModContent content, Action continueLoading)
        {
            var panel = widget.Get("CONTENT_PROMPT_PANEL");

            var headerTemplate = panel.Get<LabelWidget>("HEADER_TEMPLATE");
            var headerLines = !string.IsNullOrEmpty(content.InstallPromptMessage) ? content.InstallPromptMessage.Replace("\\n", "\n").Split('\n') : new string[0];
            var headerHeight = 0;
            foreach (var l in headerLines)
            {
                var line = (LabelWidget)headerTemplate.Clone();
                line.GetText = () => l;
                line.Bounds.Y += headerHeight;
                panel.AddChild(line);

                headerHeight += headerTemplate.Bounds.Height;
            }

            panel.Bounds.Height += headerHeight;
            panel.Bounds.Y -= headerHeight / 2;

            var advancedButton = panel.Get<ButtonWidget>("ADVANCED_BUTTON");
            advancedButton.Bounds.Y += headerHeight;
            advancedButton.OnClick = () =>
            {
                Ui.OpenWindow("CONTENT_PANEL", new WidgetArgs
                {
                    { "mod", mod },
                    { "content", content },
                    { "onCancel", Ui.CloseWindow }
                });
            };

            var quickButton = panel.Get<ButtonWidget>("QUICK_BUTTON");
            quickButton.IsVisible = () => !string.IsNullOrEmpty(content.QuickDownload);
            quickButton.Bounds.Y += headerHeight;
            quickButton.OnClick = () =>
            {
                var modFileSystem = new FileSystem.FileSystem(Game.Mods);
                modFileSystem.LoadFromManifest(mod);
                var downloadYaml = MiniYaml.Load(modFileSystem, content.Downloads, null);
                modFileSystem.UnmountAll();

                var download = downloadYaml.FirstOrDefault(n => n.Key == content.QuickDownload);
                if (download == null)
                    throw new InvalidOperationException("Mod QuickDownload `{0}` definition not found.".F(content.QuickDownload));

                Ui.OpenWindow("PACKAGE_DOWNLOAD_PANEL", new WidgetArgs
                {
                    { "download", new ModContent.ModDownload(download.Value) },
                    { "onSuccess", continueLoading }
                });
            };

            var backButton = panel.Get<ButtonWidget>("BACK_BUTTON");
            backButton.Bounds.Y += headerHeight;
            backButton.OnClick = Ui.CloseWindow;
            Game.RunAfterTick(Ui.ResetTooltips);
        }
开发者ID:pchote,项目名称:OpenRA,代码行数:58,代码来源:ModContentPromptLogic.cs

示例10: ModData

 public ModData( params string[] mods )
 {
     Manifest = new Manifest( mods );
     ObjectCreator = new ObjectCreator( Manifest );
     LoadScreen = ObjectCreator.CreateObject<ILoadScreen>(Manifest.LoadScreen.Value);
     LoadScreen.Init(Manifest.LoadScreen.NodesDict.ToDictionary(x => x.Key, x => x.Value.Value));
     LoadScreen.Display();
     WidgetLoader = new WidgetLoader( this );
 }
开发者ID:nevelis,项目名称:OpenRA,代码行数:9,代码来源:ModData.cs

示例11: ModData

 public ModData( params string[] mods )
 {
     Manifest = new Manifest( mods );
     ObjectCreator = new ObjectCreator( Manifest );
     LoadScreen = ObjectCreator.CreateObject<ILoadScreen>(Manifest.LoadScreen);
     LoadScreen.Init();
     LoadScreen.Display();
     WidgetLoader = new WidgetLoader( this );
 }
开发者ID:gitTerebi,项目名称:OpenRA,代码行数:9,代码来源:ModData.cs

示例12: ModContentLogic

        public ModContentLogic(Widget widget, Manifest mod, ModContent content, Action onCancel)
        {
            this.content = content;

            var panel = widget.Get("CONTENT_PANEL");

            var modFileSystem = new FileSystem.FileSystem(Game.Mods);
            modFileSystem.LoadFromManifest(mod);

            var sourceYaml = MiniYaml.Load(modFileSystem, content.Sources, null);
            foreach (var s in sourceYaml)
                sources.Add(s.Key, new ModContent.ModSource(s.Value));

            var downloadYaml = MiniYaml.Load(modFileSystem, content.Downloads, null);
            foreach (var d in downloadYaml)
                downloads.Add(d.Key, new ModContent.ModDownload(d.Value));

            modFileSystem.UnmountAll();

            scrollPanel = panel.Get<ScrollPanelWidget>("PACKAGES");
            template = scrollPanel.Get<ContainerWidget>("PACKAGE_TEMPLATE");

            var headerTemplate = panel.Get<LabelWidget>("HEADER_TEMPLATE");
            var headerLines = !string.IsNullOrEmpty(content.HeaderMessage) ? content.HeaderMessage.Replace("\\n", "\n").Split('\n') : new string[0];
            var headerHeight = 0;
            foreach (var l in headerLines)
            {
                var line = (LabelWidget)headerTemplate.Clone();
                line.GetText = () => l;
                line.Bounds.Y += headerHeight;
                panel.AddChild(line);

                headerHeight += headerTemplate.Bounds.Height;
            }

            panel.Bounds.Height += headerHeight;
            panel.Bounds.Y -= headerHeight / 2;
            scrollPanel.Bounds.Y += headerHeight;

            var discButton = panel.Get<ButtonWidget>("CHECK_DISC_BUTTON");
            discButton.Bounds.Y += headerHeight;
            discButton.IsVisible = () => discAvailable;

            discButton.OnClick = () => Ui.OpenWindow("DISC_INSTALL_PANEL", new WidgetArgs
            {
                { "afterInstall", () => { } },
                { "sources", sources },
                { "content", content }
            });

            var backButton = panel.Get<ButtonWidget>("BACK_BUTTON");
            backButton.Bounds.Y += headerHeight;
            backButton.OnClick = () => { Ui.CloseWindow(); onCancel(); };

            PopulateContentList();
            Game.RunAfterTick(Ui.ResetTooltips);
        }
开发者ID:pchote,项目名称:OpenRA,代码行数:57,代码来源:ModContentLogic.cs

示例13: InstallModLogic

        public InstallModLogic(Widget widget, Manifest mod)
        {
            var panel = widget.Get("INSTALL_MOD_PANEL");

            var mods = mod.RequiresMods.Where(m => !Game.IsModInstalled(m)).Select(m => "{0} ({1})".F(m.Key, m.Value));
            var text = string.Join(", ", mods);
            panel.Get<LabelWidget>("MOD_LIST").Text = text;

            panel.Get<ButtonWidget>("BACK_BUTTON").OnClick = Ui.CloseWindow;
        }
开发者ID:pchote,项目名称:OpenRA,代码行数:10,代码来源:InstallModLogic.cs

示例14: ManifestEditorDialog

        public ManifestEditorDialog(Manifest manifest, EditorMode mode = EditorMode.View)
        {
            InitializeComponent();
            this.Icon = new Icon("Graphics\\EliteDangerousIcon.ico");

            this.manifest = manifest;
            this.mode = mode;

            if (mode == EditorMode.View)
                SetUpViewer();
        }
开发者ID:LaurentFBlin,项目名称:EliteDangerousTradingAssistant,代码行数:11,代码来源:ManifestEditorDialog.cs

示例15: ToManifest

        public Manifest ToManifest()
        {
            Manifest manifest = new Manifest()
            {
                ID = this.ID,
                Date = this.Date,
                Cost = this.Cost,
                Remark = this.Remark
            };

            return manifest;
        }
开发者ID:KINGGUOKUN,项目名称:Account,代码行数:12,代码来源:ManifestModel.cs


注:本文中的Manifest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。