示例#1
0
        /// <summary>
        /// Write text to Console
        /// </summary>
        /// <param name="args">text to be written to the Console</param>
        static void Main(string[] args)
        {
            string SpecifiedText = args[0];
            var    Converse      = new ShowText(SpecifiedText);

            Converse.ConsoleWrite();
        }
示例#2
0
        /// <summary>
        /// 修改拥护修改的连接线的 名称
        /// </summary>
        public void ChangeLineContent()
        {
            string ShowText;
            int    i;
            int    Node_ID;

            if (this.tb_InConnectCondition.Enabled == true)
            {
                ShowText = this.cb_inflowNode.Text;
                i        = ShowText.LastIndexOf("ID:");
                Node_ID  = int.Parse(ShowText.Substring(i + 3, 1));
                for (int j = 0; j < this.arr_InFlowLineList.Count; j++)
                {
                    Line line = (Line)this.arr_InFlowLineList[j];
                    if (line.SecondNode == this.node && line.FirstNode.NodeListIndex == Node_ID)
                    {
                        line.Content = this.tb_InConnectCondition.Text;
                    }
                }
            }
            if (this.tb_OutConnectCondition.Enabled == true)
            {
                ShowText = this.cb_outflowNode.Text;
                i        = ShowText.LastIndexOf("ID:");
                Node_ID  = int.Parse(ShowText.Substring(i + 3, 1));
                for (int j = 0; j < this.arr_OutFlowLineList.Count; j++)
                {
                    Line line = (Line)this.arr_OutFlowLineList[j];
                    if (line.FirstNode == this.node && line.SecondNode.NodeListIndex == Node_ID)
                    {
                        line.Content = this.tb_OutConnectCondition.Text;
                    }
                }
            }
        }
示例#3
0
        public async Task <bool> Init(ParametersRequest parametersRequest, ShowText showText)
        {
            _con?.Close();
            _con = await Connect(parametersRequest, showText);

            return(_con != null);
        }
示例#4
0
 private void btnStart_Click(object sender, EventArgs e)
 {
     showText = ShowTxt;
     try
     {
         Logger.Enqueue("程序开始启动...");
         modeSlave = ModbusTcpSlave.CreateTcp(1,
                                              new TcpListener(IPAddress.Any, int.Parse(txtServerPort.Text)));
         modeSlave.Listen();
         Logger.Enqueue("MODBUS服务已经启动完成");
         dtuAdapter.slaveDataStore = modeSlave.DataStore;
         dtuAdapter.StartServer(int.Parse(txtDTUPort.Text));
         ThreadPool.QueueUserWorkItem(o =>
         {
             while (IsRunning || Logger.Count != 0)
             {
                 if (Logger.Count > 0)
                 {
                     var str = Logger.Dequeue();
                     Invoke(showText, richTextBox1, str);
                 }
                 Thread.Sleep(100);
             }
         });
     }
     catch (Exception ex)
     {
         Logger.Enqueue("程序界面线程出错," + ex.Message + ",程序界面线程已经退出!");
     }
 }
示例#5
0
    public void CreateShowText(Vector2 position, int score, int chain = 0)
    {
        string msg = string.Empty;

        if (chain > 0 && !CatBasic.IS_LOOP)
        {
            msg = Localization.Get("comboX", chain);
        }
        else if (chain > 0 && CatBasic.IS_LOOP)
        {
            msg = Localization.Get("comboLoopX", chain);
        }

        if (POOL_SHOW_TEXTS.Count > 0)
        {
            POOL_SHOW_TEXTS[0].gameObject.SetActive(true);
            POOL_SHOW_TEXTS[0].Setup(position, score.SpaceFormat(), msg);
            POOL_SHOW_TEXTS.Remove(POOL_SHOW_TEXTS[0]);
        }
        else
        {
            ShowText showText = Instantiate(showTextPrefab) as ShowText;
            showText.name = "Show Text " + ++LAST_ID;
            showText.t    = showText.transform as RectTransform;
            showText.t.SetParent(ui.showTextParent, false);
            showText.Setup(position, score.SpaceFormat(), msg);
        }
    }
    //Called by ShowText class when the object is clicked, triggers manager to handle new text prompt if the UI manager isn't waiting for a response in the current text prompt
    public void TextPromptClicked(ShowText showTextObject)
    {
        if (showTextObject.responseObject)
        {
            Manager <UIManager> .Instance.awaitingResponse = false;
        }

        //Ignore this click if the UI manager is waiting for a response and this isn't a response object
        if (!Manager <UIManager> .Instance.awaitingResponse || (Manager <UIManager> .Instance.awaitingResponse && showTextObject.responseObject))
        {
            //Check to see if the text prompt has an alternate version based on a game data check, if so do the check and if the values match run the alternate version, if not matching or no check run normal
            if (showTextObject.textPromptSO.gameDataCheck)
            {
                if (GetGameDataValue(showTextObject.textPromptSO.checkGameDataKey) == showTextObject.textPromptSO.checkGameDataValue)
                {
                    ShowPopupText(showTextObject.textPromptSO.alternateTextPromptSO);
                }
                else
                {
                    ShowPopupText(showTextObject.textPromptSO);
                }
            }
            else
            {
                ShowPopupText(showTextObject.textPromptSO);
            }
        }
    }
