示例#1
0
        private void nextButtonPressed(HamsterButton oject)
        {
            Debug.WriteLine(_mode.ToString() + "++");
            if (_mode < DisplayMode.TIME)
            {
                _mode++;
            }
            else
            {
                _mode = DisplayMode.SPEED;
            }

            UpdateDisplay();
        }
示例#2
0
    private void resetPanelSizes()
    {
        Vector2 graphicsSize = new Vector2();
        Vector2 textSize     = new Vector2();

        switch (this.displayMode)
        {
        case DisplayMode.Landscape:
            graphicsSize = new Vector2(this.LANDSCAPE_GRAPHICS_WIDTH, this.LANDSCAPE_HEIGHT);
            textSize     = new Vector2(this.LANDSCAPE_TEXT_WIDTH, this.LANDSCAPE_HEIGHT);
            break;

        case DisplayMode.Portrait:
            graphicsSize = new Vector2(this.PORTRAIT_WIDTH, this.PORTRAIT_GRAPHICS_HEIGHT);
            textSize     = new Vector2(this.PORTRAIT_WIDTH, this.PORTRAIT_TEXT_HEIGHT);
            break;

        case DisplayMode.LandscapeWide:
            graphicsSize = new Vector2(this.LANDSCAPE_WIDE_WIDTH,
                                       this.LANDSCAPE_WIDE_GRAPHICS_HEIGHT);
            textSize = new Vector2(this.LANDSCAPE_WIDE_WIDTH, this.PORTRAIT_TEXT_HEIGHT);
            break;

        default:
            Logger.LogError("Unknown display mode: " + displayMode.ToString());
            break;
        }
        Util.SetSize(this.graphicsPanel, graphicsSize);
        Util.SetSize(this.textPanel, textSize);
    }
示例#3
0
        // Use this for initialization
        void Start()
        {
            try
            {
                if (SystemInfo.deviceType == DeviceType.Handheld)
                {
                    DisplayMode currentMode = (DisplayMode)System.Enum.Parse(typeof(DisplayMode), CallAndroidMethod <string>("getDisplayMode"));
                    if (currentMode != DisplayMode2D3D)
                    {
                        CallAndroidMethod("setDisplayMode", DisplayMode2D3D.ToString());
                    }
                }

                string messageFromJNI = CallAndroidMethod <string>("getStringFromJNI");
                Debug.Log(messageFromJNI);
                if (JNITextOutput != null)
                {
                    JNITextOutput.text = messageFromJNI;
                }
            }
            catch (System.Exception ex)
            {
                Debug.LogException(ex);
            }
        }
示例#4
0
        /// <summary>
        /// Exports the report.
        /// </summary>
        /// <param name="exportType">Type of the export.</param>
        private void ExportReport(ReportTypes exportType)
        {
            int itemTypeId;

            int.TryParse(ddItemTypes.SelectedValue, out itemTypeId);
            string fileName = string.Empty;

            Data.Company company = GetBL <CompanyBL>().GetCompany(ViewingCompanyId);
            fileName = string.Format("{0}'s_Bookings", company.CompanyName);

            BookingDetailsReportParameters parameters = new BookingDetailsReportParameters
            {
                BookingId          = this.BookingId,
                BookingName        = GetBookingName(),
                CompanyId          = ViewingCompanyId,
                ContactPerson      = GetContactedPerson(),
                DisplayMode        = DisplayMode.ToString(),
                ItemTypeId         = itemTypeId,
                RelatedTable       = this.RelatedTableName,
                SortExpression     = gvBookingDetails.MasterTableView.SortExpressions.GetSortString(),
                UserId             = this.UserID,
                ShowMyBookingsOnly = chkMyBookingsOnly.Checked
            };

            string fileNameExtension;
            string encoding;
            string mimeType;

            byte[] reportBytes = UserWebReportHandler.GenerateBookingDetailsReport(parameters, exportType,
                                                                                   out fileNameExtension, out encoding, out mimeType, true);
            Utils.ExportReport(reportBytes, mimeType, fileNameExtension, fileName);
        }
示例#5
0
 public void WriteXml(XmlWriter writer)
 {
     writer.WriteStartElement("ControlRef");
     writer.WriteAttributeString("DisplayMode", DisplayMode.ToString());
     writer.WriteAttributeString("TemplateAlias", TemplateAlias);
     writer.WriteEndElement();
 }
        public override void ToJSON(JObject ParentObject)
        {
            CswDateTime CswDate = new CswDateTime(_CswNbtResources, DateTimeValue);

            ParentObject[_DateValueSubField.ToXmlNodeName(true)] = CswDate.ToClientAsDateTimeJObject();
            ParentObject["displaymode"] = DisplayMode.ToString();
        }
示例#7
0
 public override void ToJSON(JObject ParentObject)
 {
     ParentObject[_RedSubField.ToXmlNodeName(true)]    = Red;
     ParentObject[_YellowSubField.ToXmlNodeName(true)] = Yellow;
     ParentObject[_BlueSubField.ToXmlNodeName(true)]   = Blue;
     ParentObject[_WhiteSubField.ToXmlNodeName(true)]  = White;
     ParentObject["displaymode"] = DisplayMode.ToString();
     ParentObject["hidespecial"] = HideSpecial;
 }
