Inheritance: MonoBehaviour
 void Start()
 {
     player = GameObject.Find("Player");
     PlayerCamera = GameObject.Find ("Main Camera").GetComponent<Camera>();
     CutsceneCamera = GameObject.Find("CutsceneCamera").GetComponent<Camera>();
     icons = GameObject.Find("Icons").GetComponent<Icons>();
 }
Example #2
0
    // Use this for initialization
    void Start()
    {
        icons = GameMaster.GetComponent<Icons>();
        posY = 480;
        if (ThisButton == 0) {
            posX = 2;
        }
        else if (ThisButton == 1)
        {
            posX = 218.318f;
        }
        else if (ThisButton == 2) {
            posX = 434.636f;
        }
        else if (ThisButton == 3)
        {
            posX = 650.954f;
        }
        else if (ThisButton == 4)
        {
            posX = 867.272f;
            posY = 427;
        }

        TemplateMain.gameObject.SetActive(false);
    }
Example #3
0
        /// <summary>
        /// Shows a Ok dialog.
        /// </summary>
        /// <param name="title">The title of the window.</param>
        /// <param name="instruction">The main instruction.</param>
        /// <param name="observation">A complementar observation.</param>
        /// <param name="icon">The image of the dialog.</param>
        /// <returns>True if Ok</returns>
        public static bool Ok(string title, string instruction, string observation, Icons icon = Icons.Error)
        {
            var dialog = new Dialog();
            dialog.PrepareOk(title, instruction, observation, icon);
            var result = dialog.ShowDialog();

            return result.HasValue && result.Value;
        }
 // Use this for initialization
 void Start()
 {
     icons = gameObject.GetComponent<Icons>();
     PrintInfoOnText(Spell1Text, Spell1Texture, ApplicationStatics.Spell1);
     PrintInfoOnText(Spell2Text, Spell2Texture, ApplicationStatics.Spell2);
     PrintInfoOnText(Spell3Text, Spell3Texture, ApplicationStatics.Spell3);
     PrintInfoOnText(Spell4Text, Spell4Texture, ApplicationStatics.Spell4);
     PrintInfoOnText(UltimateSpellText, UltimateSpellTexture, ApplicationStatics.UltimateSpell);
 }
Example #5
0
        public Texture2D getIcon(Icons code)
        {
            Texture2D result = null;

                if (data.ContainsKey(code))
                    data.TryGetValue(code, out result);

            return result;
        }
