예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PolygonSymbolizer"/> class.
 /// </summary>
 /// <param name="selected">Boolean, true if this should use selection symbology.</param>
 public PolygonSymbolizer(bool selected)
 {
     Patterns = new CopyList <IPattern>();
     if (selected)
     {
         Patterns.Add(new SimplePattern(Color.Transparent));
         OutlineSymbolizer = new LineSymbolizer(Color.Cyan, 2);
     }
     else
     {
         Patterns.Add(new SimplePattern());
     }
 }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PointSymbolizer"/> class that has a character symbol based on the specified characteristics.
        /// </summary>
        /// <param name="character">The character to draw</param>
        /// <param name="fontFamily">The font family to use for rendering the font</param>
        /// <param name="color">The font color</param>
        /// <param name="size">The size of the symbol</param>
        public PointSymbolizer(char character, string fontFamily, Color color, double size)
        {
            Symbols = new CopyList <ISymbol>();
            CharacterSymbol cs = new CharacterSymbol(character, fontFamily, color, size);

            Symbols.Add(cs);
        }
예제 #3
0
        protected void CopyBtn_Click(object sender, EventArgs e)
        {
            var upath = Session["UserPath"] as string;

            foreach (RepeaterItem item in FileRepeater.Items)
            {
                try
                {
                    var cb    = item.Controls[0].Controls[3] as CheckBox;
                    var a     = item.Controls[0].Controls[0] as System.Web.UI.DataBoundLiteralControl;
                    var html  = a.Text;
                    var split = html.Split(new string[] { "title=" }, StringSplitOptions.None);
                    var title = split[1].Replace("'", "").Replace(">\r\n", "").TrimStart(' ').TrimEnd(' ');
                    var ext   = Path.GetExtension(title);
                    if (cb.Checked)
                    {
                        if (!CopyList.Contains(new KeyValuePair <string, string>(upath, title)))
                        {
                            CopyList.Add(new KeyValuePair <string, string>(upath, title));
                        }
                        ;
                    }
                }
                catch { }
            }
            UpdateAll();
        }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PointSymbolizer"/> class that has a member that is constructed
        /// from the specified image.
        /// </summary>
        /// <param name="image">The image to use as a point symbol</param>
        /// <param name="size">The desired output size of the larger dimension of the image.</param>
        public PointSymbolizer(Image image, double size)
        {
            Symbols = new CopyList <ISymbol>();
            IPictureSymbol ps = new PictureSymbol(image);

            ps.Size = new Size2D(size, size);
            Symbols.Add(ps);
        }
예제 #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PointSymbolizer"/> class with one member that constructed
        /// based on the values specified.
        /// </summary>
        /// <param name="color">The color of the symbol.</param>
        /// <param name="shape">The shape of the symbol.</param>
        /// <param name="size">The size of the symbol.</param>
        public PointSymbolizer(Color color, PointShape shape, double size)
        {
            Smoothing = true;
            Symbols   = new CopyList <ISymbol>();
            ISimpleSymbol ss = new SimpleSymbol(color, shape, size);

            Symbols.Add(ss);
        }
예제 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PolygonSymbolizer"/> class using the patterns specified by the list or array of patterns.
 /// </summary>
 /// <param name="patterns">The patterns to add to this symbolizer.</param>
 public PolygonSymbolizer(IEnumerable <IPattern> patterns)
 {
     Patterns = new CopyList <IPattern>();
     foreach (IPattern pattern in patterns)
     {
         Patterns.Add(pattern);
     }
 }
예제 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PointSymbolizer"/> class.
 /// </summary>
 /// <param name="presetSymbols">The symbols that are used.</param>
 public PointSymbolizer(IEnumerable <ISymbol> presetSymbols)
 {
     Smoothing = true;
     Symbols   = new CopyList <ISymbol>();
     foreach (ISymbol symbol in presetSymbols)
     {
         Symbols.Add(symbol);
     }
 }
예제 #8
0
파일: AppSettings.cs 프로젝트: Caught/SESE
        public void CancelEdit()
        {
            if (!_isEditing)
            {
                return;
            }
            Donated         = _mDonated;
            CheckUpdates    = _mCheckUpdates;
            CurrentLanguage = _mCurrentLanguage;
            Delimiters      = _mDelimiters;
            Tasks.Clear();
            foreach (Task task in _mTtasks)
            {
                Tasks.Add(task);
                task.CancelEdit();
            }

            Profiles.Clear();
            foreach (Profile profile in _mProfiles)
            {
                Profiles.Add(profile);
                profile.CancelEdit();
            }

            MoveList.Clear();
            foreach (PositionTransform positionTransform in _mMoveList)
            {
                MoveList.Add(positionTransform);
                positionTransform.CancelEdit();
            }

            CopyList.Clear();
            foreach (PositionTransform positionTransform in _mCopyList)
            {
                CopyList.Add(positionTransform);
                positionTransform.CancelEdit();
            }

            Languages.Clear();
            foreach (Language language in _mLanguages)
            {
                Languages.Add(language);
                language.CancelEdit();
            }

            _mProfiles.Clear();
            _mMoveList.Clear();
            _mCopyList.Clear();
            _mLanguages.Clear();
            _mTtasks.Clear();

            _isEditing = false;
        }
예제 #9
0
        private PointSymbolizer GetPointSymbolizer(Color symbolColor, DotSpatial.Symbology.PointShape symbolShape, double symbolSize)
        {
            IList <ISymbol> symbolsList = new CopyList <ISymbol>();

            symbolsList.Add(new SimpleSymbol(symbolColor, symbolShape, symbolSize)
            {
                UseOutline = true, OutlineColor = Color.Black
            });
            return(new PointSymbolizer(symbolsList)
            {
                Smoothing = true
            });
        }