示例#8
0
        /// <summary>
        /// Converts an object into its XML representation.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Xml.XmlWriter"/> stream to which the object is serialized.</param>
        void IXmlSerializable.WriteXml(System.Xml.XmlWriter writer)
        {
            ColorConverter conv = new ColorConverter();

            writer.WriteElementString("TextColor", conv.ConvertToInvariantString(TextColor));
            writer.WriteElementString("BackColor", conv.ConvertToInvariantString(BackColor));
            writer.WriteElementString("DisplayMode", DisplayMode.ToString("G"));
            writer.WriteElementString("BlinkTimeSeparator", BlinkTimeSeparator.ToString());
            writer.WriteElementString("UseUpperCase", UseUpperCase.ToString());
        }
示例#9
0
        private void DrawDisplayModeOptions()
        {
            DisplayMode newMode = (DisplayMode)EditorGUILayout.EnumPopup("DisplayMode", _displayMode);

            if (newMode != _displayMode)
            {
                _displayMode = newMode;
                EditorPrefs.SetString(_displayModeKey, _displayMode.ToString());
            }
        }
示例#10
0
        void SynchDisplayMode(string displayMode)
        {
            DisplayMode2D3D = (DisplayMode)System.Enum.Parse(typeof(DisplayMode), displayMode);
            if (SystemInfo.deviceType != DeviceType.Handheld)
            {
                return;
            }

            CallAndroidMethod("setDisplayMode", DisplayMode.Display2D.ToString());
            CallAndroidMethod("setDisplayMode", DisplayMode2D3D.ToString());
        }
示例#11
0
        // create the buttons if numeric, set the click events and go to the right visual state
        void GenerateControls()
        {
            string mode = DisplayMode.ToString();

            VisualStateManager.GoToState(this, mode, false);

            if (_buttonPanel != null)
            {
                RefereshNumberOfButtonsAndPages();
            }
        }
示例#12
0
        public async Task NavigationAsync(string pageName, INavigationParameters parameters)
        {
            _scheduler.Schedule(async() =>
            {
                using var _ = await _navigationLock.LockAsync();

                if (DisplayMode == PrimaryPlayerDisplayMode.Close)
                {
                    DisplayMode = _lastPlayedDisplayMode;
                }

                if (_navigationService == null)
                {
                    _navigationService = App.Current.Container.Resolve <INavigationService>("PrimaryPlayerNavigationService");
                }

                try
                {
                    var result = await _navigationService.NavigateAsync(pageName, parameters, _playerTransisionAnimation);
                    if (!result.IsSuccess)
                    {
                        DisplayMode = PrimaryPlayerDisplayMode.Close;
                        _view.Title = string.Empty;
                        throw result.Exception ?? new Models.Infrastructure.HohoemaExpception("unknown navigation error.");
                    }

                    LastNavigatedPageName = pageName;

                    _logger.ZLogInformationWithPayload(new Dictionary <string, string>
                    {
                        { "PageType", pageName },
                        { "DisplayMode", DisplayMode.ToString() },
                        { "ViewType", "Primary" },
                        { "CompactOverlay", (_view.ViewMode == ApplicationViewMode.CompactOverlay).ToString() },
                        { "FullScreen", _view.IsFullScreenMode.ToString() }
                    }, "PlayerNavigation");
                }
                catch (Exception e)
                {
                    _logger.ZLogErrorWithPayload(e, new Dictionary <string, string>()
                    {
                        { "PageName", pageName },
                        { "Parameters", JsonSerializer.Serialize(parameters) },
                    }
                                                 , "PrimaryViewPlayer navigation failed."
                                                 );
                }
            });

            await Task.Delay(50);

            using (await _navigationLock.LockAsync()) { }
        }
