コード例 #1
0
ファイル: EventService.cs プロジェクト: daleitner/ChatBot
 public void PublishDisplayChangedEvent(DisplayEnum displayEnum)
 {
     if (this.DisplayChanged != null)
     {
         this.DisplayChanged(displayEnum, null);
     }
 }
コード例 #2
0
ファイル: EventService.cs プロジェクト: daleitner/ChatBot
 public void PublishDisplayChangedEvent(DisplayEnum displayEnum, List <object> eventArgs)
 {
     if (this.DisplayChanged != null)
     {
         this.DisplayChanged(displayEnum, eventArgs);
     }
 }
コード例 #3
0
    void UpdateMaterial()
    {
        worleyNoiseMat.SetFloat("_UVScale", uvScale);
        worleyNoiseMat.SetFloat("_NormalIntensity", normalIntensity);

        worleyNoiseMat.SetColor("_DiffuseColor", diffuseColor);
        worleyNoiseMat.SetColor("_SpecularColor", specularColor);
        worleyNoiseMat.SetFloat("_Roughness", roughness);
        worleyNoiseMat.SetVector("_LightDirection", lightDir);

        worleyNoiseMat.SetColor("_VolumeColor", volumeColor);

        if (oldDisplayType != displayType || isFirst)
        {
            for (int i = 0; i < 3; i++)
            {
                if (i == (int)displayType)
                {
                    worleyNoiseMat.EnableKeyword(DisplayKeywordsStrings[i]);
                }
                else
                {
                    worleyNoiseMat.DisableKeyword(DisplayKeywordsStrings[i]);
                }
            }
            oldDisplayType = displayType;
            isFirst        = false;
        }
    }
コード例 #4
0
 public IHttpActionResult Get(string instrument)
 {
     if (DisplayEnum.GetInputNumberByInstType <InstrumentType>(instrument) == null)
     {
         return(BadRequest("There is no instrument by that name"));
     }
     return(Ok(DisplayEnum.GetInputNumberByInstType <InstrumentType>(instrument)));
 }
コード例 #5
0
 public IHttpActionResult GetInstrumentByIndexNumber(int index)
 {
     if (DisplayEnum.GetValuesByIndex <InstrumentType>(index) == null)
     {
         return(BadRequest("There is no instrument by that number"));
     }
     return(Ok(DisplayEnum.GetValuesByIndex <InstrumentType>(index)));
 }
コード例 #6
0
ファイル: MainViewModel.cs プロジェクト: daleitner/ChatBot
        void eventService_DisplayChanged(DisplayEnum displayEnum, List <object> eventArgs)
        {
            switch (displayEnum)
            {
            case DisplayEnum.Chat:
                this.Content = this.factory.GetChatViewModel(eventArgs[0].ToString());
                break;

            case DisplayEnum.Cancel:
                this.CloseHelp = true;
                break;
            }
        }
コード例 #7
0
        public MainForm()
        {
            InitializeComponent();

            this.filePath     = ConfigurationSettings.AppSettings["FilePath"];
            this.picCount     = int.Parse(ConfigurationSettings.AppSettings["PicturesCount"]);
            this.intervalTime = int.Parse(ConfigurationSettings.AppSettings["IntervalTime"]);
            this.displayMode  = CommonHelper.ToDisplayEnum(ConfigurationSettings.AppSettings["DisplayMode"]);
            this.displayTimes = int.Parse(ConfigurationSettings.AppSettings["DisplayTimes"]);

            WritingOutput.ShowMethod += this.OutputLabel;
            PictureBoxOperator.AddPictureBoxMethod    += this.AddPictureBox;
            PictureBoxOperator.DeletePictureBoxMethod += this.DeletePictureBox;
            PictureBoxOperator.MoveLocationMethod     += this.MoveLocation;

            Thread th = new Thread(DisplayPhotos);

            th.Start();
        }
