/// <summary>
 /// Writes an asset identifier to the stream.
 /// </summary>
 /// <param name="writer">The binary writer with which to write the asset identifier.</param>
 /// <param name="id">The <see cref="System.Nullable{AssetID}"/> structure to write to the stream.</param>
 public static void Write(this BinaryWriter writer, AssetID? id)
 {
     writer.Write(id.HasValue);
     if (id.HasValue)
     {
         writer.Write(id.GetValueOrDefault());
     }
 }
 /// <summary>
 /// Writes an asset identifier to the stream.
 /// </summary>
 /// <param name="writer">The binary writer with which to write the asset identifier.</param>
 /// <param name="id">The <see cref="AssetID"/> structure to write to the stream.</param>
 public static void Write(this BinaryWriter writer, AssetID id)
 {
     writer.Write(id.IsValid);
     if (id.IsValid)
     {
         writer.Write(AssetID.GetManifestNameRef(ref id));
         writer.Write(AssetID.GetManifestGroupRef(ref id));
         writer.Write(AssetID.GetAssetNameRef(ref id));
     }
 }
		private void UpdateStory(AssetID id, string originalName, string newName)
		{
			IMetaModel metaModel = Instance.ApiClient.MetaModel;
			IServices services = Instance.ApiClient.Services;

			Oid storyId = Oid.FromToken(id.Token, metaModel);
			Query query = new Query(storyId);
			IAssetType storyType = metaModel.GetAssetType("Story");
			IAttributeDefinition nameAttribute = storyType.GetAttributeDefinition("Name");
			query.Selection.Add(nameAttribute);
			QueryResult result = services.Retrieve(query);
			Asset storyAsset = result.Assets[0];
			string oldName = storyAsset.GetAttribute(nameAttribute).Value.ToString();
			Assert.AreEqual(originalName, oldName);
			storyAsset.SetAttributeValue(nameAttribute, newName);
			services.Save(storyAsset);
		}
예제 #4
0
 /// <summary>
 /// Creates a new instance of the <see cref="StretchableImage9"/> class.
 /// </summary>
 /// <param name="texture">The asset identifier of the texture that contains the image.</param>
 /// <param name="textureRegion">The region of the image's texture which contains the image.</param>
 /// <param name="left">The distance in pixels between the left edge of the image and the left edge of the image's center segment.</param>
 /// <param name="top">The distance in pixels between the top edge of the image and the top edge of the image's center segment.</param>
 /// <param name="right">The distance in pixels between the right edge of the image and the right edge of the image's center segment.</param>
 /// <param name="bottom">The distance in pixels between the bottom edge of the image and the bottom edge of the image's center segment.</param>
 /// <returns>The new instance of <see cref="StretchableImage9"/> that was created.</returns>
 public static StretchableImage9 Create(AssetID texture, Rectangle textureRegion, Int32 left, Int32 top, Int32 right, Int32 bottom)
 {
     return(Create(texture, textureRegion.X, textureRegion.Y, textureRegion.Width, textureRegion.Height, left, top, right, bottom));
 }
 internal BuildSource(AssetID id, V1Instance instance) : base(id, instance) { }
예제 #6
0
        public static Boolean TryParse(String s, NumberStyles style, IFormatProvider provider, out StretchableImage9 image)
        {
            Contract.Require(s, nameof(s));

            var components = s.Split((Char[])null, StringSplitOptions.RemoveEmptyEntries);

            var texture    = AssetID.Invalid;
            var x          = 0;
            var y          = 0;
            var width      = 0;
            var height     = 0;
            var left       = 0;
            var top        = 0;
            var right      = 0;
            var bottom     = 0;
            var tileCenter = false;
            var tileEdges  = false;

            image = null;

            switch (components.Length)
            {
            case 9:
            case 10:
            case 11:
                if (!AssetID.TryParse(components[0], out texture))
                {
                    return(false);
                }
                if (!Int32.TryParse(components[1], out x))
                {
                    return(false);
                }
                if (!Int32.TryParse(components[2], out y))
                {
                    return(false);
                }
                if (!Int32.TryParse(components[3], out width))
                {
                    return(false);
                }
                if (!Int32.TryParse(components[4], out height))
                {
                    return(false);
                }
                if (!Int32.TryParse(components[5], out left))
                {
                    return(false);
                }
                if (!Int32.TryParse(components[6], out top))
                {
                    return(false);
                }
                if (!Int32.TryParse(components[7], out right))
                {
                    return(false);
                }
                if (!Int32.TryParse(components[8], out bottom))
                {
                    return(false);
                }
                if (components.Length > 9)
                {
                    if (!ParseTilingParameter(components[9], ref tileCenter, ref tileEdges))
                    {
                        return(false);
                    }
                }
                if (components.Length > 10)
                {
                    if (!ParseTilingParameter(components[10], ref tileCenter, ref tileEdges))
                    {
                        return(false);
                    }
                }
                break;

            default:
                return(false);
            }

            image            = Create(texture, x, y, width, height, left, top, right, bottom);
            image.TileCenter = tileCenter;
            image.TileEdges  = tileEdges;
            return(true);
        }
		internal WorkitemSource(AssetID id, V1Instance instance) : base(id, instance) {}
 internal SecondaryWorkitem(AssetID id, V1Instance instance) : base(id, instance) {
 }
 internal ProjectStatus(AssetID id, V1Instance instance) : base(id, instance)
 {
 }
		internal IssuePriority(AssetID id, V1Instance instance) : base(id, instance) {}