示例#13
0
        /// <summary>
        /// HACK! This function will be removed in 0.3.15
        /// Checks if the specified OpenTK.Platform.DisplayMode is available, and selects it if it is.
        /// </summary>
        /// <param name="mode">The OpenTK.Platform.DisplayMode to select.</param>
        /// <param name="info">The OpenTK.Platform.IWindowInfo that describes the display to use. Note: a window handle is not necessary for this function!</param>
        /// <returns>True if the DisplayMode is available, false otherwise.</returns>
        bool IGLContextCreationHack.SelectDisplayMode(DisplayMode mode, IWindowInfo info)
        {
            List<int> visualAttributes = new List<int>();

            // TODO: Improve modesetting code.
            if (mode == null || mode.Color.BitsPerPixel == 0)
            {
                // Define the bare essentials - needed for compatibility with Mono's System.Windows.Forms
                Debug.Print("Preparing visual for System.Windows.Forms (compatibility mode)");
            
                visualAttributes.Add((int)Glx.Enums.GLXAttribute.RGBA);
                /*visualAttributes.Add((int)Glx.Enums.GLXAttribute.RED_SIZE);
                visualAttributes.Add((int)1);
                visualAttributes.Add((int)Glx.Enums.GLXAttribute.GREEN_SIZE);
                visualAttributes.Add((int)1);
                visualAttributes.Add((int)Glx.Enums.GLXAttribute.BLUE_SIZE);
                visualAttributes.Add((int)1);*/
                visualAttributes.Add((int)Glx.Enums.GLXAttribute.DEPTH_SIZE);
                visualAttributes.Add((int)1);
                visualAttributes.Add((int)Glx.Enums.GLXAttribute.DOUBLEBUFFER);
                visualAttributes.Add((int)0);
            }
            else
            {
                Debug.Print("Preparing visual for DisplayMode: {0}", mode.ToString());

                visualAttributes.Add((int)Glx.Enums.GLXAttribute.RGBA);
                visualAttributes.Add((int)Glx.Enums.GLXAttribute.RED_SIZE);
                visualAttributes.Add((int)mode.Color.Red);
                visualAttributes.Add((int)Glx.Enums.GLXAttribute.GREEN_SIZE);
                visualAttributes.Add((int)mode.Color.Green);
                visualAttributes.Add((int)Glx.Enums.GLXAttribute.BLUE_SIZE);
                visualAttributes.Add((int)mode.Color.Blue);
                visualAttributes.Add((int)Glx.Enums.GLXAttribute.ALPHA_SIZE);
                visualAttributes.Add((int)mode.Color.Alpha);
                visualAttributes.Add((int)Glx.Enums.GLXAttribute.DEPTH_SIZE);
                visualAttributes.Add((int)mode.DepthBits);
                visualAttributes.Add((int)Glx.Enums.GLXAttribute.DOUBLEBUFFER);
                visualAttributes.Add((int)0);
            }

            windowInfo.CopyInfoFrom(info);
            visual = Glx.ChooseVisual(windowInfo.Display, windowInfo.Screen, visualAttributes.ToArray());
            if (visual == IntPtr.Zero)
                return false;
            else
            {
                windowInfo.VisualInfo = (XVisualInfo)Marshal.PtrToStructure(visual,
                                                                            typeof(XVisualInfo));
                Debug.Print("Chose visual {0}", windowInfo.VisualInfo.ToString());
            }
            return true;
        }
示例#14
0
        RadioButton CreateRadioButton(DisplayMode displayMode, bool isChecked)
        {
            var button = new RadioButton();

            button.Padding   = new Thickness(3, 0, 0, 0);
            button.Margin    = new Thickness(2);
            button.Content   = NormalizeString(displayMode.ToString());
            button.Tag       = displayMode;
            button.Click    += new RoutedEventHandler(buttonDisplayMode_Click);
            button.IsChecked = isChecked;
            return(button);
        }
示例#15
0
        /// <summary>
        /// Helper function to "Slurpify" a link.
        /// </summary>
        /// <param name="url">The URL of the document you wish to slurp.</param>
        /// <param name="displayMode">How a document is displayed on Scribd</param>
        /// <param name="isPrivate">Public or private display of the document</param>
        /// <returns>A Slurpified <see cref="T:System.string"/></returns>
        public static string Slurpify(string url, DisplayMode displayMode, bool isPrivate)
        {
            if (!string.IsNullOrEmpty(Service.PublisherID))
            {
                string _url = @"http://www.scribd.com/slurp?url={0}&display_mode={1}&privacy={2}&publisher_id={3}";
                return(string.Format(_url, url, displayMode.ToString().ToLower(), isPrivate == true ? "private" : "public", Service.PublisherID));
            }

            // Notify users
            OnErrorOccurred(10004, Properties.Resources.ERR_NO_PUBLISHERID);

            return(string.Empty);
        }
示例#16
0
        void OnGUI()
        {
            if (!ShowGUI)
            {
                return;
            }

            GUILayout.Space(207);
            if (GUILayout.Button("Set 3D", GUILayout.Width(100), GUILayout.Height(30)))
            {
                DisplayMode2D3D = DisplayMode.Display3D;
                if (SystemInfo.deviceType == DeviceType.Handheld)
                {
                    CallAndroidMethod("setDisplayMode", DisplayMode.Display2D.ToString());
                    CallAndroidMethod("setDisplayMode", DisplayMode2D3D.ToString());
                }

                if (Network.isClient || Network.isServer)
                {
                    networkView.RPC("SynchDisplayMode", RPCMode.OthersBuffered, DisplayMode2D3D.ToString());
                }
            }
        }
示例#17
0
        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            base.AddAttributesToRender(writer);
            if (EnableClientScript /*&& Page.AreValidatorsUplevel()*/)
            {
                /* force an ID here if we weren't assigned one */
                if (ID == null)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID);
                }



                if (HeaderText != string.Empty && HeaderText != null)
                {
                    writer.AddAttribute("headertext", HeaderText);
                }
                else
                {
                    if (_mensajeDeIntroduccion == string.Empty || _mensajeDeIntroduccion == null)
                    {
                        writer.AddAttribute("headertext", "Mensaje no configurado");
                    }
                    else
                    {
                        writer.AddAttribute("headertext", _mensajeDeIntroduccion);
                    }
                }

                if (ShowMessageBox)
                {
                    writer.AddAttribute("showmessagebox", ShowMessageBox.ToString());
                }

                if (ShowSummary == false)
                {
                    writer.AddAttribute("showsummary", ShowSummary.ToString());
                }

                if (DisplayMode != ValidationSummaryDisplayMode.BulletList)
                {
                    writer.AddAttribute("displaymode", DisplayMode.ToString());
                }

                /*if (!has_errors)
                 *  writer.AddStyleAttribute("display", "none");*/
            }
        }