示例#7
0
 void Start()
 {
     sr              = GetComponent <SpriteRenderer>();
     showText        = GetComponent <ShowText>();
     highlightSprite = GetComponent <HighlightSprite>();
     ClearInventoryObject();
 }
示例#8
0
        private void ui_chat_Load(object sender, EventArgs e)
        {
            this.Text = STR_TITLE_BEFOR + str_friend_notename + STR_TITLE_AFTER;
            this.Size = new Size(FORM_WEIGHT_NOHISTORY, this.Size.Height);
            // 给委托添加方法
            show_text = new ShowText(SetMessage);

            tables_moment_msg = new Hashtable();
        }
示例#9
0
    public static void ShowMsg(string mes)
    {
        //GameObject mesPrefab = ResourceManager.Instance.LoadMesPrefab() as GameObject;
        //GameObject go = NGUITools.AddChild(GameObject.FindWithTag("JGNGUICamera"), mesPrefab);
        //go.transform.localPosition = new Vector3(0, 60, 0);
        //ShowText st = go.GetComponent<ShowText>();
        ShowText st = D("ShowMsg") as ShowText;

        st.SetText(mes);
    }
示例#10
0
 // Use this for initialization
 void Start()
 {
     m_ScenarioScript = FindObjectOfType(typeof(scenarioChange)) as scenarioChange;
     m_ScriptText     = FindObjectOfType(typeof(ShowText)) as ShowText;
     // Dar ao jogador o objetivo do puzzle
     m_ScriptText.showText("Seu amigo está no terraço da escola. Melhor ir para lá...");
     m_ScriptText.cleanTextAfterSeconds(5);
     m_ItemLista = new List <int>();
     m_lerpColor = true;
 }
示例#11
0
 private void cmdMail_Click(object sender, EventArgs e)
 {
     progress      = new ProgressWindow();
     progress.Text = "Emailing";
     System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(DoSomeWork), progress);
     progress.ShowDialog();
     if (errorMail)
     {
         ShowText.Show(errorList.ToString(), "Failed Email");
     }
 }
    // Use this for initialization
    void Start()
    {
        // displays a text in the inventory section
        mTextControllerGO = GameObject.Find("TextController");
        mShowTextScript   = mTextControllerGO.GetComponent <ShowText>();

        mGuiBoxGO     = GameObject.Find("TextController");
        mGuiBoxScript = mGuiBoxGO.GetComponent <GuiBox> ();

        mTargetName = gameObject.transform.name;
    }
示例#13
0
    void Awake()
    {
        libpd = GameObject.Find("LibPD");
        GameObject canvas = GameObject.Find("Canvas");

        gui_text = canvas.GetComponent <ShowText> ();

        GameObject genomecanvas = GameObject.Find("GenomeCanvas");

        genome_text = genomecanvas.GetComponent <ShowText> ();

//		lib_control = libpd.GetComponent<Control>();
    }
        private void SerialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
        {
            int count = serialPort1.BytesToRead;

            if (count > 0)
            {
                Console.WriteLine("GETLENGTH:" + count);
                byte[] bufferBytes = new byte[count];
                serialPort1.Read(bufferBytes, 0, count);
                atComm.setReceviceStr(Encoding.Default.GetString(bufferBytes));
                ShowText toShow = new ShowText(showText);
                this.BeginInvoke(toShow, Encoding.Default.GetString(bufferBytes));
            }
        }
示例#15
0
 public void Process(ShowText method)
 {
     score++;
     if (score != 80)
     {
         timer = Settings.timerCount - score;
     }
     else
     {
         timer = Settings.timerCount - 80;
     }
     Word = Pick().ToLower();
     method(Word, score);
 }