Example #6
0
        public MainWindow()
        {
            MainWindowServiceDispatcher.Instance.MainWindow = this;

            //Theme.Initialize(); -- already done in StandardWindow base class

            InitializeComponent();

            Application.Current.SessionEnding += Current_SessionEnding;
            Application.Current.Exit          += Current_Exit;

            HourglassState = 2;
            WPFDoEvents.SetHourglassCursor();

            DataContext = ConfigurationManager.Instance.ConfigurationRecord_Bindable;

            // Set a DEV title if necessary
            Title = String.Format("Qiqqa v{0}", ClientVersion.CurrentBuild);
            if (WebsiteAccess.IsTestEnvironment)
            {
                Title = String.Format("Qiqqa v{0} (TEST ENVIRONMENT)", ClientVersion.CurrentBuild);
            }

            DockingManager.WindowIcon  = Icons.GetAppIconICO(Icons.Qiqqa);
            DockingManager.OwnerWindow = this;

            DockingManager.AddContent(TITLE_START_PAGE, TITLE_START_PAGE, Icons.GetAppIcon(Icons.ModuleStartPage), false, true, ObjStartPage);
            DockingManager.MakeActive(TITLE_START_PAGE);

            ObjStatusBar.Background     = ThemeColours.Background_Brush_Blue_LightToDark;
            ObjTabBackground.Background = ThemeColours.Background_Brush_Blue_VeryDark;

            SizeChanged += MainWindow_SizeChanged;
            KeyUp       += MainWindow_KeyUp;

            //Unloaded += MainWindow_Unloaded;
            Dispatcher.ShutdownStarted += Dispatcher_ShutdownStarted;
            Closing += MainWindow_Closing;
            Closed  += MainWindow_Closed;

            // We've looked for the LAST event that triggers dependably at the start of the application:
            //   ContentRendered
            // is the last one triggered of this bunch:
            //
            //this.Activated += MainWindow_Activated;
            ContentRendered += MainWindow_ContentRendered;
            //this.Initialized += MainWindow_Initialized;
            //this.LayoutUpdated += MainWindow_LayoutUpdated;
            //this.Loaded += MainWindow_Loaded;
            //this.ManipulationCompleted += MainWindow_ManipulationCompleted;
            //this.ManipulationStarting += MainWindow_ManipulationStarting;
            //this.SourceInitialized += MainWindow_SourceInitialized;
            //this.StateChanged += MainWindow_StateChanged;

            WebLibraryManager.Instance.WebLibrariesChanged += Instance_WebLibrariesChanged;
        }
        public LibraryFilterControl()
        {
            InitializeComponent();

            // Rotate the SORT icon 270 degrees
            TransformedBitmap sort_icon_rotated = new TransformedBitmap();

            {
                BitmapImage sort_icon = Icons.GetAppIcon(Icons.Sort);
                sort_icon_rotated.BeginInit();
                sort_icon_rotated.Transform = new RotateTransform(270);
                sort_icon_rotated.Source    = sort_icon;
                sort_icon_rotated.EndInit();
            }

            // Move the tabs into their correct places...
            DualTabTags.Children.Clear();
            DualTabTags.AddContent("Sort", "Sort", sort_icon_rotated, false, false, TabSort);
            DualTabTags.AddContent("Tag", "Tag", null, false, false, TabTags);
            DualTabTags.AddContent("AutoTag", "AutoTag", null, false, false, TabAITags);
            DualTabTags.AddContent("Author", "Author", null, false, false, TabAuthors);
            DualTabTags.AddContent("Publ.", "Publ.", null, false, false, TabPublications);
            DualTabTags.AddContent("Year", "Year", null, false, false, TabYear);
            DualTabTags.AddContent("Stage", "Stage", null, false, false, TabReadingStages);
            DualTabTags.AddContent("Rating", "Rating", null, false, false, TabRatings);
            DualTabTags.AddContent("Theme", "Theme", null, false, false, TabThemes);
            DualTabTags.AddContent("Type", "Type", null, false, false, TabTypes);
            DualTabTags.MakeActive("Tag");
            DualTabTags.TabPosition = DualTabbedLayout.TabPositions.Sides;

            SearchTag.OnSoftSearch += SearchTag_OnSoftSearch;

            ObjTagExplorerControl.OnTagSelectionChanged          += ObjTagExplorerControl_OnTagSelectionChanged;
            ObjAITagExplorerControl.OnTagSelectionChanged        += ObjAITagExplorerControl_OnTagSelectionChanged;
            ObjAuthorExplorerControl.OnTagSelectionChanged       += ObjAuthorExplorerControl_OnTagSelectionChanged;
            ObjPublicationExplorerControl.OnTagSelectionChanged  += ObjPublicationExplorerControl_OnTagSelectionChanged;
            ObjReadingStageExplorerControl.OnTagSelectionChanged += ObjReadingStageExplorerControl_OnTagSelectionChanged;
            ObjYearExplorerControl.OnTagSelectionChanged         += ObjYearExplorerControl_OnTagSelectionChanged;
            ObjRatingExplorerControl.OnTagSelectionChanged       += ObjRatingExplorerControl_OnTagSelectionChanged;
            ObjThemeExplorerControl.OnTagSelectionChanged        += ObjThemeExplorerControl_OnTagSelectionChanged;
            ObjTypeExplorerControl.OnTagSelectionChanged         += ObjTypeExplorerControl_OnTagSelectionChanged;

            ObjLibraryFilterControl_Sort.SortChanged += ObjLibraryFilterControl_Sort_SortChanged;

            ObjPanelSearchByTag.Visibility = ConfigurationManager.Instance.NoviceVisibility;

            //  DispatcherTimer setup
            var dispatcherTimer = new DispatcherTimer();

            dispatcherTimer.Tick += WeakEventHandler2.Wrap(dispatcherTimer_Tick, (eh) =>
            {
                dispatcherTimer.Tick -= eh;
            });
            dispatcherTimer.Interval = TimeSpan.FromMilliseconds(Constants.UI_REFRESH_POLLING_INTERVAL);
            dispatcherTimer.Start();
        }
Example #8
0
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            Icons icon = Icons.None;

            if (value != null)
            {
                Enum.TryParse <Icons>(value.ToString(), true, out icon);
            }
            return(Res.GetIconChar(icon));
        }
        private void UpdateSelected()
        {
            if (Icons.Contains(Selected))
            {
                return;
            }
            var brandLower = Car.Brand?.ToLower(CultureInfo.CurrentUICulture);

            Selected = Icons.FirstOrDefault(x => x.Name.ToLower() == brandLower) ?? (Icons.Count > 0 ? Icons[0] : null);
        }