コード例 #8
0
ファイル: DisplayHandler.cs プロジェクト: yaitza/PicRandShow
        public PictureBox[] PhotoPlay(int iCount, DisplayEnum displayMode = DisplayEnum.Single)
        {
            switch (displayMode)
            {
            case DisplayEnum.Single:
                return(PlayBySingle());

            case DisplayEnum.Multiple:
                return(PlayByMultiple());

            case DisplayEnum.Random:
                return(PlayByRandom());

            case DisplayEnum.Sequence:
                return(PlayBySequence(iCount));

            case DisplayEnum.SingleMove:
                return(PlayBySingleMove());

            default:
                return(PlayBySingle());
            }
        }
コード例 #9
0
ファイル: Crypto.cs プロジェクト: Virne2/CMC_API
        /// <summary>
        /// Main display function to print to screen
        /// </summary>
        /// <param name="arg">Display arg on what to show, either new data, old data or an error</param>
        public void Display(DisplayEnum arg)
        {
            //Clear the screen and set the default colour
            Clear();
            ForegroundColor = WHITE;
            //Write some basic information to the top of the console
            WriteLine("Monitor started at {0}", StartTime.ToLocalTime().ToString()); //Time program was started
            WriteLine("Current time is {0}, next update at {1} (in {2})",
                      DateTime.Now.ToLocalTime().ToString(),
                      NextAPICallTime.ToLocalTime().ToString(),
                      NextAPICallTime.Subtract(DateTime.Now).ToString("mm\\:ss")); //Current time and time till next update
            WriteLine("Credits Used: {0} ({1}/HR, {2}/Day)",
                      CreditsUsed,
                      Math.Round(CreditsUsed / DateTime.Now.Subtract(StartTime).TotalHours, 2),
                      Math.Round(CreditsUsed / DateTime.Now.Subtract(StartTime).TotalDays, 2)); //How many credits we've used so far with approximate rates
            WriteLine();                                                                        //Spacing

            //If the arg was to display error, write it
            if (arg == DisplayEnum.Error)
            {
                WriteLine("Error while grabbing data.");
                return;
            }
            //If the arg was to repeat the last data that was displayed, re-display the cached ColourStrings so no new calculations need to be made
            else if (arg == DisplayEnum.Repeat)
            {
                //Display headers
                DisplayColourTextLine(ColumnTitlesStrings);
                //Display each line as they were before
                foreach (ColourString[] CSArray in PreviousDisplayStrings)
                {
                    ForegroundColor = WHITE;
                    DisplayColourTextLine(CSArray);
                }
            }
            //We have new data, calcaulate values and colours to be displayed. First check that data is not empty for some reason
            else if (CurrentData.Count != 0)
            {
                //Data is not empty, lets start displaying. First, write a line for the headers at the top of the table
                DisplayColourTextLine(ColumnTitlesStrings);
                //Clear the previous cached strings for the table, we will write the new ones so that the values do not need to be calculated every 5 seconds
                PreviousDisplayStrings.Clear();
                //For each coin in our CurrentData dictionary, display a line in the table for the data on this coin
                foreach (KeyValuePair <int, string> entry in sortDict)
                {
                    JObject coinData = CurrentData[entry.Value];
                    //Check if we have previous data on this coin to make comparisons to
                    bool PreviousDataExists = PreviousData.ContainsKey(entry.Value);
                    //Set a temporary colour to be used throughout this line
                    ConsoleColor tempColor = WHITE;
                    //Create a ColourString array to place the generated ColourStrings into
                    ColourString[] CoinColourStrings = new ColourString[10];
                    //If we specifically requested this coin to be quoted, make it's rank, name and symbol cyan coloured
                    if (CoinsToBeRequested.Contains((string)coinData["symbol"]))
                    {
                        tempColor = CYAN;
                    }
                    //ColourStrings for rank, name and symbol
                    CoinColourStrings[0] = new ColourString((string)coinData["cmc_rank"], ColumnWidths[0], tempColor, true);
                    CoinColourStrings[1] = new ColourString((string)coinData["name"], ColumnWidths[1], tempColor, true);
                    CoinColourStrings[2] = new ColourString((string)coinData["symbol"], ColumnWidths[2], tempColor, true);

                    //Check if price in currencies is higher than previous data and set colour accordingly
                    tempColor            = PreviousDataExists ? GetConsoleColorRatio((decimal)coinData["quote"]["BTC"]["price"] / (decimal)PreviousData[entry.Value]["quote"]["BTC"]["price"]) : WHITE;
                    CoinColourStrings[3] = new ColourString((Math.Round((decimal)coinData["quote"]["BTC"]["price"], 9)).ToString(), ColumnWidths[3], tempColor, true);

                    tempColor            = PreviousDataExists ? GetConsoleColorRatio((decimal)coinData["quote"]["AUD"]["price"] / (decimal)PreviousData[entry.Value]["quote"]["AUD"]["price"]) : WHITE;
                    CoinColourStrings[4] = new ColourString("$" + (Math.Round((decimal)coinData["quote"]["AUD"]["price"], 2)).ToString(), ColumnWidths[4], tempColor, true);

                    tempColor            = PreviousDataExists ? GetConsoleColorRatio((decimal)coinData["quote"]["USD"]["price"] / (decimal)PreviousData[entry.Value]["quote"]["USD"]["price"]) : WHITE;
                    CoinColourStrings[5] = new ColourString("$" + (Math.Round((decimal)coinData["quote"]["USD"]["price"], 2)).ToString(), ColumnWidths[5], tempColor, true);

                    //Check if percent changes over time are positive or negative and set colour accordingly
                    tempColor            = GetConsoleColorPercentages((decimal)coinData["quote"]["USD"]["percent_change_1h"]);
                    CoinColourStrings[6] = new ColourString(Math.Round((decimal)coinData["quote"]["USD"]["percent_change_1h"], 2) + "%", ColumnWidths[6], tempColor, false);

                    tempColor            = GetConsoleColorPercentages((decimal)coinData["quote"]["USD"]["percent_change_24h"]);
                    CoinColourStrings[7] = new ColourString(Math.Round((decimal)coinData["quote"]["USD"]["percent_change_24h"], 2) + "%", ColumnWidths[7], tempColor, false);

                    tempColor            = GetConsoleColorPercentages((decimal)coinData["quote"]["USD"]["percent_change_7d"]);
                    CoinColourStrings[8] = new ColourString(Math.Round((decimal)coinData["quote"]["USD"]["percent_change_7d"], 2) + "%", ColumnWidths[8], tempColor, false);

                    //Check if market cap in USD is higher than previous data and set colour accordingly
                    tempColor            = PreviousDataExists ? GetConsoleColorRatio((decimal)coinData["quote"]["USD"]["market_cap"] - (decimal)PreviousData[entry.Value]["quote"]["USD"]["market_cap"]) : WHITE;
                    CoinColourStrings[9] = new ColourString("$" + string.Format("{0:n}", Math.Round((decimal)coinData["quote"]["USD"]["market_cap"], 0)), ColumnWidths[9], tempColor, false);

                    //Cache this line
                    PreviousDisplayStrings.Add(CoinColourStrings);
                    //Display this line
                    DisplayColourTextLine(CoinColourStrings);
                }
            }
            else
            {
                //No data
                WriteLine("No data to be displayed :(");
            }
        }