示例#16
0
        public PlayingState(IAnarkanoidGame arkanoidGame, IKeysConfiguration keysConfiguration) : base(arkanoidGame, keysConfiguration)
        {
            _currentLivesText = new ShowText(Configuration, new Size(Configuration.ScreenSize.Width, Configuration.ScreenSize.Height));
            AnarkanoidGame.ComponentManager.AddText(_currentLivesText, string.Format(CURRENT_LIVES_TEXT_FORMAT, AnarkanoidGame.CurrentLives));
            //AnarkanoidGame.ComponentManager.SpaceShip.Shooter = new Shooters.BasicShooter(AnarkanoidGame.ComponentManager.Configuration, new Size(30, 20), AnarkanoidGame.ComponentManager.SpaceShip);

            CommandPerKey.Add(Keys.Left, CommandsFactory.GetMoveSpaceShipToLeftCommand());
            CommandPerKey.Add(Keys.Right, CommandsFactory.GetMoveSpaceShipToRightCommand());
            CommandPerKey.Add(Keys.Shoot, CommandsFactory.GetActionCommand(Shoot));

            _collisionDetector           = new BallSpaceShipCollisionDetector(Components.SpaceShip);
            _prizeCollisionDetector      = new SpaceShipPrizeCollisionDetector(AnarkanoidGame.ComponentManager.SpaceShip);
            _shootBlockCollisionDetector = new ShootBlockCollisionDetector();
        }
        /**
         * Loads all the supported graphics and text state operators in a map.
         */
        private void PopulateOperators()
        {
            RegisterContentOperator(DEFAULTOPERATOR, new IgnoreOperatorContentOperator());

            RegisterContentOperator("q", new PushGraphicsState());
            RegisterContentOperator("Q", new PopGraphicsState());
            RegisterContentOperator("cm", new ModifyCurrentTransformationMatrix());
            RegisterContentOperator("gs", new ProcessGraphicsStateResource());

            SetTextCharacterSpacing tcOperator = new SetTextCharacterSpacing();

            RegisterContentOperator("Tc", tcOperator);
            SetTextWordSpacing twOperator = new SetTextWordSpacing();

            RegisterContentOperator("Tw", twOperator);
            RegisterContentOperator("Tz", new SetTextHorizontalScaling());
            SetTextLeading tlOperator = new SetTextLeading();

            RegisterContentOperator("TL", tlOperator);
            RegisterContentOperator("Tf", new SetTextFont());
            RegisterContentOperator("Tr", new SetTextRenderMode());
            RegisterContentOperator("Ts", new SetTextRise());

            RegisterContentOperator("BT", new BeginTextC());
            RegisterContentOperator("ET", new EndTextC());
            RegisterContentOperator("BMC", new BeginMarkedContentC());
            RegisterContentOperator("BDC", new BeginMarkedContentDictionary());
            RegisterContentOperator("EMC", new EndMarkedContentC());

            TextMoveStartNextLine tdOperator = new TextMoveStartNextLine();

            RegisterContentOperator("Td", tdOperator);
            RegisterContentOperator("TD", new TextMoveStartNextLineWithLeading(tdOperator, tlOperator));
            RegisterContentOperator("Tm", new TextSetTextMatrix());
            TextMoveNextLine tstarOperator = new TextMoveNextLine(tdOperator);

            RegisterContentOperator("T*", tstarOperator);

            ShowText tjOperator = new ShowText();

            RegisterContentOperator("Tj", new ShowText());
            MoveNextLineAndShowText tickOperator = new MoveNextLineAndShowText(tstarOperator, tjOperator);

            RegisterContentOperator("'", tickOperator);
            RegisterContentOperator("\"", new MoveNextLineAndShowTextWithSpacing(twOperator, tcOperator, tickOperator));
            RegisterContentOperator("TJ", new ShowTextArray());

            RegisterContentOperator("Do", new Do());
        }
示例#18
0
        public WinGameState(IAnarkanoidGame arkanoidGame, IKeysConfiguration keysConfiguration) : base(arkanoidGame, keysConfiguration)
        {
            var textComponent = new ShowText(Configuration, new Size(Configuration.ScreenSize.Width, Configuration.ScreenSize.Height))
            {
                Position = new Vector2(200, 200)
            };

            AnarkanoidGame.ComponentManager.AddText(textComponent, YOU_DID_IT_TEXT);

            Components.SpaceShip.Reset();
            AnarkanoidGame.ComponentManager.AddSpaceShip(AnarkanoidGame.ComponentManager.SpaceShip);

            CommandPerKey.Add(Keys.Left, CommandsFactory.GetMoveSpaceShipToLeftCommand());
            CommandPerKey.Add(Keys.Right, CommandsFactory.GetMoveSpaceShipToRightCommand());
            CommandPerKey.Add(Keys.Shoot, CommandsFactory.GetActionCommand(UserWantsMore));
        }
