コード例 #1
0
ファイル: EzspService.cs プロジェクト: vicmatmar/HubTester
        public bool SetupManager(string serialPort)
        {
            if (String.IsNullOrEmpty(serialPort))
            {
                return(false);
            }

            Manager = new LayerManager();

            Ezsp = new EmberEzspLayer(Manager);
            Ezsp.StackStatusHandler     += Ezsp_StackStatusHandler;
            Ezsp.IncomingMessageHandler += Ezsp_IncomingMessageHandler;
            Ezsp.ScanCompleteHandler    += Ezsp_ScanCompleteHandler;
            Ezsp.ScanErrorHandler       += Ezsp_ScanErrorHandler;
            Ezsp.MessageSentHandler     += Ezsp_MessageSentHandler;

            var ash      = new Centralite.Communications.Transport.EmberASHLayer(Manager);
            var hardware = new SerialLayer(Manager);

            hardware.SetConnection(serialPort, BaudRate);

            Manager.AddLayer(hardware);
            Manager.AddLayer(ash);
            Manager.AddLayer(Ezsp);

            return(true);
        }
コード例 #2
0
    //
    // Plugin specific methods
    //

    private void chartBox_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
    {
        if (isFirst)
        {
            x1Date  = chartBox.GetDate(e.X);
            y1Price = chartBox.GetPrice(e.Y);

            isFirst = false;
        }
        else
        {
            x2Pos = e.X;
            y2Pos = e.Y;

            x1Pos = chartBox.GetX(x1Date);
            y1Pos = chartBox.GetY(Convert.ToSingle(y1Price));

            color = this.chartBox.ToolColor;

            x = new XElement("layer");
            x.Add(new XElement("x1", x1Date));
            x.Add(new XElement("y1", y1Price));
            x.Add(new XElement("x2", chartBox.GetDate(x2Pos)));
            x.Add(new XElement("y2", chartBox.GetPrice(y2Pos)));
            x.Add(new XElement("color", color.ToArgb()));

            layerManager.AddLayer(x);

            isFirst = true;

            //DrawLine();
        }
    }
コード例 #3
0
ファイル: SMA.cs プロジェクト: dzmitrygt/TechAnalysis
    private void SMAForm_Closed(object sender, EventArgs e)
    {
        string text = smaForm.Controls[1].Text;

        if (Regex.IsMatch(text, @"^[0-9]+$"))
        {
            period = Convert.ToInt32(text);

            XElement x = new XElement("layer");
            x.Add(new XElement("period", period));
            layerManager.AddLayer(x);
        }
        else
        {
            MessageBox.Show("Incorrect SMA period", "Error");
        }
    }
コード例 #4
0
    //
    // Implementation
    //

    private void chartBox_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
    {
        color = chartBox.ToolColor;

        xElement = new XElement("layer");
        xElement.Add(new XElement("color", color.ToArgb()));
        layerManager.AddLayer(xElement, true);
    }
コード例 #5
0
 public void AddLayers()
 {
     LayerManager.AddLayer("StubColumn", Color.Green);
     LayerManager.AddLayer("TopColumn", Color.Blue);
     LayerManager.AddLayer("SidePanel", Color.Coral);
     LayerManager.AddLayer("FanRing", Color.Lime);
     LayerManager.AddLayer("KneeBraceClip", Color.DarkOrange);
     LayerManager.AddLayer("KneeBrace", Color.SkyBlue);
 }
コード例 #6
0
        private static void SetupCollisionsRulesAndPhysics()
        {
            //do we want physics?
            Physics.Instance.Gravity *= 2f;

            LayerManager.AddLayer((uint)CollisionLayer.BomberMan, (uint)CollisionLayer.SolidWall | (uint)CollisionLayer.Powerup | (uint)CollisionLayer.Explosion | (uint)CollisionLayer.Bombs);
            LayerManager.AddLayer((uint)CollisionLayer.Explosion, (uint)CollisionLayer.SolidWall);
            LayerManager.AddLayer((uint)CollisionLayer.Enemy, (uint)CollisionLayer.Enemy | (uint)CollisionLayer.Explosion | (uint)CollisionLayer.Bombs);
            //   LayerManager.AddLayer ( (uint)CollisionLayer.Bombs , (uint)CollisionLayer.BomberMan);
        }
コード例 #7
0
        private void Init(string logoRootPath, string logoName)
        {
            props = new ArtistProps();
            props.StringFormat = stringFormat;
            props.LogoRootPath = logoRootPath + logoName + "\\";
            props.ScriptConfig = FileUtil.ReadConfig <ScriptConfig>(props.LogoRootPath + "script.xml");
            props.LogoTypeName = logoName;

            layerManager.RemoveAllLayer();
            layerManager.AddLayer(props.LogoRootPath + "logo.png");
        }