예제 #11
0
 internal MessageReceipt(AssetID id, V1Instance instance) : base(id, instance)
 {
 }
 internal RequestType(AssetID id, V1Instance instance) : base(id, instance)
 {
 }
 internal WorkitemStatus(AssetID id, V1Instance instance) : base(id, instance)
 {
 }
 internal ThemeSource(AssetID id, V1Instance instance) : base(id, instance)
 {
 }
		internal RequestType(AssetID id, V1Instance instance) : base(id, instance) {}
 internal IssuePriority(AssetID id, V1Instance instance) : base(id, instance)
 {
 }
예제 #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SourcedAssetID"/> class.
 /// </summary>
 /// <param name="assetID">The asset's identifier.</param>
 /// <param name="assetSource">The asset's source.</param>
 public SourcedAssetID(AssetID assetID, AssetSource assetSource)
 {
     this.assetID     = assetID;
     this.assetSource = assetSource;
 }
 internal RegressionTestStatus(AssetID id, V1Instance instance) : base(id, instance)
 {
 }
 internal IssueResolutionReason(AssetID id, V1Instance instance) : base(id, instance)
 {
 }
		internal RegressionTestStatus(AssetID id, V1Instance instance) : base(id, instance) { }
 internal RequestResolution(AssetID id, V1Instance instance) : base(id, instance)
 {
 }
		internal EpicStatus(AssetID id, V1Instance instance) : base(id, instance) {}
 internal DefectResolutionReason(AssetID id, V1Instance instance) : base(id, instance)
 {
 }
		internal WorkitemPriority(AssetID id, V1Instance instance) : base(id, instance) {}
예제 #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SourcedResource{T}"/> structure.
 /// </summary>
 /// <param name="asset">The asset identifier of the resource.</param>
 /// <param name="source">An <see cref="AssetSource"/> value describing how to load the resource.</param>
 public SourcedResource(AssetID asset, AssetSource source)
 {
     this.Resource = new FrameworkResource <T>();
     this.Asset    = asset;
     this.Source   = source;
 }
		internal DefectType(AssetID id, V1Instance instance) : base(id, instance) {}
예제 #27
0
 internal BuildStatus(AssetID id, V1Instance instance) : base(id, instance)
 {
 }
		internal RequestPriority(AssetID id, V1Instance instance) : base(id, instance) {}
예제 #29
0
 internal WorkitemPriority(AssetID id, V1Instance instance) : base(id, instance)
 {
 }
예제 #30
0
 protected void NewSandboxMember()
 {
     sandboxMemberID = null;
 }
예제 #31
0
 internal WorkitemSource(AssetID id, V1Instance instance) : base(id, instance)
 {
 }
예제 #32
0
 /// <summary>
 /// Creates a new instance of the <see cref="StretchableImage9"/> class.
 /// </summary>
 /// <param name="texture">The asset identifier of the texture that contains the image.</param>
 /// <param name="left">The distance in pixels between the left edge of the image and the left edge of the image's center segment.</param>
 /// <param name="top">The distance in pixels between the top edge of the image and the top edge of the image's center segment.</param>
 /// <param name="right">The distance in pixels between the right edge of the image and the right edge of the image's center segment.</param>
 /// <param name="bottom">The distance in pixels between the bottom edge of the image and the bottom edge of the image's center segment.</param>
 /// <returns>The new instance of <see cref="StretchableImage9"/> that was created.</returns>
 public static StretchableImage9 Create(AssetID texture, Int32 left, Int32 top, Int32 right, Int32 bottom)
 {
     return(Create(texture, 0, 0, 0, 0, left, top, right, bottom));
 }
예제 #33
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SpriteAnimationID"/> structure from the specified animation name.
 /// </summary>
 /// <param name="spriteAssetID">The <see cref="AssetID"/> that represents the sprite that contains the animation.</param>
 /// <param name="animationName">The name of the referenced animation.</param>
 internal SpriteAnimationID(AssetID spriteAssetID, String animationName)
 {
     this.spriteAssetID  = spriteAssetID;
     this.animationName  = animationName;
     this.animationIndex = -1;
 }