示例#19
0
    protected void OnEnable()
    {
        var wb = GameObject.Find("WhiteBoardWithDisplay");

        if (wb != null)
        {
            whiteboardText = wb.GetComponent <ShowText>();
            whiteboardText.Hide();
            whiteboardImage = wb.GetComponent <ShowImage>();
            whiteboardImage.Hide();
        }
        input   = FindObjectOfType <InputBroker>();
        subject = FindObjectOfType <SubjectDataHolder>();
        subject.LoadSubjectData();
        salienceController.ResetRunningAverage();
    }
示例#20
0
        public ConfigureControlsState(IAnarkanoidGame arkanoidGame, IKeysConfiguration keys) : base(arkanoidGame, keys)
        {
            KeyDelay      = KEY_DELAY;
            TOTAL_OPTIONS = OPTIONS_TEXTS.Length;
            _texts        = new List <IGameComponent>();
            KEYS          = new List <Keys>()
            {
                Keys.Left,
                Keys.Right,
                Keys.Shoot
            };

            KEYS_ACTIONS = new List <ChangeKey>()
            {
                ChangeLeftControl,
                ChangeRightControl,
                ChangeShootControl
            };

            var textTopPosition = FIRST_OPTION_TEXT_POSITION.Y;

            for (int i = 0; i < OPTIONS_TEXTS.Length; i++)
            {
                string optionText = OPTIONS_TEXTS[i];
                var    text       = new ShowText(AnarkanoidGame.ComponentManager.Configuration, OPTION_TEXT_SIZE)
                {
                    Position    = new Microsoft.Xna.Framework.Vector2(FIRST_OPTION_TEXT_POSITION.X, textTopPosition),
                    SpriteColor = i == 0 ? SELECTED_TEXT_COLOR : TEXT_COLOR
                };

                if (i == OPTIONS_TEXTS.Length - 1)
                {
                    AnarkanoidGame.ComponentManager.AddText(text, optionText);
                }
                else
                {
                    AnarkanoidGame.ComponentManager.AddText(text, string.Format(TEXT_KEY_TEXT_FORMAT, optionText.PadRight(15), KEYS[i].ToString().PadLeft(15)));
                }

                _texts.Add(text);
                textTopPosition += text.Size.Height;
            }

            CommandPerKey.Add(Keys.Down, CommandsFactory.GetActionCommand(NextKeyConfiguration));
            CommandPerKey.Add(Keys.Up, CommandsFactory.GetActionCommand(PreviousKeyConfiguration));
            CommandPerKey.Add(Keys.Enter, CommandsFactory.GetActionCommand(SelectedOption));
        }
    void Start()        // Use this for initialization
    // displays a text in the inventory section
    {
        mTextControllerGO = GameObject.Find("TextController");
        mShowTextScript   = mTextControllerGO.GetComponent <ShowText>();

        mGuiBoxScript = mTextControllerGO.GetComponent <GuiBox> ();

        // displays a gui box which can be set visible or invisible
        mGuiBoxGO     = GameObject.Find("TextController");
        mGuiBoxScript = mGuiBoxGO.GetComponent <GuiBox> ();

        // displays a debug console text line in the left upper corner
        mGuiLabelGO     = GameObject.Find("TextController");
        mGuiLabelScript = mGuiLabelGO.GetComponent <GuiLabel> ();


        mObject0 = GameObject.Find("BierflascheVoll");
        mObject0.SetActive(false);


        mObject1 = GameObject.Find("coins");
        mObject1.SetActive(false);


        mObject2 = GameObject.Find("Ausweis");
        mObject2.SetActive(false);


        mObject3 = GameObject.Find("Handschuhe");
        mObject3.SetActive(false);

        print("AndroidCommunicationController class started");



        // SendFullNameToUnity ("##TestFullName");


        // code for java connection
        //AndroidJNIHelper.debug = true;
        //AndroidJavaClass jc = new AndroidJavaClass("com.works.forme");

        //AndroidJavaObject jo = new AndroidJavaObject ("com.works.forme.BlankFragment");
        //jo.CallStatic ("showAd");
    }
        public void ReadText()
        {
            //初始化字符串text为列表框中选择的项
            string text = messagelistBox.SelectedItem.ToString();

            //将text中字符串以空格分割放入字符串数组texts中
            string[] texts = text.Split(' ');
            //将netStream与邮件名传入ShowText类的构造函数中
            ShowText st = new ShowText(netStream, texts[1]);

            //显示对话框
            st.ShowDialog();
            //将欲读的邮件从列表框中移出
            messagelistBox.Items.Remove(messagelistBox.SelectedItem);
            //加入“已读”标记
            messagelistBox.Items.Add("已读" + text.Remove(0, 2));
        }