示例#18
0
        public void SaveSettings()
        {
            StreamWriter  SW = new StreamWriter(Globals.Files + "Settings.ini");
            StringBuilder SB = new StringBuilder();

            SB.AppendLine("GameDirectory:" + Globals.GameDirectory);
            SB.AppendLine("LauncherRunPath:" + AppDomain.CurrentDomain.BaseDirectory);
            SB.AppendLine("PlayerTag:" + PlayerTag);
            SB.AppendLine("DisplayMode:" + DisplayMode.ToString());
            SB.AppendLine("GameSound:" + GameSound.ToString());
            SB.AppendLine("VerticalSync:" + VerticalSync.ToString());
            SB.AppendLine("DefaultDisplay:" + DefaultDisplay.ToString());
            SB.AppendLine("RememberMe:" + RememberMe.ToString());
            SB.AppendLine("PlayerLoginToken:" + Encrypt.EncryptStringAES(PlayerLoginToken));
            SW.Write(SB.ToString());
            SW.Flush();
            SW.Close();
            SW.Dispose();
        }
示例#19
0
        /// <summary>
        /// This function will configure your Windows desktop/monitor arrangement.
        /// </summary>
        /// <param name="displaymode">Display mode to switch Windows to.</param>
        public static void SwitchDisplays(DisplayMode displaymode)
        {
            ProcessStartInfo _psi = new ProcessStartInfo(@"C:\Windows\Sysnative\DisplaySwitch.exe"); //create new instance of ProcessStartInfo with filename to be run.

            _psi.WindowStyle = ProcessWindowStyle.Hidden;                                            //set process to be hidden from user.
            _psi.Arguments   = "/" + displaymode.ToString();                                         //set argument switch to the DisplayType parameter.

            Process _p = new Process();                                                              //create new instance of Process.

            _p.StartInfo = _psi;                                                                     //assign our start info to process.
            _p.Start();                                                                              //start the process.

            _p.WaitForExit(10000);                                                                   //wait for maximum of 10 seconds for process to finish.

            _psi = null;                                                                             //dispose of ProcessStartInfo instance.
            _p.Dispose();                                                                            //dispose of Process instance.

            Thread.Sleep(5000);                                                                      //wait 5 seconds to ensure it's done.
        }
示例#20
0
    void OnGUI()
    {
        GUILayout.Label("Base Settings", EditorStyles.boldLabel);
        GUILayout.Label(currentDisplayMode.ToString());
        //SetToolMode((DisplayMode)EditorGUILayout.EnumPopup("View Mode", currentDisplayMode));

        if (currentDisplayMode == DisplayMode.GameView)
        {
            canvasSize = EditorGUILayout.Vector2IntField("Canvas Scale", canvasSize);
            if (GUILayout.Button("Spawn Canvas"))
            {
                SpawnWorldCanvas();
            }
        }

        if (currentDisplayMode == DisplayMode.DrawView)
        {
            color             = EditorGUILayout.ColorField("Pencil Color", color);
            currentBrushShape = (BrushShape)EditorGUILayout.EnumPopup("Brush Shape", currentBrushShape);
            brushSize         = EditorGUILayout.Slider(brushSize, 1f, 100f);


            if (GUILayout.Button("Finish Drawing"))
            {
                SetToolMode(DisplayMode.GameView);
                Sprite drawSprite = currentCanvas.GetComponent <SpriteRenderer>().sprite;
                for (int y = 0; y < currentCanvas.GetComponent <WorldEditorCanvas>().size.y; y++)
                {
                    for (int x = 0; x < currentCanvas.GetComponent <WorldEditorCanvas>().size.x; x++)
                    {
                        if (drawSprite.texture.GetPixel(x, y) == new Color(1, 1, 1, 1))
                        {
                            drawSprite.texture.SetPixel(x, y, new Color(0, 0, 0, 0));
                        }
                    }
                }
                drawSprite.texture.Apply();
                currentCanvas.GetComponent <SpriteRenderer>().sprite = drawSprite;
                currentCanvas.GetComponent <WorldEditorCanvas>().SetColliderType(typeof(PolygonCollider2D));
            }
        }
    }
示例#21
0
        // for 2.0: not XHTML attributes must be registered with RegisterExpandoAttribute
        // when it will be implemented, in this case WebUIValidation_2.0.js muist be refactored
        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            base.AddAttributesToRender(writer);

            if (EnableClientScript && pre_render_called && Page.AreValidatorsUplevel(ValidationGroup))
            {
                /* force an ID here if we weren't assigned one */
                if (ID == null)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID);
                }
                if (ValidationGroup != String.Empty)
                {
                    RegisterExpandoAttribute(ClientID, "validationGroup", ValidationGroup);
                }

                if (HeaderText.Length > 0)
                {
                    RegisterExpandoAttribute(ClientID, "headertext", HeaderText);
                }

                if (ShowMessageBox)
                {
                    RegisterExpandoAttribute(ClientID, "showmessagebox", "True");
                }

                if (!ShowSummary)
                {
                    RegisterExpandoAttribute(ClientID, "showsummary", "False");
                }

                if (DisplayMode != ValidationSummaryDisplayMode.BulletList)
                {
                    RegisterExpandoAttribute(ClientID, "displaymode", DisplayMode.ToString());
                }

                if (!has_errors)
                {
                    writer.AddStyleAttribute("display", "none");
                }
            }
        }
