Ejemplo n.º 1
0
 public AdornmentLayer(IWpfTextView textView, LayerKind layerKind, MetadataAndOrder <IAdornmentLayersMetadata> info)
 {
     TextView               = textView ?? throw new ArgumentNullException(nameof(textView));
     this.layerKind         = layerKind;
     Info                   = info;
     adornmentLayerElements = new List <AdornmentLayerElement>();
 }
Ejemplo n.º 2
0
		public AdornmentLayer(IWpfTextView textView, LayerKind layerKind, MetadataAndOrder<IAdornmentLayersMetadata> info) {
			if (textView == null)
				throw new ArgumentNullException(nameof(textView));
			TextView = textView;
			this.layerKind = layerKind;
			Info = info;
			adornmentLayerElements = new List<AdornmentLayerElement>();
		}
Ejemplo n.º 3
0
		public AdornmentLayerCollection(IWpfTextView wpfTextView, LayerKind layerKind) {
			this.wpfTextView = wpfTextView ?? throw new ArgumentNullException(nameof(wpfTextView));
			this.layerKind = layerKind;
			adornmentLayers = new List<AdornmentLayer>();
			if (layerKind != LayerKind.Normal)
				ClipToBounds = true;
			wpfTextView.Closed += WpfTextView_Closed;
			wpfTextView.LayoutChanged += WpfTextView_LayoutChanged;
		}
Ejemplo n.º 4
0
		public AdornmentLayerCollection(IWpfTextView wpfTextView, LayerKind layerKind) {
			if (wpfTextView == null)
				throw new ArgumentNullException(nameof(wpfTextView));
			this.wpfTextView = wpfTextView;
			this.layerKind = layerKind;
			adornmentLayers = new List<AdornmentLayer>();
			if (layerKind != LayerKind.Normal)
				ClipToBounds = true;
			wpfTextView.Closed += WpfTextView_Closed;
			wpfTextView.LayoutChanged += WpfTextView_LayoutChanged;
		}
Ejemplo n.º 5
0
            public void Unserialize(GMDataReader reader)
            {
                Name    = reader.ReadStringPointerObject();
                ID      = reader.ReadInt32();
                Kind    = (LayerKind)reader.ReadInt32();
                Depth   = reader.ReadInt32();
                OffsetX = reader.ReadSingle(); OffsetY = reader.ReadSingle();
                HSpeed  = reader.ReadSingle(); VSpeed = reader.ReadSingle();
                Visible = reader.ReadWideBoolean();
                switch (Kind)
                {
                case LayerKind.Background:
                    Background = new LayerBackground();
                    Background.Unserialize(reader);
                    break;

                case LayerKind.Instances:
                    Instances = new LayerInstances();
                    Instances.Unserialize(reader);
                    break;

                case LayerKind.Assets:
                    Assets = new LayerAssets();
                    Assets.Unserialize(reader);
                    break;

                case LayerKind.Tiles:
                    Tiles = new LayerTiles();
                    Tiles.Unserialize(reader);
                    break;

                case LayerKind.Effect:
                    Effect = new LayerEffect();
                    Effect.Unserialize(reader);
                    break;

                default:
                    reader.Warnings.Add(new GMWarning($"Unknown layer kind {Kind}"));
                    break;
                }
            }
Ejemplo n.º 6
0
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="kind">Kind of layer</param>
		public LayerKindAttribute(LayerKind kind) {
			LayerKind = kind;
		}
Ejemplo n.º 7
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="kind">Kind of layer</param>
 public LayerKindAttribute(LayerKind kind) => LayerKind = kind;