コード例 #1
0
        private void timer2_Tick(object sender, EventArgs e)
        {
            string url  = "https://ruirui.hxlxz.com/getcomment.php?qunnum=" + qunnum;
            string temp = SmartQQ.HTTP.HttpGet(url);

            string[] tmp = temp.Split('★');
            for (int i = 0; i < tmp.Length; i++)
            {
                if (tmp[i] == null)
                {
                    break;
                }
                tmp[i] = tmp[i].Replace(Environment.NewLine, " ");
                tmp[i] = tmp[i].Replace("\n", " ");
                tmp[i] = tmp[i].Replace("\r", " ");
                if (!labels.ContainsKey(tmp[i]))
                {
                    Label label = new Label();
                    label.ForeColor = Color.FromArgb(randr.Next(255), randg.Next(255), randb.Next(255));
                    label.Location  = new Point(Screen.PrimaryScreen.Bounds.Width, randx.Next(1, (Screen.PrimaryScreen.Bounds.Height / 50) - 2) * 50);
                    label.AutoSize  = true;
                    label.Text      = tmp[i];
                    LabelClass labelClass = new LabelClass();
                    labelClass.label = label;
                    labelClass.times = 5;
                    labels.Add(tmp[i], labelClass);
                    Controls.Add(labels[tmp[i]].label);
                    Thread.Sleep(100);
                }
            }
        }