示例#22
0
        /// <summary>Hidden Class constructor</summary>
        /// <param name="viewMode">Sets the type of view mode (compare, edit) that is associated with this document instance.</param>
        /// <param name="text"></param>
        protected DiffSideTextViewModel(DisplayMode viewMode, string text)
            : this()
        {
            ViewMode = viewMode;
            Document = new TextDocument(text);

            switch (viewMode)
            {
            case DisplayMode.Comparing:
                IsReadOnly       = true;
                IsReadOnlyReason = "Editing is not supported while comparing content.";
                break;

            case DisplayMode.Editing:
                IsReadOnly = false;
                break;

            default:
                throw new NotImplementedException(viewMode.ToString());
            }
        }
示例#23
0
        private void Load()
        {
            _selectedTab = EditorPrefs.GetInt(_selectedTabKey, _selectedTab);
            string modeName = EditorPrefs.GetString(_displayModeKey, _displayMode.ToString());

            _displayMode = (DisplayMode)System.Enum.Parse(typeof(DisplayMode), modeName);
            ClearItems();
            string config = EditorPrefs.GetString(ConfigKey, "");

            if (string.IsNullOrEmpty(config))
            {
                Default();
            }
            else
            {
                string[] guids = config.Split('|');
                foreach (string id in guids)
                {
                    AddItemByGUID(id, -1);
                }
            }
        }
示例#24
0
        protected virtual void OnStateChanged(bool animated = true)
        {
            if (PaneClipRectangle != null)
            {
                PaneClipRectangle.Rect = new Rect(0, 0, OpenPaneLength, ActualHeight);
            }

            var state = string.Empty;

            if (IsPaneOpen)
            {
                state += "Open";
                switch (DisplayMode)
                {
                case SplitViewDisplayMode.CompactInline:
                    state += "Inline";
                    break;

                default:
                    state += DisplayMode.ToString();
                    break;
                }

                state += PanePlacement.ToString();
            }
            else
            {
                state += "Closed";
                if (DisplayMode == SplitViewDisplayMode.CompactInline ||
                    DisplayMode == SplitViewDisplayMode.CompactOverlay)
                {
                    state += "Compact";
                    state += PanePlacement.ToString();
                }
            }

            VisualStateManager.GoToState(this, state, animated);
        }
        public LuaProfileResultsView(IManager manager, Document doc)
            : base(manager, doc)
        {
            InitializeComponent();

            m_comparer = new ListViewItemComparer();
            profileListView.ListViewItemSorter = m_comparer;
            m_displayMode = DisplayMode.Seconds;

            m_totalTime = 0;
            LuaProfileResultsDocument profileDoc = (LuaProfileResultsDocument)Document;

            foreach (LuaProfileEntry entry in profileDoc.Functions)
            {
                m_totalCount        += entry.m_count;
                m_totalTime         += entry.m_timeSelf;
                m_totalTimeChildren += entry.m_timeChildren;
            }

            toolStripComboBox1.Text = m_displayMode.ToString();

            UpdateList();
        }
示例#26
0
        public void SaveSettings()
        {
            StreamWriter  SW = new StreamWriter(Paths.Files + "Settings.ini");
            StringBuilder SB = new StringBuilder();

            SB.AppendLine("ResolutionHeight:" + this.ResolutionHeight.ToString());
            SB.AppendLine("ResolutionWidth:" + this.ResolutionWidth.ToString());
            SB.AppendLine("DisplayMode:" + DisplayMode.ToString());
            SB.AppendLine("Sound:" + Sound.ToString());
            SB.AppendLine("H2VSync:" + H2VSync.ToString());
            SB.AppendLine("StartingMonitor:" + StartingMonitor.ToString());
            SB.AppendLine("Intro:" + Intro.ToString());
            SB.AppendLine("FieldOfView:" + FieldOfView.ToString());
            SB.AppendLine("RememberAccount:" + RememberAccount.ToString());
            SB.AppendLine("RememberToken:" + EncryptStringAES(RememberToken));
            SB.AppendLine("RememberUsername:"******"LauncherStyle:" + LauncherStyle);
            SB.AppendLine("xDelayHotkey:" + xDelayHotkey);
            SB.AppendLine("noHudHotkey:" + noHUDHotkey);
            SW.Write(SB.ToString());
            SW.Flush();
            SW.Close();
            SW.Dispose();
        }
示例#27
0
        protected virtual string GetVisualState()
        {
            string state = string.Empty;

            if (IsPaneOpen)
            {
                state  = "Open";
                state += IsInline ? "Inline" : DisplayMode.ToString();
            }
            else
            {
                state = "Closed";
                if (IsCompact)
                {
                    state += "Compact";
                }
                else
                {
                    return(state);
                }
            }
            state += PanePlacement.ToString();
            return(state);
        }
示例#28
0
 private void UpdateDisplayMode(DisplayMode displayMode)
 {
     JzIntvDisplayMode = displayMode.ToString();
     Properties.Settings.Default.DisplayMode = displayMode.ToString();
 }