예제 #10
0
        public override string Process(string id, string mediaUriOffset)
        {
            string markdown = "";
            // Find largest image, if we need multiple image versions for a responsive blog we'll create them in the Static Site Generator
            MediaDescription m = Media.FirstOrDefault(n => n.HasOriginalDimensions == true);

            if (m == null)
            {
                m = Media.OrderByDescending(n => n.Width).FirstOrDefault();
            }
            string filename = $"{id}.{m.Url.GetFileType()}";

            CopyList.Add(new MediaToCopy(m.Url, filename));

            markdown = $"{{{{<figure src=\"{(mediaUriOffset ?? "")}{filename}\" caption=\"\" >}}}}\n";
            return(markdown);
        }
예제 #11
0
        public override string Process(string id, string mediaUriOffset)
        {
            string markdown;

            switch (Provider)
            {
            case "spotify":
            {
                markdown = $"{{{{<embedded_audio src=\"{EmbedUrl}\" class=\"spotify_audio_player\" >}}}}\n";
            }
            break;

            case "soundcloud":
            {
                markdown = $"{{{{<embedded_audio src=\"{EmbedUrl}\" class=\"soundcloud_audio_player\" >}}}}\n";
            }
            break;

            case null:
            {
                // Copy over the poster image
                string posterUrl = Poster.FirstOrDefault().Url;
                string filename  = $"{id}.{posterUrl.GetFileType()}";
                CopyList.Add(new MediaToCopy(posterUrl, filename));
                // Copy over the audio file
                string url = Media.Url;
                filename = $"{id}.{url.GetFileType()}";
                CopyList.Add(new MediaToCopy(url, filename));

                markdown = $"{{{{<audio src=\"{(mediaUriOffset ?? "")}{filename}\" type=\"{Media.Type}\" poster=\"{filename}\" caption=\"{Artist} - {Title}\">}}}}\n";
            }
            break;

            default:
            {
                markdown = $"Audio provider unknown- {Provider}";
            }
            break;
            }
            return(markdown + "\n");
        }
예제 #12
0
        public override string Process(string id, string mediaUriOffset)
        {
            string markdown;

            switch (Provider)
            {
            case "youtube":
            {
                var title = Attribution.DisplayText.Replace("\"", "");
                markdown = $"{{{{<youtube id=\"{Metadata.Id}\" title=\"{title}\" >}}}}\n";
            }
            break;

            case "vimeo":
            {
                var title = Attribution.DisplayText.Replace("\"", "");
                markdown = $"{{{{<vimeo id=\"{Url.Split('/').Last()}\" title=\"{title}\" >}}}}\n";
            }
            break;

            case null:     //tumblr video
            {
                // Copy over the video file
                string url      = Media.Url;
                string filename = $"{id}.{url.GetFileType()}";
                CopyList.Add(new MediaToCopy(url, filename));
                markdown = $"{{{{<video src=\"{(mediaUriOffset ?? "")}{filename}\" type=\"{Media.Type}\" >}}}}\n";
            }
            break;

            default:
            {
                markdown = $"Video provider unknown- {Provider}\n";
            }
            break;
            }
            return(markdown);
        }
예제 #13
0
//SUPER BUTTON*********************************
        protected void SuperButton_Click(object sender, EventArgs e)
        {
            var u       = UserPath = Session["UserPath"] as string;
            var args    = SuperButtonArg.Text.Split(',');
            var command = args[0];
            var target  = args[1].Replace("\r\n", "").TrimStart(' ').TrimEnd(' ');
            var go      = 0;

            switch (command)
            {
            case "cut":
                if (!CutList.Contains(new KeyValuePair <string, string>(Upath, target)))
                {
                    CutList.Add(new KeyValuePair <string, string>(Upath, target));
                }
                CutBtn_Click(this, new EventArgs());
                break;

            case "copy":
                if (!CopyList.Contains(new KeyValuePair <string, string>(Upath, target)))
                {
                    CopyList.Add(new KeyValuePair <string, string>(Upath, target));
                }
                CopyBtn_Click(this, new EventArgs());
                break;

            case "paste":
                PasteContent(target);
                break;

            case "inputaccept":
                InputModal.Style.Clear();
                InputModal.Style.Add("display", "none");
                var name = RenameInputBox.Text;
                //find file and rename it
                target = Session["Rename"] as string;
                if (Path.GetExtension(target) == "")
                {
                    RenameDir(target, name);
                }
                else
                {
                    RenameFile(target, name);
                }

                UpdateAllPanels();
                break;

            case "rename":
                InputModal.Style.Clear();
                InputModal.Style.Add("display", "inline-block");
                Session["Rename"]   = target;
                RenameInputBox.Text = target;
                RenameInputBox.Focus();
                UpdateAllPanels();

                break;

            case "delete":
                if (Path.GetExtension(target) == "")
                {
                    DeleteDir(target);
                }
                else
                {
                    DeleteFile(target);
                }
                DeleteBtn_Click(this, new EventArgs());
                break;

            case "New Folder":
                var newpath = Server.MapPath(UserPath) + "New Folder";
                Directory.CreateDirectory(newpath);
                break;

            default:
                break;
            }
            var aa = Session["UserPath"] as string;

            UpdateFileLists(aa);
            UpdateAllPanels();
        }