Example #10
0
    // Use this for initialization
    void Start()
    {
        icons = gameObject.GetComponent<Icons>();

        UltimateSpell.ChangeSpellOfButton(ApplicationStatics.UltimateSpell.SpellEnum, icons.ReturnSpriteFromSpell(ApplicationStatics.UltimateSpell.SpellEnum));
        Spell1.ChangeSpellOfButton(ApplicationStatics.Spell1.SpellEnum, icons.ReturnSpriteFromSpell(ApplicationStatics.Spell1.SpellEnum));
        Spell2.ChangeSpellOfButton(ApplicationStatics.Spell2.SpellEnum, icons.ReturnSpriteFromSpell(ApplicationStatics.Spell2.SpellEnum));
        Spell3.ChangeSpellOfButton(ApplicationStatics.Spell3.SpellEnum, icons.ReturnSpriteFromSpell(ApplicationStatics.Spell3.SpellEnum));
        Spell4.ChangeSpellOfButton(ApplicationStatics.Spell4.SpellEnum, icons.ReturnSpriteFromSpell(ApplicationStatics.Spell4.SpellEnum));
    }
Example #11
0
 /// <summary>
 /// A new collection of icons that can be embedded into an executable file.
 /// </summary>
 public IconDirectoryResource(IconFile iconFile)
     : base(Kernel32.ResourceTypes.RT_GROUP_ICON)
 {
     for (ushort id = 0; id < iconFile.Icons.Count; id++)
     {
         IconResource iconResource = new IconResource(
             iconFile.Icons[id], new ResourceId(id), _language);
         Icons.Add(iconResource);
     }
 }
Example #12
0
 public static void Initialize(ContentManager Content)
 {
     Textures.Initialize(Content);
     Fonts.Initialize(Content);
     Sprites.Initialize(Content);
     Music.Initialize(Content);
     Sounds.Initialize(Content);
     Sheets.Initialize(Content);
     Icons.Initialize(Content);
 }
Example #13
0
 static IControl UneditablePlaceholder(IObservable <Optional <string> > uneditableElementMessage)
 {
     return(Layout.StackFromTop(
                Icons.CannotEditPlaceholder().WithPadding(bottom: new Points(20)),
                Label.Create(
                    text: uneditableElementMessage.Select(x => x.OrDefault()).AsText(),
                    font: Theme.DefaultFont,
                    color: Theme.DisabledText))
            .Center());
 }
Example #14
0
 private void toggleMinimap()
 {
     if (Icons.Contains(MiniMapView))
     {
         Icons.RemoveChild(MiniMapView);
     }
     else
     {
         Icons.AddChild(MiniMapView);
     }
 }
Example #15
0
        public OCRNotAvailableControl()
        {
            InitializeComponent();

            this.Source  = Icons.GetAppIcon(Icons.OCRNotComplete);
            this.ToolTip = "Text recognition of this page is not yet available.  Please try again in a few minutes.";
            this.Width   = 40;
            this.Height  = 40;
            Canvas.SetLeft(this, 20);
            Canvas.SetTop(this, 20);
        }
Example #16
0
        private void PrepareAsk(string title, string instruction, string observation, Icons icon)
        {
            CancelButton.Visibility = Visibility.Collapsed;
            OkButton.Visibility = Visibility.Collapsed;

            IconViewbox.Child = GetIcon(icon);

            InstructionLabel.Content = instruction;
            ObservationTextBlock.Text = observation;
            Title = title;
        }
        public void SetStyle(Data.Style style)
        {
            this.BackColor = style.ControlBackColor;
            this.ForeColor = style.ForeColor;

            _imageList.Images[0] = Icons.AddColor(Properties.Resources.FolderOpenIcon, this.ForeColor);
            _imageList.Images[1] = Icons.AddColor(Properties.Resources.FolderCloseIcon, this.ForeColor);
            _imageList.Images[2] = Icons.AddColor(Properties.Resources.LocalIcon, this.ForeColor);
            _imageList.Images[3] = Icons.AddColor(Properties.Resources.RemoteIcon, this.ForeColor);
            _imageList.Images[4] = Icons.AddColor(Properties.Resources.ConsoleIcon, this.ForeColor);
        }
Example #18
0
 public void Search()
 {
     if (SearchText == "")
     {
         FilteredIcons = Icons;
     }
     else
     {
         FilteredIcons = Icons.FindAll(x => x.Name.Contains(SearchText, StringComparison.OrdinalIgnoreCase));
     }
 }
Example #19
0
 private void toggleOptions()
 {
     if (Icons.Contains(OptionTable))
     {
         Icons.RemoveChild(OptionTable);
     }
     else
     {
         Icons.AddChild(OptionTable);
     }
 }