示例#23
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(this.gameObject);
        }

        DontDestroyOnLoad(gameObject);

        panelsScript   = GetComponent <PanelsManager> ();
        startScript    = GetComponent <StartOptions> ();
        showTextScript = GetComponent <ShowText> ();
    }
示例#24
0
        public async Task <ExcelPackage> Open(ParametersRequest parametersRequest, ShowText showText)
        {
            string message = null;

            while (await GetOptions(parametersRequest, message))
            {
                ExcelPackage pkg = null;
                try
                {
                    if (File.Exists(Filename))
                    {
                        pkg = new ExcelPackage(new FileInfo(Filename));
                        var sheet = pkg.Workbook.Worksheets[1];
                        if (sheet.Dimension != null)
                        {
                            var last = sheet.Dimension.End.Column;
                            for (int c = FirstCol; c <= last; c++)
                            {
                                var cn = c.GetExcelColumnName();
                                _Fields[FirstIsHead ? sheet.Cells[$"{cn}{FirstRow}"].Value.ToString() : cn] = cn;
                            }
                        }
                    }
                    else
                    {
                        pkg = new ExcelPackage(new FileStream(Filename, FileMode.CreateNew));
                        pkg.Workbook.Worksheets.Add("data");
                        FirstRow    = 1;
                        FirstIsHead = true;
                    }
                    return(pkg);
                }
                catch (Exception e)
                {
                    pkg?.Dispose();
                    message = e.Message;
                    Helpers.ConsoleWrite(message, ConsoleColor.Red);
                }
            }
            return(null);
        }