コード例 #2
0
        public void TestLabelZoomExtentsTest()
        {
            LabelClass target = new LabelClass(); // TODO: Initialize to an appropriate value

            target.TestLabelZoomExtents();
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
コード例 #3
0
    public static string LabelColors()
    {
        LabelClass labelClass      = new LabelClass();
        int        len             = LabelsBucket.GetLabels().Count;
        int        labelClassIndex = 0;

        labelClass.colors = new Color32[len];
        labelClass.labels = new int[len];
        foreach (KeyValuePair <BaseLabel, int> pair in LabelsBucket.GetLabels())
        {
            labelClass.labels[labelClassIndex] = pair.Value;
            if (LabelMaskCoordinator.HasState(pair.Key.labelName))
            {
                labelClass.colors[labelClassIndex] = pair.Key.encoderColor;
            }
            else
            {
                labelClass.colors[labelClassIndex] = new Color32(0, 0, 0, 0);
            }

            //Debug.Log(pair.Key.encoderColor + " " + pair.Value + " " + pair.Key.labelName);
            labelClassIndex += 1;
        }

        labelClass.mime = "mimey";
        string json = JsonUtility.ToJson(labelClass);

        return(json);
    }
コード例 #4
0
 protected override void OnInitialized()
 {
     InputType  = InputType.OrDefault(GetInputType());
     Id         = string.IsNullOrWhiteSpace(Id) ? Guid.NewGuid().ToString().Substring(0, 10) : Id;
     Name       = string.IsNullOrWhiteSpace(Name) ? Id : Name;
     GroupClass = GroupClass.OrDefault(Class).OrDefault("form-group");
     InputClass = InputClass.OrDefault(Class).OrDefault("form-control");
     LabelClass = LabelClass.OrDefault(Class);
     GroupStyle = GroupStyle.OrDefault(Style);
     InputStyle = InputStyle.OrDefault(Style);
     LabelStyle = LabelStyle.OrDefault(Style);
 }
コード例 #5
0
        public void LoadLabelInfoTest()
        {
            LabelClass target   = new LabelClass(); // TODO: Initialize to an appropriate value
            Layer      layer    = null;             // TODO: Initialize to an appropriate value
            Form       owner    = null;             // TODO: Initialize to an appropriate value
            bool       expected = false;            // TODO: Initialize to an appropriate value
            bool       actual;

            actual = target.LoadLabelInfo(layer, owner);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
コード例 #6
0
        private void CreateEndpointLayer()
        {
            var endpointLayer = new GraphicsLayer()
            {
                ID = "EndpointLayer",
                IsLabelingEnabled = true
            };

            // We are adding start and endpoints to same layer so render them differently
            var endpointLayerRenderer = new UniqueValueRenderer()
            {
                DefaultSymbol = new SimpleMarkerSymbol
                {
                    Color = Colors.Red,
                    Size  = 12
                },
                Fields = new ObservableCollection <string>()
                {
                    "PointType"
                },
                Infos = new UniqueValueInfoCollection()
                {
                    new UniqueValueInfo("EndPoint",
                                        new SimpleMarkerSymbol()
                    {
                        Color = Colors.Blue,
                        Size  = 12
                    })
                }
            };

            endpointLayer.Renderer = endpointLayerRenderer;

            // Crate labeling definition for start and end locations. Shows Address attribute as a label text.
            var labelClass = new LabelClass()
            {
                Symbol = new TextSymbol()
                {
                    Color           = Colors.Yellow,
                    BorderLineColor = Colors.Black,
                    BorderLineSize  = 2
                },
                TextExpression = "[Address]"
            };

            endpointLayer.LabelClasses = new LabelClassCollection {
                labelClass
            };

            Map.Layers.Add(endpointLayer);
            _graphicLayer = endpointLayer;
        }
コード例 #7
0
        private LabelClassCollection getLabelClassCollection()
        {
            LabelClassCollection lcc = new LabelClassCollection();

            LabelOptions lo = new LabelOptions()
            {
                FontSize = 12,
                FontStyle = TextStyle.Normal,
                Color = Colors.Black,
                FontFamily = new System.Windows.Media.FontFamily("Arial")
            };

            LabelClass lc = new LabelClass()
            {
                LabelOptions = lo,
                LabelExpression = "[AREANAME]",
                LabelPlacement = ESRI.ArcGIS.Client.LabelPlacement.PointLabelPlacementAboveCenter
            };

            lcc.Add(lc);

            return lcc;
        }
コード例 #8
0
        private LabelClassCollection getLabelClassCollection()
        {
            LabelClassCollection lcc = new LabelClassCollection();

            LabelOptions lo = new LabelOptions()
            {
                FontSize   = 12,
                FontStyle  = TextStyle.Normal,
                Color      = Colors.Black,
                FontFamily = new System.Windows.Media.FontFamily("Arial")
            };

            LabelClass lc = new LabelClass()
            {
                LabelOptions    = lo,
                LabelExpression = "[AREANAME]",
                LabelPlacement  = ESRI.ArcGIS.Client.LabelPlacement.PointLabelPlacementAboveCenter
            };

            lcc.Add(lc);

            return(lcc);
        }
コード例 #9
0
        private void CreateEndpointLayer()
        {
            var endpointLayer = new GraphicsLayer()
            {
                ID = "EndpointLayer", 
                IsLabelingEnabled = true
            };

			// We are adding start and endpoints to same layer so render them differently
            var endpointLayerRenderer = new UniqueValueRenderer()
            {
                DefaultSymbol = new SimpleMarkerSymbol
                {
                    Color = Colors.Red,
                    Size = 12
                },
                Fields = new ObservableCollection<string>() { "PointType" },
                Infos = new UniqueValueInfoCollection()
                                {
                                    new UniqueValueInfo("EndPoint", 
                                        new SimpleMarkerSymbol() 
                                            { 
                                                Color = Colors.Blue, 
                                                Size = 12 
                                            })
                                }
            };

            endpointLayer.Renderer = endpointLayerRenderer;

			// Crate labeling definition for start and end locations. Shows Address attribute as a label text.
            var labelClass = new LabelClass()
            {
                Symbol = new TextSymbol()
                {
                    Color = Colors.Yellow,
                    BorderLineColor = Colors.Black,
                    BorderLineSize = 2
                },
                TextExpression = "[Address]" 
            };

            endpointLayer.LabelClasses = new LabelClassCollection { labelClass };

            Map.Layers.Add(endpointLayer);
            _graphicLayer = endpointLayer;
        }
コード例 #10
0
ファイル: Form1.cs プロジェクト: hxl9654/RuiRuiComment
 private void timer2_Tick(object sender, EventArgs e)
 {
     string url = "https://ruirui.hxlxz.com/getcomment.php?qunnum=" + qunnum;
     string temp = SmartQQ.HTTP.HttpGet(url);
     string[] tmp = temp.Split('★');
     for (int i = 0; i < tmp.Length; i++)
     {
         if (tmp[i] == null)
             break;
         tmp[i] = tmp[i].Replace(Environment.NewLine, " ");
         tmp[i] = tmp[i].Replace("\n", " ");
         tmp[i] = tmp[i].Replace("\r", " ");
         if (!labels.ContainsKey(tmp[i]))
         {
             Label label = new Label();
             label.ForeColor = Color.FromArgb(randr.Next(255), randg.Next(255), randb.Next(255));
             label.Location = new Point(Screen.PrimaryScreen.Bounds.Width, randx.Next(1, (Screen.PrimaryScreen.Bounds.Height / 50) - 2) * 50);
             label.AutoSize = true;
             label.Text = tmp[i];
             LabelClass labelClass = new LabelClass();
             labelClass.label = label;
             labelClass.times = 5;
             labels.Add(tmp[i], labelClass);
             Controls.Add(labels[tmp[i]].label);
             Thread.Sleep(100);
         }
     }
 }
コード例 #11
0
        public void LabelClassConstructorTest()
        {
            LabelClass target = new LabelClass();

            Assert.Inconclusive("TODO: Implement code to verify target");
        }