Example #20
0
 private void toggleInfoTable()
 {
     if (Icons.Contains(InfoTable))
     {
         Icons.RemoveChild(InfoTable);
     }
     else
     {
         Icons.AddChild(InfoTable);
     }
 }
Example #21
0
        public NotificationBar()
        {
            InitializeComponent();

            RenderOptions.SetBitmapScalingMode(this.NotificationImage, BitmapScalingMode.HighQuality);

            CloseButton.Source = Icons.GetAppIcon(Icons.NotificationBarClose);

            //  register for new events from the NotificationManager, don't bother deregistering since this will live for the life of the app
            NotificationManager.Instance.NewNotificationFired += Instance_NewNotificationFired;
        }
Example #22
0
        private void DisplayNotification(NotificationManager.Notification notification)
        {
            if (!CheckAccess())
            {
                Dispatcher.Invoke(((Action) (() => DisplayNotification(notification))));
                return;
            }

            ImageSource = string.IsNullOrEmpty(notification.ImageName) ? null : Icons.GetAppIcon(notification.ImageName);
            DataContext = new AugmentedBindable<NotificationManager.Notification>(notification);
            Visibility = Visibility.Visible;
        }
Example #23
0
        private async void gvIcons_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            if (gvIcons.SelectedItem != null)
            {
                Icons selectedItem = gvIcons.SelectedItem as Icons;
                // Show Codes dialog
                FindName("CodeGrid");
                CodeGrid.Visibility = Visibility.Visible;

                LoadCodes(selectedItem);
            }
        }
Example #24
0
        private void EmojiList_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
        {
            if (args.InRecycleQueue)
            {
                return;
            }

            if (args.ItemContainer.ContentTemplateRoot is FontIcon textBlock && args.Item is ChatFilterIcon icon)
            {
                textBlock.Glyph = Icons.FilterToGlyph(icon).Item1;
            }
        }
Example #25
0
        private async void gvIcons_KeyDown(object sender, KeyRoutedEventArgs e)
        {
            if (e.Key == VirtualKey.Enter && gvIcons.SelectedItem != null)
            {
                Icons selectedItem = gvIcons.SelectedItem as Icons;
                // Show Codes dialog
                FindName("CodeGrid");
                CodeGrid.Visibility = Visibility.Visible;

                LoadCodes(selectedItem);
            }
        }
Example #26
0
 public static string GetResourceName(Icons icon, bool isReadOnly, IconMask mask)
 {
     if (isReadOnly)
     {
         mask |= IconMask.ReadOnly;
     }
     else
     {
         mask = mask & ~IconMask.ReadOnly;
     }
     return(GetResourceName(icon, mask));
 }
        public MetadataCommentEditorControl()
        {
            InitializeComponent();

            Title = "Qiqqa Metadata Comment Editor";

            ButtonCancel.Icon    = Icons.GetAppIcon(Icons.GoogleBibTexCancel);
            ButtonCancel.Caption = "Close";
            ButtonCancel.Click  += ButtonCancel_Click;

            PreviewKeyDown += MetadataCommentEditorControl_PreviewKeyDown;
        }
Example #28
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activityFile);

            _mode = (Mode)Intent.GetIntExtra("mode", (int)Mode.Save);

            var toolbar = FindViewById <Toolbar>(Resource.Id.activityFile_toolbar);

            SetSupportActionBar(toolbar);

            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);
            SupportActionBar.SetHomeAsUpIndicator(Icons.GetIcon("arrow_back", IsDark));

            _filesystemSource  = new FilesystemSource(Environment.ExternalStorageDirectory.AbsolutePath);
            _filesystemAdapter = new FilesystemAdapter(_filesystemSource, IsDark);
            _filesystemAdapter.SetHasStableIds(true);

            var list = FindViewById <RecyclerView>(Resource.Id.activityFile_list);

            list.SetAdapter(_filesystemAdapter);
            list.HasFixedSize = true;
            list.SetItemViewCacheSize(20);

            switch (_mode)
            {
            case Mode.Open:
                list.SetPadding(0, 0, 0, 0);
                FindViewById <RelativeLayout>(Resource.Id.activityFile_saveLayout).Visibility = ViewStates.Gone;
                _filesystemAdapter.FileClick += FileClick;
                SupportActionBar.SetTitle(Resource.String.openFile);
                break;

            case Mode.Save:
                _filenameText      = FindViewById <EditText>(Resource.Id.activityFile_filename);
                _filenameText.Text = Intent.GetStringExtra("filename");

                _saveButton        = FindViewById <Button>(Resource.Id.activityFile_save);
                _saveButton.Click += SaveClick;
                SupportActionBar.SetTitle(Resource.String.saveFile);
                break;
            }

            var layout = new AuthListGridLayoutManager(this, 1);

            list.SetLayoutManager(layout);

            var decoration = new DividerItemDecoration(this, layout.Orientation);

            list.AddItemDecoration(decoration);
            list.SetLayoutManager(layout);
        }