示例#25
0
 private void cmdVerstuurMail_Click(object sender, EventArgs e)
 {
     if (txtSubject.Text == string.Empty)
     {
         MessageBox.Show("Onderwerp is leeg", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     if (clbLeden.CheckedItems.Count == 0)
     {
         MessageBox.Show("Geen geselecteerde email adressen", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     progress      = new ProgressWindow();
     progress.Text = "Emailing";
     System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(DoSomeWork), progress);
     progress.ShowDialog();
     if (errorMail)
     {
         ShowText.Show(errorList.ToString(), "Failed Email", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#26
0
        public DeadState(IAnarkanoidGame arkanoidGame, IKeysConfiguration keysConfiguration) : base(arkanoidGame, keysConfiguration)
        {
            _ballSpeed = Components.Balls[0].Speed;

            Components.Balls[0].Speed = new Vector2(Components.Balls[0].Speed.X, Components.Balls[0].Speed.Y);

            var textComponent = new ShowText(Configuration, new Size(Configuration.ScreenSize.Width, Configuration.ScreenSize.Height));

            AnarkanoidGame.ComponentManager.AddText(textComponent, DIE_TEXT);

            _timer          = new Timer(Configuration.BallInitialHookedMiliseconds);
            _timer.Elapsed += (sender, e) =>
            {
                AnarkanoidGame.ComponentManager.Remove(textComponent);
                _timeElapsed = true;
                _timer.Stop();
                _timer.Dispose();
            };
            _timer.Start();
            AnarkanoidGame.CurrentLives--;
        }
示例#27
0
    public static GameObject AddHurtInfo(string InTextInfo, Color InColor, Vector3 Position)
    {
        GameObject ReturnObj = LoadUIObj("ShowText");

        if (ReturnObj == null)
        {
            return(null);
        }
        if (!GamePool.IsSpawned(ReturnObj.transform))
        {
            GamePool.Regist("ShowText", ReturnObj.transform);
        }
        Transform Target = GamePool.Spawn("ShowText");

        UIWindow.AddUI(Target.gameObject);
        Target.gameObject.transform.position = Position;
        ShowText NewText = Target.GetComponent <ShowText>();

        NewText.SetInfo(InTextInfo, InColor);
        return(Target.gameObject);
    }
示例#28
0
    public void ShowHPSub(DamageData damadata)
    {
        if (ShowHPSubPrefab == null)
        {
            Debug.Log("Ko có PrefabShowHPSub");
            return;
        }
        if (!(damadata.To is Enemy))
        {
            Debug.Log("Dữ liệu sát thương ko tìm thấy mục tiêu");
            return;
        }
        Enemy         enemy = damadata.To as Enemy;
        List <string> list  = damadata.GetStringShow();

        foreach (string s in list)
        {
            ShowText show = Instantiate(ShowHPSubPrefab, enemy.PR_HPsub.transform.position, Quaternion.identity);
            show.SetText(s);
        }
    }
示例#29
0
        public NewMatchState(IAnarkanoidGame arkanoidGame, IKeysConfiguration keysConfiguration) : base(arkanoidGame, keysConfiguration)
        {
            AnarkanoidGame.ComponentManager.Clear();
            AnarkanoidGame.CurrentLives = Configuration.InitialLives;

            _levelText = new ShowText(Configuration, new Size(Configuration.ScreenSize.Width, Configuration.ScreenSize.Height))
            {
                Position = new Microsoft.Xna.Framework.Vector2(150, 120)
            };
            AnarkanoidGame.ComponentManager.AddText(_levelText, string.Format(LEVEL_TEXT, AnarkanoidGame.CurrentStage + 1));

            _text = new ShowText(Configuration, new Size(Configuration.ScreenSize.Width, Configuration.ScreenSize.Height))
            {
                Position = new Microsoft.Xna.Framework.Vector2(150, 150)
            };
            AnarkanoidGame.ComponentManager.AddText(_text, string.Format(TEXT_FORMAT, 3 - _totalTicks));

            Components.SpaceShip.Reset();
            AnarkanoidGame.ComponentManager.AddSpaceShip(AnarkanoidGame.ComponentManager.SpaceShip);

            var ball = AnarkanoidGame.ComponentManager.BallRepository.GetBasicBall();

            ball.Reset();
            AnarkanoidGame.ComponentManager.AddBall(ball);

            var boardFileName   = Environment.CurrentDirectory + "\\Boards\\" + AnarkanoidGame.ComponentManager.Configuration.Boards[AnarkanoidGame.CurrentStage] + ".stage";
            var boardDefinition = new BoardDefinition(boardFileName);

            AnarkanoidGame.ComponentManager.LoadBoard(boardDefinition);

            _timer          = new Timer(1000);
            _timer.Elapsed += _timer_Elapsed;
            _timer.Start();
            _returnState = this;

            CommandPerKey.Add(Keys.Left, CommandsFactory.GetMoveSpaceShipToLeftCommand());
            CommandPerKey.Add(Keys.Right, CommandsFactory.GetMoveSpaceShipToRightCommand());
        }
示例#30
0
        /*public override void GeneralSvg(XmlElement g, Point translate, Font font)
         * {
         *  //base.GeneralSvg(g);
         *  Shape shaper = Shape.GetShaper(TopicShape.Rectangle, 2);
         *  if (shaper != null)
         *  {
         *      Rectangle rect = Bounds;
         *      rect.Offset(translate);
         *      rect.Inflate(0, -2);
         *      XmlElement node = shaper.GenerateSvg(rect, g, Color.Empty, BackColor);
         *      g.AppendChild(node);
         *
         *      if (Value > 0 && Maximum > Minimum)
         *      {
         *          rect.Inflate(-1, -1);
         *          rect.Width = (int)Math.Ceiling(rect.Width * (Math.Min(Maximum, Value) - Minimum) / (Maximum - Minimum));
         *          if (rect.Width > 0 && rect.Height > 0)
         *          {
         *              node = shaper.GenerateSvg(rect, g, Color.Empty, Color);
         *              g.AppendChild(node);
         *          }
         *      }
         *  }
         *
         *  // text
         *  if (ShowText)
         *  {
         *      string text = string.Format("{0}%", Value);
         *      Rectangle rect = Bounds;
         *      rect.Offset(translate);
         *      Blumind.Core.Exports.SvgEngine.ExportText(text, ForeColor, font, g, rect);
         *  }
         * }*/

        public override void Serialize(XmlDocument dom, XmlElement node)
        {
            base.Serialize(dom, node);

            node.SetAttribute("max", Maximum.ToString());
            node.SetAttribute("min", Minimum.ToString());
            node.SetAttribute("value", Value.ToString());
            node.SetAttribute("show_text", ShowText.ToString());
            node.SetAttribute("auto_calculation", AutoCalculation.ToString());
            //node.SetAttribute("visible", Visible.ToString());
            if (!Color.IsEmpty)
            {
                node.SetAttribute("color", ST.ToString(Color));
            }
            if (!BackColor.IsEmpty)
            {
                node.SetAttribute("back_color", ST.ToString(BackColor));
            }
            if (!ForeColor.IsEmpty)
            {
                node.SetAttribute("fore_color", ST.ToString(ForeColor));
            }
        }
        /**
         * Loads all the supported graphics and text state operators in a map.
         */
        private void PopulateOperators(){

            RegisterContentOperator(DEFAULTOPERATOR, new IgnoreOperatorContentOperator());
            
            RegisterContentOperator("q", new PushGraphicsState());
            RegisterContentOperator("Q", new PopGraphicsState());
            RegisterContentOperator("g", new SetGrayFill());
            RegisterContentOperator("G", new SetGrayStroke());
            RegisterContentOperator("rg", new SetRGBFill());
            RegisterContentOperator("RG", new SetRGBStroke());
            RegisterContentOperator("k", new SetCMYKFill());
            RegisterContentOperator("K", new SetCMYKStroke());
            RegisterContentOperator("cs", new SetColorSpaceFill());
            RegisterContentOperator("CS", new SetColorSpaceStroke());
            RegisterContentOperator("sc", new SetColorFill());
            RegisterContentOperator("SC", new SetColorStroke());
            RegisterContentOperator("scn", new SetColorFill());
            RegisterContentOperator("SCN", new SetColorStroke());
            RegisterContentOperator("cm", new ModifyCurrentTransformationMatrix());
            RegisterContentOperator("gs", new ProcessGraphicsStateResource());

            SetTextCharacterSpacing tcOperator = new SetTextCharacterSpacing();
            RegisterContentOperator("Tc", tcOperator);
            SetTextWordSpacing twOperator = new SetTextWordSpacing();
            RegisterContentOperator("Tw", twOperator);
            RegisterContentOperator("Tz", new SetTextHorizontalScaling());
            SetTextLeading tlOperator = new SetTextLeading();
            RegisterContentOperator("TL", tlOperator);
            RegisterContentOperator("Tf", new SetTextFont());
            RegisterContentOperator("Tr", new SetTextRenderMode());
            RegisterContentOperator("Ts", new SetTextRise());

            RegisterContentOperator("BT", new BeginTextC());
            RegisterContentOperator("ET", new EndTextC());
            RegisterContentOperator("BMC", new BeginMarkedContentC());
            RegisterContentOperator("BDC", new BeginMarkedContentDictionary());
            RegisterContentOperator("EMC", new EndMarkedContentC());

            TextMoveStartNextLine tdOperator = new TextMoveStartNextLine();
            RegisterContentOperator("Td", tdOperator);
            RegisterContentOperator("TD", new TextMoveStartNextLineWithLeading(tdOperator, tlOperator));
            RegisterContentOperator("Tm", new TextSetTextMatrix());
            TextMoveNextLine tstarOperator = new TextMoveNextLine(tdOperator);
            RegisterContentOperator("T*", tstarOperator);

            ShowText tjOperator = new ShowText();
            RegisterContentOperator("Tj", tjOperator);
            MoveNextLineAndShowText tickOperator = new MoveNextLineAndShowText(tstarOperator, tjOperator);
            RegisterContentOperator("'", tickOperator);
            RegisterContentOperator("\"", new MoveNextLineAndShowTextWithSpacing(twOperator, tcOperator, tickOperator));
            RegisterContentOperator("TJ", new ShowTextArray());

            RegisterContentOperator("Do", new Do());

            RegisterContentOperator("w", new SetLineWidth());
            RegisterContentOperator("J", new SetLineCap());
            RegisterContentOperator("j", new SetLineJoin());
            RegisterContentOperator("M", new SetMiterLimit());
            RegisterContentOperator("d", new SetLineDashPattern());

            // Path construction and painting operators
            if (renderListener is IExtRenderListener) {
                int fillStroke = PathPaintingRenderInfo.FILL | PathPaintingRenderInfo.STROKE;
                RegisterContentOperator("m", new MoveTo());
                RegisterContentOperator("l", new LineTo());
                RegisterContentOperator("c", new Curve());
                RegisterContentOperator("v", new CurveFirstPointDuplicated());
                RegisterContentOperator("y", new CurveFourhPointDuplicated());
                RegisterContentOperator("h", new CloseSubpath());
                RegisterContentOperator("re", new Rectangle());
                RegisterContentOperator("S", new PaintPathOp(PathPaintingRenderInfo.STROKE, -1, false));
                RegisterContentOperator("s", new PaintPathOp(PathPaintingRenderInfo.STROKE, -1, true));
                RegisterContentOperator("f", new PaintPathOp(PathPaintingRenderInfo.FILL, PathPaintingRenderInfo.NONZERO_WINDING_RULE, false));
                RegisterContentOperator("F", new PaintPathOp(PathPaintingRenderInfo.FILL, PathPaintingRenderInfo.NONZERO_WINDING_RULE, false));
                RegisterContentOperator("f*", new PaintPathOp(PathPaintingRenderInfo.FILL, PathPaintingRenderInfo.EVEN_ODD_RULE, false));
                RegisterContentOperator("B", new PaintPathOp(fillStroke, PathPaintingRenderInfo.NONZERO_WINDING_RULE, false));
                RegisterContentOperator("B*", new PaintPathOp(fillStroke, PathPaintingRenderInfo.EVEN_ODD_RULE, false));
                RegisterContentOperator("b", new PaintPathOp(fillStroke, PathPaintingRenderInfo.NONZERO_WINDING_RULE, true));
                RegisterContentOperator("b*", new PaintPathOp(fillStroke, PathPaintingRenderInfo.EVEN_ODD_RULE, true));
                RegisterContentOperator("n", new PaintPathOp(PathPaintingRenderInfo.NO_OP, -1, false));
                RegisterContentOperator("W", new ClipPathOp(PathPaintingRenderInfo.NONZERO_WINDING_RULE));
                RegisterContentOperator("W*", new ClipPathOp(PathPaintingRenderInfo.EVEN_ODD_RULE));
            }
        }
 public void ReadText()
 {
     //初始化字符串text为列表框中选择的项
     string text = messagelistBox.SelectedItem.ToString();
     //将text中字符串以空格分割放入字符串数组texts中
     string[] texts = text.Split(' ');
     //将netStream与邮件名传入ShowText类的构造函数中
     ShowText st = new ShowText(netStream, texts[1]);
     //显示对话框
     st.ShowDialog();
     //将欲读的邮件从列表框中移出
     messagelistBox.Items.Remove(messagelistBox.SelectedItem);
     //加入“已读”标记
     messagelistBox.Items.Add("已读" + text.Remove(0, 2));
 }
 public MoveNextLineAndShowText(TextMoveNextLine textMoveNextLine, ShowText showText) {
     this.textMoveNextLine = textMoveNextLine;
     this.showText = showText;
 }
        /**
         * Loads all the supported graphics and text state operators in a map.
         */
        private void PopulateOperators(){

            RegisterContentOperator(DEFAULTOPERATOR, new IgnoreOperatorContentOperator());
            
            RegisterContentOperator("q", new PushGraphicsState());
            RegisterContentOperator("Q", new PopGraphicsState());
            RegisterContentOperator("g", new SetGrayFill());
            RegisterContentOperator("G", new SetGrayStroke());
            RegisterContentOperator("rg", new SetRGBFill());
            RegisterContentOperator("RG", new SetRGBStroke());
            RegisterContentOperator("k", new SetCMYKFill());
            RegisterContentOperator("K", new SetCMYKStroke());
            RegisterContentOperator("cs", new SetColorSpaceFill());
            RegisterContentOperator("CS", new SetColorSpaceStroke());
            RegisterContentOperator("sc", new SetColorFill());
            RegisterContentOperator("SC", new SetColorStroke());
            RegisterContentOperator("scn", new SetColorFill());
            RegisterContentOperator("SCN", new SetColorStroke());
            RegisterContentOperator("cm", new ModifyCurrentTransformationMatrix());
            RegisterContentOperator("gs", new ProcessGraphicsStateResource());

            SetTextCharacterSpacing tcOperator = new SetTextCharacterSpacing();
            RegisterContentOperator("Tc", tcOperator);
            SetTextWordSpacing twOperator = new SetTextWordSpacing();
            RegisterContentOperator("Tw", twOperator);
            RegisterContentOperator("Tz", new SetTextHorizontalScaling());
            SetTextLeading tlOperator = new SetTextLeading();
            RegisterContentOperator("TL", tlOperator);
            RegisterContentOperator("Tf", new SetTextFont());
            RegisterContentOperator("Tr", new SetTextRenderMode());
            RegisterContentOperator("Ts", new SetTextRise());

            RegisterContentOperator("BT", new BeginTextC());
            RegisterContentOperator("ET", new EndTextC());
            RegisterContentOperator("BMC", new BeginMarkedContentC());
            RegisterContentOperator("BDC", new BeginMarkedContentDictionary());
            RegisterContentOperator("EMC", new EndMarkedContentC());

            TextMoveStartNextLine tdOperator = new TextMoveStartNextLine();
            RegisterContentOperator("Td", tdOperator);
            RegisterContentOperator("TD", new TextMoveStartNextLineWithLeading(tdOperator, tlOperator));
            RegisterContentOperator("Tm", new TextSetTextMatrix());
            TextMoveNextLine tstarOperator = new TextMoveNextLine(tdOperator);
            RegisterContentOperator("T*", tstarOperator);

            ShowText tjOperator = new ShowText();
            RegisterContentOperator("Tj", tjOperator);
            MoveNextLineAndShowText tickOperator = new MoveNextLineAndShowText(tstarOperator, tjOperator);
            RegisterContentOperator("'", tickOperator);
            RegisterContentOperator("\"", new MoveNextLineAndShowTextWithSpacing(twOperator, tcOperator, tickOperator));
            RegisterContentOperator("TJ", new ShowTextArray());

            RegisterContentOperator("Do", new Do());
        }