示例#29
0
    void OnGUI()
    {
        GUILayout.Label("Base Settings", EditorStyles.boldLabel);
        GUILayout.Label(currentDisplayMode.ToString());
        //SetToolMode((DisplayMode)EditorGUILayout.EnumPopup("View Mode", currentDisplayMode));

        if (GUILayout.Button("Spawn Canvas"))
        {
            Selection.activeObject = SceneView.currentDrawingSceneView;

            Vector3 position = SceneView.lastActiveSceneView.pivot;

            //Vector3 position = Camera.current.transform.position;

            emptyTexture = new Texture2D(512, 512);
            for (int y = 0; y < 512; y++)
            {
                for (int x = 0; x < 512; x++)
                {
                    emptyTexture.SetPixel(x, y, new Color(0, 0, 0, 0));
                }
            }
            emptyTexture.Apply();

            Texture2D  canvasTexture = emptyTexture;
            Sprite     canvas        = Sprite.Create(canvasTexture, new Rect(0, 0, 512, 512), new Vector2(0.5f, 0.5f), 128f);
            GameObject spriteObject  = new GameObject();
            spriteObject.transform.position = new Vector3(position.x, position.y, 0);
            spriteObject.name = "worldSprite";
            spriteObject.tag  = "WorldCanvas";
            spriteObject.AddComponent <SpriteRenderer>().sprite = canvas;
            spriteObject.AddComponent <WorldEditorCanvas>();
            SceneView.lastActiveSceneView.Repaint();
        }

        if (currentDisplayMode == DisplayMode.DrawView)
        {
            color     = EditorGUILayout.ColorField("Pencil Color", color);
            brushSize = EditorGUILayout.Slider(brushSize, 1, 100);



            if (GUILayout.Button("Finish Drawing"))
            {
                SetToolMode(DisplayMode.GameView);
                Sprite drawSprite = currentCanvas.GetComponent <SpriteRenderer>().sprite;
                for (int y = 0; y < 512; y++)
                {
                    for (int x = 0; x < 512; x++)
                    {
                        if (drawSprite.texture.GetPixel(x, y) == new Color(1, 1, 1, 1))
                        {
                            drawSprite.texture.SetPixel(x, y, new Color(0, 0, 0, 0));
                        }
                    }
                }
                drawSprite.texture.Apply();
                currentCanvas.GetComponent <SpriteRenderer>().sprite = drawSprite;
            }
        }
    }
示例#30
0
        /// <summary>
        /// Helper function to "Slurpify" a link.
        /// </summary>
        /// <param name="url">The URL of the document you wish to slurp.</param>
        /// <param name="displayMode">How a document is displayed on Scribd</param>
        /// <param name="isPrivate">Public or private display of the document</param>
        /// <returns>A Slurpified <see cref="T:System.string"/></returns>
        public static string Slurpify(string url, DisplayMode displayMode, bool isPrivate)
        {
            if (!string.IsNullOrEmpty(Service.PublisherID))
            {
                string _url = @"http://www.scribd.com/slurp?url={0}&display_mode={1}&privacy={2}&publisher_id={3}";
                return string.Format(_url, url, displayMode.ToString().ToLower(), isPrivate == true ? "private" : "public", Service.PublisherID);
            }

            // Notify users
            OnErrorOccurred(10004, Properties.Resources.ERR_NO_PUBLISHERID);

            return string.Empty;
        }
示例#31
0
		public LuaProfileResultsView(IManager manager, Document doc)
			: base(manager, doc)
		{
			InitializeComponent();

			m_comparer = new ListViewItemComparer();
			profileListView.ListViewItemSorter = m_comparer;
			m_displayMode = DisplayMode.Seconds;

			m_totalTime = 0;
			LuaProfileResultsDocument profileDoc = (LuaProfileResultsDocument) Document;
			foreach (LuaProfileEntry entry in profileDoc.Functions)
			{
				m_totalCount += entry.m_count;
				m_totalTime += entry.m_timeSelf;
				m_totalTimeChildren += entry.m_timeChildren;
			}

			toolStripComboBox1.Text = m_displayMode.ToString();

			UpdateList();
		}
示例#32
0
        /// <summary>
        /// Gets a production data tile from the 3dpm WMS service.
        /// </summary>
        public async Task <byte[]> GetProductionDataTile(Guid projectUid, Guid?filterUid, Guid?cutFillDesignUid, ushort width, ushort height,
                                                         string bbox, DisplayMode mode, Guid?baseUid, Guid?topUid, VolumeCalcType?volCalcType, IHeaderDictionary customHeaders = null, bool explicitFilters = false)
        {
            log.LogDebug($"{nameof(GetProductionDataTile)}: projectUid={projectUid}, filterUid={filterUid}, width={width}, height={height}, mode={mode}, bbox={bbox}, baseUid={baseUid}, topUid={topUid}, volCalcType={volCalcType}, cutFillDesignUid={cutFillDesignUid}");

            var queryParams = new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>("SERVICE", "WMS"), new KeyValuePair <string, string>("VERSION", "1.3.0"),
                new KeyValuePair <string, string>("REQUEST", "GetMap"), new KeyValuePair <string, string>("FORMAT", ContentTypeConstants.ImagePng),
                new KeyValuePair <string, string>("TRANSPARENT", "true"), new KeyValuePair <string, string>("LAYERS", "Layers"),
                new KeyValuePair <string, string>("CRS", "EPSG:4326"), new KeyValuePair <string, string>("STYLES", string.Empty),
                new KeyValuePair <string, string>("projectUid", projectUid.ToString()), new KeyValuePair <string, string>("mode", mode.ToString()),
                new KeyValuePair <string, string>("width", width.ToString()), new KeyValuePair <string, string>("height", height.ToString()),
                new KeyValuePair <string, string>("bbox", bbox)
            };

            if (filterUid.HasValue)
            {
                queryParams.Add(new KeyValuePair <string, string>("filterUid", filterUid.ToString()));
            }

            if (cutFillDesignUid.HasValue)
            {
                queryParams.Add(new KeyValuePair <string, string>("cutFillDesignUid", cutFillDesignUid.ToString()));
            }

            if (baseUid.HasValue)
            {
                queryParams.Add(new KeyValuePair <string, string>("volumeBaseUid", baseUid.ToString()));
            }

            if (topUid.HasValue)
            {
                queryParams.Add(new KeyValuePair <string, string>("volumeTopUid", topUid.ToString()));
            }

            if (volCalcType.HasValue)
            {
                queryParams.Add(new KeyValuePair <string, string>("volumeCalcType", volCalcType.ToString()));
            }

            queryParams.Add(new KeyValuePair <string, string>("explicitFilters", explicitFilters.ToString()));
            var stream = await GetMasterDataStreamItemServiceDiscoveryNoCache
                             ("/productiondatatiles/png", customHeaders, HttpMethod.Get, queryParams);

            byte[] byteArray = new byte[stream.Length];
            stream.Read(byteArray, 0, (int)stream.Length);
            return(byteArray);
        }