Example #29
0
        public static Image GetClearImage(string header, MouseButtonEventHandler on_click)
        {
            Image image = new Image();

            RenderOptions.SetBitmapScalingMode(image, BitmapScalingMode.HighQuality);
            image.Width      = 24;
            image.ToolTip    = header;
            image.Cursor     = Cursors.Hand;
            image.Source     = Icons.GetAppIcon(Icons.Clear);
            image.MouseDown += on_click;
            return(image);
        }
Example #30
0
 protected override void OnEnable()
 {
     base.OnEnable();
     FontManager.instance.addFont(Resources.Load <Font>("Fonts/Brands"), "Brands");
     FontManager.instance.addFont(Resources.Load <Font>("Fonts/MaterialIcons-Regular"), "MaterialIcons");
     FontManager.instance.addFont(Resources.Load <Font>("Fonts/NotoSans"), "NotoSans");
     FontManager.instance.addFont(Resources.Load <Font>("Fonts/PingFangHeiTC-W4"), "PingFang");
     FontManager.instance.addFont(Resources.Load <Font>("Fonts/PingFangHeiTC-W6"), "PingFang", FontWeight.w500);
     Icons.LoadIconFont();
     Bridge.Initialize();
     Application.targetFrameRate = 60;
 }
Example #31
0
        private void PrepareOk(string title, string instruction, string observation, Icons icon)
        {
            CancelButton.Visibility = Visibility.Collapsed;
            YesButton.Visibility    = Visibility.Collapsed;
            NoButton.Visibility     = Visibility.Collapsed;

            IconViewbox.Child = GetIcon(icon);

            InstructionLabel.Content  = instruction;
            ObservationTextBlock.Text = observation;
            Title = title;
        }
 protected override void OnInitialized()
 {
     base.OnInitialized();
     if (Icons == null)
     {
         icons = allIcons;
     }
     else
     {
         icons = allIcons.Where(x => Icons.Contains(x.Key)).ToDictionary(x => x.Key, x => x.Value);
     }
 }
 /// <inheritdoc/>
 public override Capability Clone() => new DefaultProgram
 {
     UnknownAttributes = UnknownAttributes,
     UnknownElements   = UnknownElements,
     ID              = ID,
     ExplicitOnly    = ExplicitOnly,
     Service         = Service,
     InstallCommands = InstallCommands,
     Descriptions    = { Descriptions.CloneElements() },
     Icons           = { Icons.CloneElements() },
     Verbs           = { Verbs.CloneElements() }
 };
Example #34
0
 /// <summary> Default constructor. </summary>
 internal FerngillFog(Icons Sheet, bool Verbose, IMonitor Monitor, MersenneTwister Dice, WeatherConfig config, SDVTimePeriods FogPeriod)
 {
     this.Sheet       = Sheet;
     CurrentFogType   = FogType.None;
     ExpirTime        = null;
     VerboseDebug     = Verbose;
     this.Monitor     = Monitor;
     this.Dice        = Dice;
     this.ModConfig   = config;
     this.FogTimeSpan = FogPeriod;
     FogElapsed       = new Stopwatch();
 }
Example #35
0
        public ThingItemsHolder(PanelControlTag PanelTag)
        {
            this.PanelTag = PanelTag;

            ThingBrowserItem = new TreeViewItem
            {
                Header = TreeViewItemHeaderControl.Create(Icons.GetIcon(65), PanelTag.Name),
                Tag    = this
            };
            ThingBrowserItem.MouseDoubleClick += ThingBrowserItem_MouseDoubleClick;

            TransportsBrowserItem = new TreeViewItem
            {
                Header = TreeViewItemHeaderControl.Create(Icons.GetIcon(136), "Transport"),
                Tag    = this
            };
            ThingBrowserItem.Items.Add(TransportsBrowserItem);

            DriversBrowserItem = new TreeViewItem
            {
                Header = TreeViewItemHeaderControl.Create(Icons.GetIcon(919), "Drivers"),
                Tag    = this
            };
            ThingBrowserItem.Items.Add(DriversBrowserItem);

            ScriptsBrowserItem = new TreeViewItem
            {
                Header = TreeViewItemHeaderControl.Create(Icons.GetIcon(1633), "Scripts"),
                Tag    = this
            };
            ThingBrowserItem.Items.Add(ScriptsBrowserItem);

            FilesBrowserItem = new TreeViewItem
            {
                Header = TreeViewItemHeaderControl.Create(Icons.GetIcon(471), "Files"),
                Tag    = this
            };
            FilesBrowserItem.MouseDoubleClick += FilesBrowserItem_MouseDoubleClick;
            ThingBrowserItem.Items.Add(FilesBrowserItem);

            foreach (IOWLOSTransport ThingTransport in PanelTag.Thing.transports)
            {
                TreeViewItem ThingTransportItem = new TreeViewItem
                {
                    Header = ThingTransport.connection.name,
                    Tag    = ThingTransport
                };
                TransportsBrowserItem.Items.Add(ThingTransportItem);
            }

            PanelTag.Thing.OnNewDriver += NewThing_OnNewDriver;
        }