コード例 #10
0
        public void Display(string Message, DisplayEnum Location, Color FontColor, TriState FontBold = TriState.UseDefault, TriState FontItalic = TriState.UseDefault, string FontName = clsSupport.bpeNullString, float FontSize = 0)
        {
            string    statusMessage = null;
            FontStyle fsFontStyle   = default(FontStyle);
            Font      saveFont      = null;
            Color     saveColor     = default(Color);

            //Bail if we're not in the proper environment...
            //The next statements would trigger a [Control 'xxx' not found] error (#730)
            //if the screen controls are not found...
            if ((mrtfDisplay == null) & (Location & DisplayEnum.deStatusBarOnly) == DisplayEnum.deStatusBarOnly)
            {
                throw new ArgumentException(string.Format("Must define RichTextBox (.rtfDisplay) if using Locations ({0} or {1})", DisplayEnum.deTextBoxOnly.ToString(), DisplayEnum.deBothStatusBarAndTextBox.ToString()));
            }
            if ((msbStatusMessage == null) & (Location & DisplayEnum.deTextBoxOnly) == DisplayEnum.deTextBoxOnly)
            {
                throw new ArgumentException(string.Format("Must define StatusBarPanel (.sbStatusMessage) if using Locations ({0} or {1})", DisplayEnum.deStatusBarOnly.ToString(), DisplayEnum.deBothStatusBarAndTextBox.ToString()));
            }
            if (FontBold == TriState.UseDefault)
            {
                FontBold = (mrtfDisplay.Font.Bold ? TriState.True : TriState.False);
            }
            if (FontItalic == TriState.UseDefault)
            {
                FontItalic = (mrtfDisplay.Font.Italic ? TriState.True : TriState.False);
            }
            if (FontName == clsSupport.bpeNullString)
            {
                FontName = mrtfDisplay.Font.Name;
            }
            if (FontSize == 0)
            {
                FontSize = mrtfDisplay.Font.SizeInPoints;
            }

            statusMessage = Message;
            statusMessage = Strings.Replace(statusMessage, Constants.vbTab, " ");
            statusMessage = Strings.Replace(statusMessage, Constants.vbCrLf, " ");
            statusMessage = Strings.Replace(statusMessage, Constants.vbCr, " ");
            statusMessage = Strings.Replace(statusMessage, Constants.vbLf, " ");
            statusMessage = Strings.Trim(statusMessage);

            Message = Strings.Replace(Message, Constants.vbCr, Constants.vbCrLf);
            //strMessage = Replace(strMessage, vbLf, vbCrLf)
            Message = Strings.Replace(Message, Constants.vbCr + Constants.vbCr, Constants.vbCr);
            Message = Strings.Replace(Message, Constants.vbLf + Constants.vbLf, Constants.vbLf);
            Message = Strings.Trim(Message);

            if ((Location & DisplayEnum.deStatusBarOnly) == DisplayEnum.deStatusBarOnly)
            {
                msbStatusMessage.Text = statusMessage;
            }
            if ((Location & DisplayEnum.deTextBoxOnly) == DisplayEnum.deTextBoxOnly)
            {
                if (Message == clsSupport.bpeNullString)
                {
                    mrtfDisplay.Text = Message;
                    mrtfDisplay.Refresh();
                    return;
                }
                //Make sure we don't get too big by truncating the top half of the display...
                if (mrtfDisplay.TextLength + Message.Length > mrtfDisplay.MaxLength)
                {
                    int      iKeepSize = mrtfDisplay.Lines.Length / 2;
                    string[] TempArray = new string[iKeepSize + 2];
                    Array.Copy(mrtfDisplay.Lines, iKeepSize, TempArray, 0, iKeepSize);
                    mrtfDisplay.Lines = TempArray;
                    TempArray         = null;
                }

                saveFont  = mrtfDisplay.SelectionFont;
                saveColor = mrtfDisplay.SelectionColor;

                fsFontStyle = (FontBold == TriState.True ? FontStyle.Bold : FontStyle.Regular) | (FontItalic == TriState.True ? FontStyle.Italic : FontStyle.Regular);
                mrtfDisplay.SelectionFont  = new Font(FontName, FontSize, fsFontStyle);
                mrtfDisplay.SelectionFont  = new Font(FontName, FontSize, fsFontStyle);
                mrtfDisplay.SelectionColor = FontColor;

                //.SelectedRtf = strMessage & vbCrLf
                //.SelectionStart = .TextLength   'Len(.Text)
                Message += Constants.vbCrLf;
                mrtfDisplay.AppendText(Message);
                mrtfDisplay.SelectionStart  = mrtfDisplay.Text.Length;
                mrtfDisplay.SelectionLength = 0;
                mrtfDisplay.ScrollToCaret();

                mrtfDisplay.Font           = saveFont;
                mrtfDisplay.SelectionColor = saveColor;
            }
        }
コード例 #11
0
 public IHttpActionResult GetCategoryValues()
 {
     return(Ok(DisplayEnum.GetValues <CategoryType>()));
 }
コード例 #12
0
 public IHttpActionResult GetInstrumentTypeNames()
 {
     return(Ok(DisplayEnum.GetValues <InstrumentType>()));
 }