示例#33
0
        public void CreateWindow(DisplayMode windowMode, out IGLContext context)
        {
            Debug.Print("Creating native window with mode: {0}", windowMode.ToString());
            Debug.Indent();

            CreateParams cp = new CreateParams();
            cp.ClassStyle =
                (int)WindowClassStyle.OwnDC |
                (int)WindowClassStyle.VRedraw |
                (int)WindowClassStyle.HRedraw |
                (int)WindowClassStyle.Ime;
            cp.Style =
                (int)WindowStyle.Visible |
                (int)WindowStyle.ClipChildren |
                (int)WindowStyle.ClipSiblings |
                (int)WindowStyle.OverlappedWindow;

            Rectangle rect = new Rectangle();
            rect.top = rect.left = 0;
            rect.bottom = windowMode.Height;
            rect.right = windowMode.Width;
            Functions.AdjustWindowRect(ref rect, WindowStyle.OverlappedWindow, false);

            // Not used
            Top = 0;
            Left = 0;
            Right = windowMode.Width;
            Bottom = windowMode.Height;
            // --------

            top_border = -rect.top;
            left_border = -rect.left;
            bottom_border = rect.bottom - windowMode.Height;
            right_border = rect.right - windowMode.Width;

            cp.Width = rect.right - rect.left;
            cp.Height = rect.bottom - rect.top;
            cp.Caption = "OpenTK Game Window";

            // Keep in mind that some construction code runs in WM_CREATE,
            // which is raised CreateHandle()
            CreateHandle(cp);

            if (this.Handle != IntPtr.Zero)
            {
                Debug.WriteLine("Window creation succesful.");
                //context.Info = new OpenTK.Platform.WindowInfo(this);
                //context.CreateContext();
                //Debug.WriteLine("Context creation successful.");
                exists = true;
            }
            else throw new ApplicationException(String.Format(
                    "Could not create native window and/or context. Handle: {0}",
                    this.Handle));

            Functions.SetWindowPos(this.Handle, WindowPlacementOptions.TOP, Left, Top, cp.Width, cp.Height, SetWindowPosFlags.SHOWWINDOW);

            //context = new GLContext(mode, window);
            //context.CreateContext();

            context = new WinGLContext();
            (context as IGLContextCreationHack).SetWindowHandle(window.Handle);
            (context as IGLContextCreationHack).SelectDisplayMode(mode, window);
            context.CreateContext(true, null);

            Debug.Unindent();
        }
示例#34
0
        public static void Start()
        {
            try
            {
                const string divLine = "=============================================================";

                //Default Display Mode
                DisplayMode displayMode = DisplayMode.Condensed;

                while (true)
                {
                    Console.Clear();
                    Console.WriteLine(divLine);
                    Console.WriteLine("|   SWC CORP. - FLOTSam  (Flooring Order Tracking System)   {0}", "|");
                    Console.WriteLine(divLine);

                    Console.WriteLine("|0. Toggle display mode (currently: {0}) {1," + (23 - displayMode.ToString().Length) + "}", displayMode.ToString(), "|");
                    Console.WriteLine("|1. List ALL Files      (given: nothing)                    {0}", "|");
                    Console.WriteLine("|2. List ALL Orders     (given: order date)                 {0}", "|");
                    Console.WriteLine("|3. Add an Order        (given: order date)                 {0}", "|");
                    Console.WriteLine("|4. Show an Order       (given: order date & order number)  {0}", "|");
                    Console.WriteLine("|5. Edit an Order       (given: order date & order number)  {0}", "|");
                    Console.WriteLine("|6. Remove an Order     (given: order date & order number)  {0}", "|");
                    Console.WriteLine("|7. (Q) to quit                                             {0}", "|");
                    Console.WriteLine(divLine);

                    Console.Write("\nEnter selection: ");

                    string userInput = Console.ReadLine().ToUpper();

                    switch (userInput)
                    {
                    case "0":
                        if (displayMode == DisplayMode.Normal)
                        {
                            displayMode = DisplayMode.Condensed;
                        }
                        else
                        {
                            displayMode = DisplayMode.Normal;
                        }
                        break;

                    case "1":
                        ListAllFilesWorkFlow.Execute();
                        break;

                    case "2":
                        DisplayOrdersWorkFlow.Execute(displayMode);
                        break;

                    case "3":
                        AddOrderWorkFlow.Execute(displayMode);
                        break;

                    case "4":
                        DisplayOrderWorkFlow.Execute(displayMode);
                        break;

                    case "5":
                        EditOrderWorkFlow.Execute(displayMode);
                        break;

                    case "6":
                        DeleteOrderWorkFlow.Execute(displayMode);
                        break;

                    case "7":
                    case "Q":
                        return;

                    default:
                        //Invalid Input
                        ConsoleIO.DisplayText($"Invalid entry! Please enter a number between 1 & 7 \nPress any key to try again...", false, true, ConsoleColor.Red);
                        continue;
                    }
                }
            }
            catch (Exception ex)
            {
                ConsoleIO.DisplayError(ex);
            }
        }