Example #36
0
        public TextBodyVisualizer()
        {
            var bodyText = new TextBox();

            var wordWrapButton = new ToggleButton
            {
                Content   = Icons.Get(IconResources.WordWrap),
                Focusable = false,
                ToolTip   = TextResources.WordWrapToolTip
            };

            wordWrapButton.Checked   += (sender, args) => bodyText.TextWrapping = TextWrapping.Wrap;
            wordWrapButton.Unchecked += (sender, args) => bodyText.TextWrapping = TextWrapping.NoWrap;

            var prettyPrintButton = new ToggleButton
            {
                Content   = Icons.Get(IconResources.PrettyPrint),
                Focusable = false,
                IsChecked = true,
                ToolTip   = TextResources.PrettyPrintToolTip
            };

            prettyPrintButton.Unchecked += (sender, args) => bodyText.Text = Model.StringResponse;
            prettyPrintButton.Checked   += (sender, args) =>
            {
                if (Model.JsonResponse != null)
                {
                    bodyText.Text = Model.JsonResponse.ToString(Formatting.Indented);
                }
            };

            var toolBar = new StackPanel {
                Orientation = Orientation.Horizontal
            };

            toolBar.Children.Add(wordWrapButton);
            toolBar.Children.Add(prettyPrintButton);
            this.Add(toolBar, Dock.Top);

            bodyText.VerticalScrollBarVisibility   = ScrollBarVisibility.Auto;
            bodyText.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
            bodyText.IsReadOnly = true;

            this.Add(bodyText);

            this.Bind(x => x.Response).To(x =>
            {
                Visibility    = x == null ? Visibility.Hidden : Visibility.Visible;
                bodyText.Text = Model.JsonResponse != null ? Model.JsonResponse.ToString(Formatting.Indented) : x == null ? "" : Encoding.UTF8.GetString(x);
                prettyPrintButton.Visibility = Model.JsonResponse != null ? Visibility.Visible : Visibility.Collapsed;
            });
        }
        private void DrawMember(IGraphics g, Member member, Rectangle record, Style style)
        {
            var memberFont = GetMemberFont(member, style);

            if (member is Field)
            {
                memberBrush.Color = style.AttributeColor;
            }
            else
            {
                memberBrush.Color = style.OperationColor;
            }

            if (style.UseIcons)
            {
                var icon = Icons.GetImage(member);
                g.DrawImage(icon, record.X, record.Y);

                var textBounds = new Rectangle(
                    record.X + IconSpacing,
                    record.Y,
                    record.Width - IconSpacing,
                    record.Height);

                var memberString = GetMemberString(member);
                g.DrawString(memberString, memberFont, memberBrush, textBounds, memberFormat);
            }
            else
            {
                var accessBounds = new Rectangle(
                    record.X,
                    record.Y,
                    AccessSpacing,
                    record.Height);
                var textBounds = new Rectangle(
                    record.X + AccessSpacing,
                    record.Y,
                    record.Width - AccessSpacing,
                    record.Height);

                g.DrawString(GetAccessString(member),
                             GetFont(style),
                             memberBrush,
                             accessBounds,
                             accessFormat);
                g.DrawString(GetMemberString(member),
                             memberFont,
                             memberBrush,
                             textBounds,
                             memberFormat);
            }
        }
Example #38
0
        public Pixbuf GetIcon(Icons.Icon icon, IconSize size)
        {
            Pixbuf pb;
            string iconKey = icon.Name + (int)size;

            if (iconCache.TryGetValue(iconKey, out pb))
                return pb;

            pb = icon.Render(widget, size);
            if (pb == null)
                return null;

            iconCache.Add(iconKey, pb);
            //Debug.WriteLine(string.Format("IconCache: cached icon \"{0}\" (size = {1})", icon.Name, IconUtils.GetIconSizeVal(size)));

            return pb;
        }
