예제 #1
0
 public void AddLayer(LayerDef layerDef)
 {
     if (!_layerList.Contains(layerDef.ID))
     {
         _layerList.Add(layerDef);
     }
 }
예제 #2
0
        /// <summary>
        /// Adds a layer to WMS request
        /// </summary>
        /// <remarks>Layer names are case sensitive.</remarks>
        /// <param name="name">Name of layer</param>
        /// <exception cref="System.ArgumentException">Throws an exception is an unknown layer is added</exception>
        public void AddLayer(string name)
        {
            if (!LayerExists(wmsClient.Layer, name))
                throw new ArgumentException("Cannot add WMS Layer - Unknown layername");

            LayerList.Add(name);
        }
예제 #3
0
        /// <summary>
        /// 读取图层列表
        /// </summary>
        public void ReadConfig(string configString, Image srcImage)
        {
            if (configString.ToLower() == "noseg")//当图片不用分割时直接赋值
            {
                LayerList.Add(new LayerInfo()
                {
                    LayerImage = new Bitmap(srcImage), IsChangeColor = true, IsAddBackGround = true
                });
                return;
            }

            string[] configStingList = configString.Split('.');
            if (configStingList.Length == 1)//当图层配置只有一个图层时
            {
                LayerList.Add(new LayerInfo(configStingList[0], srcImage, 0, true));
            }
            else
            {
                for (int i = 0; i < configStingList.Length; i++)
                {
                    if (i == 0)
                    {
                        LayerList.Add(new LayerInfo(configStingList[i], srcImage, 0, false));
                    }
                    else
                    {
                        LayerList.Add(new LayerInfo(configStingList[i], srcImage, LayerList[i - 1].Start_Point.Y + LayerList[i - 1].Image_Size.Height, false));
                    }
                }
            }
        }
예제 #4
0
        /// <summary>
        /// Adds a layer to WMS request
        /// </summary>
        /// <remarks>Layer names are case sensitive.</remarks>
        /// <param name="name">Name of layer</param>
        /// <exception cref="System.ArgumentException">Throws an exception is an unknown layer is added</exception>
        public void AddLayer(string name)
        {
            if (_wmsClient == null || LayerList == null || !LayerExists(_wmsClient.Layer, name))
            {
                throw new ArgumentException("Cannot add WMS Layer - Unknown layer name");
            }

            LayerList.Add(name);
        }
예제 #5
0
 public GridBasedLevel()
     : base()
 {
     LayerList.Add(new GridBasedLayerFloor());
     LayerList.Add(new GridBasedLayerObstacle());
     LayerList.Add(new GridBasedLayerInteractive());
     LayerList.Add(new GridBasedLayerParticleEffect());
     LayerList.Add(new GridBasedLayerLight());
     LayerList.Add(new GridBasedLayerSound());
 }
        public bool AddLayer(StreamDeckLayer streamDeckLayer)
        {
            if (streamDeckLayer == null || string.IsNullOrEmpty(streamDeckLayer.Name))
            {
                return(false);
            }

            if (!LayerList.Contains(streamDeckLayer))
            {
                LayerList.Add(streamDeckLayer);
            }

            SetActiveLayer(streamDeckLayer.Name);
            return(true);
        }
예제 #7
0
        /// <summary>
        /// Creates a new layer in the layer list
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void layerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Bitmap temp = new Bitmap(canvasResolution.Item1, canvasResolution.Item2);

            Graphics g = Graphics.FromImage(temp);

            lock (g)
            {
                g.Clear(Color.FromArgb(0, 0, 0, 0));
            }
            g.Dispose();

            LayerList.Add(temp);
            LayerOpacities.Add(100);

            currentLayer = LayerList.Count - 1;

            updateLayerVisuals();
            colorControl();
        }