示例#35
0
        /// <summary>
        /// Opens a new render window with the given DisplayMode.
        /// </summary>
        /// <param name="mode">The DisplayMode of the render window.</param>
        /// <remarks>
        /// Creates the window visual and colormap. Associates the colormap/visual
        /// with the window and raises the window on top of the window stack.
        /// <para>
        /// Colormap creation is currently disabled.
        /// </para>
        /// </remarks>
        public void CreateWindow(DisplayMode mode, out IGLContext glContext)
        {
            if (exists)
                throw new ApplicationException("Render window already exists!");

            Debug.Print("Creating GameWindow with mode: {0}", mode != null ? mode.ToString() : "default");
            Debug.Indent();

            glContext = new X11GLContext();
            (glContext as IGLContextCreationHack).SelectDisplayMode(mode, window);
            if (glContext == null)
                throw new ApplicationException("Could not create GLContext");
            Debug.Print("Created GLContext");
            window.VisualInfo = ((X11.WindowInfo)((IGLContextInternal)glContext).Info).VisualInfo;
            //window.VisualInfo = Marshal.PtrToStructure(Glx.ChooseVisual(window.Display, window.Screen, 

            // Create a window on this display using the visual above
            Debug.Write("Opening render window... ");

            XSetWindowAttributes attributes = new XSetWindowAttributes();
            attributes.background_pixel = IntPtr.Zero;
            attributes.border_pixel = IntPtr.Zero;
            attributes.colormap =
                API.CreateColormap(window.Display, window.RootWindow, window.VisualInfo.visual, 0/*AllocNone*/);
            window.EventMask =
                EventMask.StructureNotifyMask | EventMask.SubstructureNotifyMask | EventMask.ExposureMask |
                EventMask.KeyReleaseMask | EventMask.KeyPressMask |
                    EventMask.PointerMotionMask | /* Bad! EventMask.PointerMotionHintMask | */
                    EventMask.ButtonPressMask | EventMask.ButtonReleaseMask;
            attributes.event_mask = (IntPtr)window.EventMask;

            uint mask = (uint)SetWindowValuemask.ColorMap | (uint)SetWindowValuemask.EventMask |
                (uint)SetWindowValuemask.BackPixel | (uint)SetWindowValuemask.BorderPixel;

            window.Handle = Functions.XCreateWindow(window.Display, window.RootWindow,
                0, 0, mode.Width, mode.Height, 0, window.VisualInfo.depth/*(int)CreateWindowArgs.CopyFromParent*/,
                (int)CreateWindowArgs.InputOutput, window.VisualInfo.visual, (UIntPtr)mask, ref attributes);

            if (window.Handle == IntPtr.Zero)
                throw new ApplicationException("XCreateWindow call failed (returned 0).");

            // Set the window hints
            XSizeHints hints = new XSizeHints();
            hints.x = 0;
            hints.y = 0;
            hints.width = mode.Width;
            hints.height = mode.Height;
            hints.flags = (IntPtr)(XSizeHintsFlags.USSize | XSizeHintsFlags.USPosition);
            Functions.XSetWMNormalHints(window.Display, window.Handle, ref hints);

            // Register for window destroy notification
            IntPtr wm_destroy_atom = Functions.XInternAtom(window.Display,
                "WM_DELETE_WINDOW", true);
            XWMHints hint = new XWMHints();
            Functions.XSetWMProtocols(window.Display, window.Handle, new IntPtr[] { wm_destroy_atom }, 1);

            Top = Left = 0;
            Right = Width;
            Bottom = Height;

            //XTextProperty text = new XTextProperty();
            //text.value = "OpenTK Game Window";
            //text.format = 8;
            //Functions.XSetWMName(window.Display, window.Handle, ref text);
            //Functions.XSetWMProperties(display, window, name, name, 0,  /*None*/ null, 0, hints);

            Debug.Print("done! (id: {0})", window.Handle);

            (glContext as IGLContextCreationHack).SetWindowHandle(window.Handle);

            API.MapRaised(window.Display, window.Handle);
            mapped = true;

            glContext.CreateContext(true, null);

            driver = new X11Input(window);

            Debug.Unindent();
            Debug.WriteLine("GameWindow creation completed successfully!");
            exists = true;
        }