Example #39
0
        private Canvas GetIcon(Icons icon)
        {
            switch (icon)
            {
                case Icons.Error:
                    return (Canvas)FindResource("Vector.Error");
                case Icons.Info:
                    return (Canvas)FindResource("Vector.Info");
                case Icons.Success:
                    return (Canvas)FindResource("Vector.Success");
                case Icons.Warning:
                    return (Canvas)FindResource("Vector.Warning");
                case Icons.Question:
                    return (Canvas)FindResource("Vector.Question");

                default:
                    return (Canvas)FindResource("Vector.Info");
            }
        }
Example #40
0
 /// <summary>Writes a message to the log (prepended with an icon).</summary>
 /// <param name="message">The message to write.</param>
 /// <param name="icon">An icon.</param>
 /// <param name="backgroundColor">The background color to apply to the log entry.</param>
 public static void WriteIcon(object message, Icons icon, string backgroundColor)
 {
     Writer.WriteIcon(message, icon, backgroundColor);
 }
Example #41
0
 /// <summary>Writes a informational message to the log.</summary>
 /// <param name="message">The messge to write (HTML).</param>
 /// <param name="icon">An icon.</param>
 public static void Info(object message, Icons icon) { Writer.WriteSeverity(message, LogSeverity.Info, icon); }
Example #42
0
 public static Image GetImage16For(Icons icon)
 {
     return ImageArray16[(int)icon];
 }
Example #43
0
 public extern static void WriteIcon(object message, Icons icon);
Example #44
0
 /// <summary>
 ///   Sets which Icon to render
 /// </summary>
 /// <param name="icon"></param>
 /// <param name="isWhite"></param>
 public Icon(Icons icon, bool isWhite)
 {
     _icon = icon;
     _isWhite = isWhite;
 }
Example #45
0
 /// <summary>
 ///   Sets which Icon to render and its size
 /// </summary>
 /// <param name="icon"></param>
 /// <param name="size"></param>
 public Icon(Icons icon, Size size)
 {
     _icon = icon;
     _iconSize = size;
 }
 public BootstrapLink IconAppend(Icons icon, bool isWhite)
 {
     this._iconAppend = icon;
     this._iconAppendIsWhite = isWhite;
     return this;
 }
            private VirtualTreeNode AddNode(string name, Icons icon, bool grayed, object obj)
            {
                VirtualTreeNode result = new VirtualTreeNode(name.Ellipsise(1000))
                    {
                        Tag = obj,
                        ImageIndex = (int)icon,
                        SelectedImageIndex = (int)icon
                    };

                _parent.Nodes.Insert(_index, result);
                _index++;

                IXenObject xenObject = obj as IXenObject;
                bool highlighted = _highlightedDragTarget != null && obj != null && _highlightedDragTarget.Equals(obj);

                if (highlighted)
                {
                    result.BackColor = SystemColors.Highlight;
                    result.ForeColor = SystemColors.HighlightText;
                    result.NodeFont = Program.DefaultFont;
                }
                else if (grayed)
                {
                    result.BackColor = _treeViewBackColor;
                    result.ForeColor = SystemColors.GrayText;
                    result.NodeFont = Program.DefaultFont;
                }
                else
                {
                    result.BackColor = _treeViewBackColor;
                    result.ForeColor = _treeViewForeColor;
                    result.NodeFont = Program.DefaultFont;
                }

                return result;
            }
Example #48
0
        public static DialogResult Show(string message, string title, Buttons buttons, Icons icon, System.Windows.Window win)
        {
            win.ApplyEffect();

            var msgBox = new MsgBox
            {
                StartPosition = FormStartPosition.CenterParent,
                _lblMessage = { Text = message },
                _lblTitle = { Text = title }
            };

            msgBox.InitButtons(buttons);
            msgBox.InitIcon(icon);

            msgBox.Size = msgBox.MessageSize(message, title);

            ShowForm(msgBox);

            MessageBeep(0);

            win.ClearEffect();

            return msgBox._buttonResult;
        }
 public BootstrapLink IconPrepend(Icons icon)
 {
     this._iconPrepend = icon;
     return this;
 }
Example #50
0
        public static DialogResult Show(string message, string title, Buttons buttons, Icons icon)
        {
            var msgBox = new MsgBox { _lblMessage = { Text = message }, _lblTitle = { Text = title } };

            msgBox.InitButtons(buttons);
            msgBox.InitIcon(icon);

            msgBox.Size = msgBox.MessageSize(message, title);

            ShowForm(msgBox);

            MessageBeep(0);
            return msgBox._buttonResult;
        }