예제 #34
0
 public SpriteFont GetSpriteFont(AssetID assetId, bool persistant = false)
 {
     return(GetOrLoad(assetId, persistant));
 }
예제 #35
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SpriteAnimationID"/> structure from the specified animation name.
 /// </summary>
 /// <param name="spriteAssetID">The <see cref="AssetID"/> that represents the sprite that contains the animation.</param>
 /// <param name="animationIndex">The index of the referenced animation.</param>
 internal SpriteAnimationID(AssetID spriteAssetID, Int32 animationIndex)
 {
     this.spriteAssetID  = spriteAssetID;
     this.animationName  = null;
     this.animationIndex = animationIndex;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SourcedCursorResource"/> class.
 /// </summary>
 /// <param name="cursorCollectionID">The asset identifier of the cursor collection that contains the cursor.</param>
 /// <param name="cursorName">The name of the cursor within its cursor collection.</param>
 public SourcedCursorResource(AssetID cursorCollectionID, String cursorName)
 {
     this.cursorCollectionID = cursorCollectionID;
     this.cursorName = cursorName;
 }
예제 #37
0
 internal DefectType(AssetID id, V1Instance instance) : base(id, instance)
 {
 }
예제 #38
0
 internal EpicType(AssetID id, V1Instance instance) : base(id, instance)
 {
 }
 internal TestSet(AssetID assetId, V1Instance instance) : base(assetId, instance) { }
		internal IssueType(AssetID id, V1Instance instance) : base(id, instance) {}
		private State(AssetID id) : base(id, null) { }
		internal ThemeSource(AssetID id, V1Instance instance) : base(id, instance) {}
		internal GoalPriority(AssetID id, V1Instance instance) : base(id, instance) {}
		internal TestStatus(AssetID id, V1Instance instance) : base(id, instance) { }
		internal WorkitemRisk(AssetID id, V1Instance instance) : base(id, instance) {}
		internal ListValue(AssetID id, V1Instance instance) : base(id, instance) {}
예제 #47
0
 /// <summary>
 /// Creates a new instance of the <see cref="StretchableImage3"/> class.
 /// </summary>
 /// <param name="texture">The asset identifier of the texture that contains the image.</param>
 /// <param name="left">The distance in pixels between the left edge of the image and the left edge of the image's center segment.</param>
 /// <param name="right">The distance in pixels between the right edge of the image and the right edge of the image's center segment.</param>
 /// <returns>The new instance of <see cref="StretchableImage3"/> that was created.</returns>
 public static StretchableImage3 Create(AssetID texture, Int32 left, Int32 right)
 {
     return(Create(texture, 0, 0, 0, 0, left, right));
 }
		internal WorkitemStatus(AssetID id, V1Instance instance) : base(id, instance) {}
예제 #49
0
 /// <summary>
 /// Creates a new instance of the <see cref="StretchableImage3"/> class.
 /// </summary>
 /// <param name="texture">The asset identifier of the texture that contains the image.</param>
 /// <param name="textureRegion">The region of the image's texture which contains the image.</param>
 /// <param name="left">The distance in pixels between the left edge of the image and the left edge of the image's center segment.</param>
 /// <param name="right">The distance in pixels between the right edge of the image and the right edge of the image's center segment.</param>
 /// <returns>The new instance of <see cref="StretchableImage3"/> that was created.</returns>
 public static StretchableImage3 Create(AssetID texture, Rectangle textureRegion, Int32 left, Int32 right)
 {
     return(Create(texture, textureRegion.X, textureRegion.Y, textureRegion.Width, textureRegion.Height, left, right));
 }
		internal TaskType(AssetID id, V1Instance instance) : base(id, instance) { }
		internal StoryType(AssetID id, V1Instance instance) : base(id, instance) {}
 internal BuildStatus(AssetID id, V1Instance instance) : base(id, instance) { }
예제 #53
0
 protected void NewSandboxSchedule()
 {
     sandboxScheduleID = null;
 }
 internal ProjectAsset(AssetID id, V1Instance instance) : base(id, instance) {}
예제 #55
0
 protected void NewSandboxProject()
 {
     sandboxProjectID = null;
 }
		internal EpicType(AssetID id, V1Instance instance) : base(id, instance) {}
예제 #57
0
 protected void NewSandboxIteration()
 {
     sandboxIterationID = null;
 }
		internal AttachmentType(AssetID id, V1Instance instance) : base(id, instance) { }
예제 #59
0
 protected void NewSandboxTeam()
 {
     sandboxTeamID = null;
 }