예제 #8
0
        public IdentifyVM(MapVM mapVM)
        {
            MapVM = mapVM;

            var _fakeLayer = new FeatureLayer();

            _fakeLayer.Name = "<All>";
            LayerList.Add(_fakeLayer);
            SelectedLayer = _fakeLayer;

            GraphicsOverlay = new GraphicsOverlay();
            MapVM.MapView.GraphicsOverlays.Add(GraphicsOverlay);

            IdentifyLayerResults = new ObservableCollection <LayerResult>();
            IdentifyLayerResults.CollectionChanged += IdentifyLayerResults_CollectionChanged;

            foreach (var item in MapVM.Map.OperationalLayers)
            {
                if (item is FeatureLayer)
                {
                    LayerList.Add(item);
                }

                if (item is GroupLayer)
                {
                    foreach (var subitem in ((GroupLayer)item).Layers)
                    {
                        if (subitem is FeatureLayer)
                        {
                            LayerList.Add(subitem);
                        }
                    }
                }
            }

            MapVM.MapView.GeoViewTapped += Identify;
        }
예제 #9
0
        public void LayerListChanged(PlotterController sender, LayerListInfo layerListInfo)
        {
            foreach (LayerHolder lh in LayerList)
            {
                lh.PropertyChanged -= LayerListItemPropertyChanged;
            }

            LayerList.Clear();

            foreach (CadLayer layer in layerListInfo.LayerList)
            {
                LayerHolder layerHolder = new LayerHolder(layer);
                layerHolder.PropertyChanged += LayerListItemPropertyChanged;

                LayerList.Add(layerHolder);
            }

            int idx = GetLayerListIndex(layerListInfo.CurrentID);

            if (idx >= 0)
            {
                SelectedItem = LayerList[idx];
            }
        }
예제 #10
0
        /// <summary>
        /// Initializes a new instance of a sprite by cloning another timeline.
        /// </summary>
        /// <param name="srcTimeline">The timeline to clone.</param>
        /// <param name="className">If the cloned timeline is a SWF, then
        /// you should pass in a class name here. The MainTimeline class
        /// will be renamed in here to this new name.</param>
        public Sprite(Timeline srcTimeline, SWF root, string className = null)
        {
            this._root = root;

            /* Layers are just objects that exist purely to be arranged in some
             * kind of order and be pointed at by more meaningful, other things.
             * To clone layers, we need to simply copy the list and map old
             * layer refs to our new ones. */
            Dictionary <Layer, Layer> newLayers = new Dictionary <Layer, Layer>(srcTimeline.LayerCount);

            foreach (Layer l in srcTimeline.Layers)
            {
                Layer newLayer = new Layer(this);
                LayerList.Add(newLayer);
                newLayers.Add(l, newLayer);
            }

            FrameList = new List <Frame>((int)srcTimeline.FrameCount);
            foreach (Frame f in srcTimeline.Frames)
            {
                Frame newFrame = new Frame();
                foreach (IDisplayListItem dli in f.DisplayList)
                {
                    newFrame.AddTag(dli.Clone(newLayers[dli.Layer], false));
                }
                FrameList.Add(newFrame);
            }

            if (srcTimeline is SWF)
            {
                SWF srcSWF = (SWF)srcTimeline;

                if (className != null)
                {
                    if (srcSWF.Class != null)
                    {
                        srcSWF.RenameMainTimelineClass(className);
                    }
                    /* Else the class will be generated later */
                }

                RemapFonts(srcSWF, root);

                if (className != null)
                {
                    foreach (DoABC abc in srcSWF.Scripts)
                    {
                        root.MergeScript(abc);
                    }
                }

                if (className == null)
                {
                    /* It's tempting to use ClassByName("flash.display.MovieClip") but
                     * remember that that class exists in the player, not the SWF. What
                     * we need in this case is just the name of the class, not a reference
                     * to the class itself. Because that's complicated, we assign a
                     * dummy class and watch for it when we write the class out. */
                    this.Class = AdobeClass.CreateFlashDisplayMovieClip(root.FirstScript.Code);
                }
                else
                {
                    this.Class = srcSWF.Class;
                }
            }
        }
예제 #11
0
 private Layer AddLayer(int depth)
 {
     LayerList.Add(new Layer(depth));
     return(LayerList[LayerList.Count - 1]);
 }