Example #51
0
 public static DialogResult MessageBoxShow(this System.Windows.DependencyObject dependencyObject, string message, string title, Buttons buttons, Icons icon, AnimateStyle style)
 {
     return MsgBox.Show(message, title, buttons, icon, style, System.Windows.Window.GetWindow(dependencyObject));
 }
Example #52
0
 /// <summary>
 /// 添加到CSS文件末尾
 /// </summary>
 private void AppendToFile(string cssPath, Icons icon)
 {
     FileManager.FilePath = Sys.GetPhysicalPath( cssPath );
     FileManager.Append( icon.Css );
     FileManager.Save();
 }
Example #53
0
 /// <summary>Writes a debug message to the log.</summary>
 /// <param name="message">The messge to write (HTML).</param>
 /// <param name="icon">An icon.</param>
 public static void Debug(object message, Icons icon) { Writer.WriteSeverity(message, LogSeverity.Debug, icon); }
Example #54
0
 /// <summary>
 ///   Sets which Icon to render
 /// </summary>
 /// <param name="icon"></param>
 public Icon(Icons icon)
 {
     _icon = icon;
 }
Example #55
0
 public static DialogResult MessageBoxShow(this System.Windows.Window win, string message, string title, Buttons buttons, Icons icon, AnimateStyle style)
 {
     return MsgBox.Show(message, title, buttons, icon, style, win);
 }
Example #56
0
 /// <summary>
 /// Get icon.
 /// </summary>
 /// <param name="icon">
 /// Word Icon.
 /// </param>
 /// <returns>
 /// msoid.
 /// </returns>
 public static string GetImageMso(Icons icon, MsWordVersion version)
 {            
     return SectionManager.Section.Images[icon.ToString()].Value;
 }
Example #57
0
        public static DialogResult Show(string message, string title, Buttons buttons, Icons icon, AnimateStyle style, System.Windows.Window win)
        {
            win.ApplyEffect();

            var msgBox = new MsgBox { _lblMessage = { Text = message }, _lblTitle = { Text = title } };
            Size formSize = msgBox.MessageSize(message, title);
            msgBox.Size = formSize;
            msgBox.StartPosition = FormStartPosition.CenterParent;
            msgBox.Height = 0;

            msgBox.InitButtons(buttons);
            msgBox.InitIcon(icon);

            msgBox._timer = new Timer();
            switch (style)
            {
                case AnimateStyle.SlideDown:
                    msgBox.Size = new Size(formSize.Width, 0);
                    msgBox._timer.Interval = 1;
                    msgBox._timer.Tag = new AnimateMsgBox(formSize, style);
                    break;

                case AnimateStyle.FadeIn:
                    msgBox.Size = formSize;
                    msgBox.Opacity = 0;
                    msgBox._timer.Interval = 20;
                    msgBox._timer.Tag = new AnimateMsgBox(formSize, style);
                    break;

                case AnimateStyle.ZoomIn:
                    msgBox.Size = new Size(formSize.Width + 100, formSize.Height + 100);
                    msgBox._timer.Tag = new AnimateMsgBox(formSize, style);
                    msgBox._timer.Interval = 1;
                    break;
            }
            msgBox._timer.Tick += msgBox.timer_Tick;
            msgBox._timer.Start();

            ShowForm(msgBox);

            MessageBeep(0);

            win.ClearEffect();

            return msgBox._buttonResult;
        }
Example #58
0
 public static ImageSource GetMsoImage(Icons icon, int width = 16, int height = 16)
 {
     var msoId = OfficeHelper.GetImageMso(icon, Globals.ThisAddIn.MsWordVersion);
     return PictureDispToImage(Globals.ThisAddIn.Application.CommandBars.GetImageMso(msoId, width, height));
 }
Example #59
0
        private void InitIcon(Icons icon)
        {
            switch (icon)
            {
                case Icons.Application:
                    this._picIcon.Image = SystemIcons.Application.ToBitmap();
                    break;

                case Icons.Exclamation:
                    this._picIcon.Image = SystemIcons.Exclamation.ToBitmap();
                    break;

                case Icons.Error:
                    this._picIcon.Image = SystemIcons.Error.ToBitmap();
                    break;

                case Icons.Info:
                    this._picIcon.Image = SystemIcons.Information.ToBitmap();
                    break;

                case Icons.Question:
                    this._picIcon.Image = SystemIcons.Question.ToBitmap();
                    break;

                case Icons.Shield:
                    this._picIcon.Image = SystemIcons.Shield.ToBitmap();
                    break;

                case Icons.Warning:
                    this._picIcon.Image = SystemIcons.Warning.ToBitmap();
                    break;
            }
        }
Example #60
0
 public Material this[Icons icon]
 {
     get { return data[(int)icon]; }
 }