コード例 #8
0
ファイル: MainForm.cs プロジェクト: Bgoon/BigPicture
        private void Initialize()
        {
            instance = this;
            FontManager.Initialize();
            SaveManager.Initialize();
            SaveManager.Option.Load();

            UpdateCheck.StartCheck();

            mainUI             = new MainUI();
            trashArea          = new TrashArea();
            TrashArea.instance = trashArea;
            layerNamer         = new LayerNamer();
            Controls.Add(layerNamer);
            layerNamer.BringToFront();

            dragEffector         = new DragEffector();
            dragEffector.Visible = false;
            Controls.Add(dragEffector);
            dragEffector.BringToFront();

            detailPanel = new DetailPanel();
            detailPanel.Show(this);
            detailPanel.Hide();

            bool loadSuccess = true;

            if (!SaveManager.Data.Load(SaveManager.saveDataInfo))
            {
                if (!SaveManager.Data.Load(SaveManager.saveDataBackupInfo))
                {
                    loadSuccess = false;
                }
            }
            if (!loadSuccess | LayerManager.Count == 0)
            {
                //초기화
                LayerManager.ClearLayer();
                LayerManager.AddLayer();
                LayerManager.AddLayer();
            }
            layerNamer.UpdateFont();

            Renderer.AddRenderQueue(mainUI);

            tickUpdater.Start();
            mouseUpdater.Start();

            if (!SaveManager.optionInfo.Exists)
            {
                ShowTutorial();
            }
        }
コード例 #9
0
ファイル: SunfrogToolkit.cs プロジェクト: radtek/ImageEditor
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            OpenFileDialog o = new OpenFileDialog();

            o.Filter = "Png files|*.png|jpeg files|*jpg|bitmaps|*.bmp";
            if (o.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                //pictureBox1.Image = (Image)Image.FromFile(o.FileName).Clone();
                layerManager.AddLayer(o.FileName);
                UpdateInfo();
                pictureBox1.Invalidate();
                UpdateUI();
            }
        }
コード例 #10
0
ファイル: MainUI.cs プロジェクト: Bgoon/BigPicture
        private void OnAddBtnClick(object sender, EventArgs e)
        {
            if (isDragging)
            {
                return;
            }
            Layer layer = LayerManager.AddLayer();

            if (layer != null)
            {
                Renderer.AddRenderQueue(layer);
                layer.mainText.UpdateWidth();
            }
        }
コード例 #11
0
    private void TextForm_Closed(object sender, EventArgs e)
    {
        Form textForm = (Form)sender;

        text = textForm.Controls[1].Text;

        color     = this.chartBox.ToolColor;
        textBrush = new SolidBrush(color);

        x = new XElement("layer");
        x.Add(new XElement("text", text));
        x.Add(new XElement("color", color.ToArgb()));
        x.Add(new XElement("x", chartBox.GetDate(X)));
        x.Add(new XElement("y", chartBox.GetPrice(Y)));
        layerManager.AddLayer(x);
    }
コード例 #12
0
ファイル: SaveManager.cs プロジェクト: Bgoon/BigPicture
            public static bool Load(FileInfo fileInfoOrigin)
            {
                FileInfo fileInfo;

                try {
                    lock (saveLocker) {
                        if (saveDataBackupInfo.Exists)
                        {
                            fileInfo = saveDataBackupInfo;
                        }
                        else if (saveDataInfo.Exists)
                        {
                            fileInfo = fileInfoOrigin;
                        }
                        else
                        {
                            return(false);
                        }
                        RemoveStack.stack.Clear();

                        string doc;
                        using (FileStream fileStream = new FileStream(fileInfo.FullName, FileMode.Open, FileAccess.Read)) {
                            using (StreamReader streamReader = new StreamReader(fileStream, Encoding.UTF8)) {
                                doc = streamReader.ReadToEnd();
                            }
                        }
                        //버전 읽기
                        int version = 10;
                        if (doc.Contains(VerText20))
                        {
                            version = 20;
                        }
                        //신뢰성 확인
                        switch (version)
                        {
                        case 20:
                            if (!doc.Contains(EndBlock))
                            {
                                return(false);
                            }
                            break;
                        }

                        //파싱 시작
                        if (!doc.Contains(GetStartSep(dataSep)))
                        {
                            return(false);
                        }
                        doc = StringParser.Parse(doc, GetStartSep(dataSep), GetEndSep(dataSep));

                        while (doc.Contains(GetStartSep(scheduleSep)))
                        {
                            string block = StringParser.Parse(doc, GetStartSep(scheduleSep), GetEndSep(scheduleSep));
                            doc = StringParser.Parse(doc, GetEndSep(scheduleSep));

                            //block에서 변수를 읽어들이고 적용
                            Layer layer = LayerManager.AddLayer();
                            if (layer == null)
                            {
                                continue;
                            }
                            if (block.Contains(textVar))
                            {
                                layer.mainText.Text = block.LoadString(textVar);
                            }
                            if (block.Contains(memoVar))
                            {
                                layer.memoText.Text = block.LoadString(memoVar);
                            }
                            if (block.Contains(showMemoVar))
                            {
                                layer.showMemo = block.LoadVar <bool>(showMemoVar);
                                layer.memoText.Select(0, 0);
                            }
                            if (block.Contains(priolityVar))
                            {
                                layer.IndexY = (float)(block.LoadVar <double>(priolityVar));
                            }
                            if (block.Contains(targetDateVar))
                            {
                                layer.TargetDate = DateTime.FromOADate(block.LoadVar <double>(targetDateVar));
                            }
                            if (block.Contains(colorVar))
                            {
                                layer.SetColorHue(block.LoadVar <int>(colorVar));
                            }

                            layer.Render();
                            layer.mainText.UpdateWidth();
                        }
                        //파싱 완료
                        return(true);
                    }
                } catch (Exception e) {
                    return(false);
                }
            }
コード例 #13
0
ファイル: TileEditor.cs プロジェクト: Babelz/MapEditor
        public override void AddLayer(string name, Point size)
        {
            TileLayer layer = new TileLayer(name, size, tileEngine);

            layers.AddLayer(layer);
        }