예제 #1
0
 public MenuItem(PackIconKind PackIconKind, string Title, string Description, ICommand Command)
 {
     this.PackIconKind = PackIconKind;
     this.Title        = Title;
     this.Description  = Description;
     this.Command      = Command;
 }
 public ItemMenu(string header, List <SubItem> subItems, PackIconKind icon, bool enabled)
 {
     Header   = header;
     SubItems = subItems;
     Icon     = icon;
     Enabled  = enabled;
 }
예제 #3
0
 public ColumnTypeItem(ColumnType type, string name, string description, PackIconKind icon)
 {
     Type        = type;
     Icon        = icon;
     DisplayName = name;
     Description = description;
 }
예제 #4
0
        public static PackIcon CreateIcon(PackIconKind kind)
        {
            PackIcon pi = new PackIcon();

            pi.Kind = kind;
            return(pi);
        }
예제 #5
0
 public AlertDialog(string title, string message = "", PackIconKind icon = PackIconKind.Alert)
 {
     InitializeComponent();
     Title.Text   = title;
     Message.Text = message;
     Icon.Kind    = icon;
 }
        protected override Task OnLoaded()
        {
            this.StatisticNameTextBlock.Text = this.dataTracker.Name;
            if (this.dataTracker.IsPackIcon)
            {
                this.PackIcon.Kind = this.icon = EnumHelper.GetEnumValueFromString <PackIconKind>(this.dataTracker.IconName);
            }

            Task.Run(async() =>
            {
                try
                {
                    while (true)
                    {
                        await this.Dispatcher.BeginInvoke(new Action(() =>
                        {
                            try
                            {
                                this.RefreshOverview();
                            }
                            catch (Exception ex) { Logger.Log(ex); }
                        }));

                        await Task.Delay(60000);
                    }
                }
                catch (Exception ex) { Logger.Log(ex); }
            });

            return(Task.FromResult(0));
        }
예제 #7
0
파일: ChangedFile.cs 프로젝트: sofluf/Osmo
        /// <summary>
        /// Creates a new <see cref="ChangedFile"/> object which has been added, changed or removed.<para></para>
        ///
        /// If a file has been renamed, use ChangedFile(<see cref="string"/> name, <see cref="string"/> oldName) instead!
        /// </summary>
        /// <param name="name">The name of the changed file</param>
        /// <param name="changeType">The type of change which has been made to the file (see <see cref="FileChangeType"/>)</param>
        public ChangedFile(string name, FileChangeType changeType)
        {
            this.name       = name;
            this.changeType = changeType;

            switch (changeType)
            {
            case FileChangeType.Added:
                icon = PackIconKind.Plus;
                break;

            case FileChangeType.Changed:
                icon = PackIconKind.Pencil;
                break;

            case FileChangeType.Deleted:
                icon      = PackIconKind.Minus;
                isDeleted = true;
                break;

            case FileChangeType.Renamed:
                icon = PackIconKind.CursorText;
                break;

            default:
                icon = PackIconKind.Help;
                break;
            }
        }
        public static ImageSource FindPackIconImage(PackIconKind value, Brush foregroundBrush, double penThickness)
        {
            if (IconImageDictionary.ContainsKey(value))
            {
                return(IconImageDictionary[value]);
            }
            var packIcon = new PackIcon {
                Kind = value
            };

            var geometryDrawing = new GeometryDrawing
            {
                Geometry = Geometry.Parse(packIcon.Data),
                Brush    = foregroundBrush,
                Pen      = new Pen(foregroundBrush, penThickness)
            };

            var drawingGroup = new DrawingGroup {
                Children = { geometryDrawing }, Transform = new ScaleTransform(1, -1)
            };

            return(new DrawingImage {
                Drawing = drawingGroup
            });
        }
예제 #9
0
 public ItemMenu(string header, List <SubItem> subItems, PackIconKind icon)
 {
     Header   = header;
     SubItems = subItems;
     Icon     = icon;
     Screen   = null;
 }
예제 #10
0
        //used to create a snackbar message
        public static UIElement NewSnackbarMessage(PackIconKind iconkind, string message)
        {
            //create the stackpanel
            var sp_parent = new StackPanel()
            {
                Orientation = Orientation.Horizontal
            };

            //create the icon
            var icon = new PackIcon()
            {
                Kind                  = iconkind,
                Width                 = 25,
                Height                = 25,
                Foreground            = new SolidColorBrush(Colors.White),
                RenderTransformOrigin = new Point(0.5, 0.5),
            };

            //create textblock
            var label = new TextBlock()
            {
                Text              = message,
                Margin            = new Thickness(10, 0, 0, 0),
                VerticalAlignment = VerticalAlignment.Center,
                Foreground        = new SolidColorBrush(Colors.White)
            };

            //add to the stackpanel
            sp_parent.Children.Add(icon);
            sp_parent.Children.Add(label);

            return(sp_parent);
        }
예제 #11
0
        //Snackbar Message that blinks
        public static UIElement NewSnackbarMessage(PackIconKind iconkind, string message, Color blinkColor, double speed = 1)
        {
            //create the color animation
            var ca = new ColorAnimation()
            {
                From           = Colors.White,
                To             = blinkColor,
                Duration       = new Duration(TimeSpan.FromSeconds(speed)),
                AutoReverse    = true,
                RepeatBehavior = RepeatBehavior.Forever,
                EasingFunction = new SineEase()
                {
                    EasingMode = EasingMode.EaseInOut
                }
            };

            //new snakcbar message
            var SnackbarMessage = UIHelper.NewSnackbarMessage(iconkind, message) as StackPanel;
            //get elements
            var icon  = SnackbarMessage.Children.OfType <PackIcon>().First();
            var label = SnackbarMessage.Children.OfType <TextBlock>().First();

            //animate elements
            icon.Foreground.BeginAnimation(SolidColorBrush.ColorProperty, ca);
            label.Foreground.BeginAnimation(SolidColorBrush.ColorProperty, ca);

            return(SnackbarMessage);
        }
 public ControlPopUpRowItemModel(string title, PackIconKind kind, TitleBarButtons button, GeneralRoutingEnum route = GeneralRoutingEnum.None)
 {
     Title  = title;
     Kind   = kind;
     Button = button;
     Route  = route;
 }
 public NetworkModelViewClass(Brush brush, PackIconKind packIconKind, string name, string info)
 {
     BrushColor = brush;
     Kind       = packIconKind;
     Name       = name;
     Info       = info;
 }
예제 #14
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            DisplayMode  mode = (DisplayMode)value;
            PackIconKind kind = PackIconKind.Numeric1BoxMultipleOutline;

            switch (mode)
            {
            case DisplayMode.One:
                kind = PackIconKind.Numeric1BoxMultipleOutline;
                break;

            case DisplayMode.Two:
                kind = PackIconKind.Numeric2BoxMultipleOutline;
                break;

            case DisplayMode.Four:
                kind = PackIconKind.Numeric4BoxMultipleOutline;
                break;

            case DisplayMode.Six:
                kind = PackIconKind.Numeric6BoxMultipleOutline;
                break;

            case DisplayMode.Nine:
                kind = PackIconKind.Numeric9BoxMultipleOutline;
                break;

            default:
                break;
            }
            return(kind);
        }
예제 #15
0
 public ItemMenu(string header, string id, UserControl screen, PackIconKind icon)
 {
     Header = header;
     Screen = screen;
     Icon   = icon;
     APID   = id;
 }
        public StatisticsOverviewControl(StatisticDataTrackerBase dataTracker)
        {
            this.dataTracker = dataTracker;
            this.icon        = EnumHelper.GetEnumValueFromString <PackIconKind>(this.dataTracker.IconName);

            InitializeComponent();
        }
예제 #17
0
 public ItemMenu(string header, string id, Cashier cashier, PackIconKind icon)
 {
     Header   = header;
     _Cashier = cashier;
     Icon     = icon;
     APID     = id;
 }
예제 #18
0
 public ItemMenu(ePAGE header, PackIconKind icon, Visibility visibility, SubItem[] subitems)
 {
     Header     = header;
     Icon       = icon;
     Visibility = visibility.ToString();
     SubItems   = subitems;
 }
예제 #19
0
        //https://gist.github.com/Phyxion/160a6f04e6083016d4b2a3aed3c4fe71
        public static Image GetImage(
            PackIconKind iconKind,
            Brush brush,
            Pen pen)
        {
            var icon = new PackIcon
            {
                Kind = iconKind
            };

            var geometryDrawing = new GeometryDrawing
            {
                Geometry = Geometry.Parse(icon.Data),
                Brush    = brush,
                Pen      = pen
            };

            var drawingGroup = new DrawingGroup {
                Children = { geometryDrawing }
            };

            var img = new DrawingImage {
                Drawing = drawingGroup
            };
            var stream = DrawingImageToStream(img);

            return(Image.FromStream(stream));
        }
예제 #20
0
 public SubItem(string text, CmdLogType logtype, PackIconKind icon, UserControl screen = null)
 {
     Text    = text;
     LogType = logtype;
     Icon    = icon;
     Screen  = screen;
 }
예제 #21
0
 protected void SetMenuImage(PackIconKind packIconKind)
 {
     PackIconImage.Height     = 30;
     PackIconImage.Width      = 30;
     PackIconImage.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("White"));
     PackIconImage.Kind       = packIconKind;
 }
예제 #22
0
        /// <inheritdoc />
        public void ShowNotification(string title, string message, PackIconKind icon)
        {
            Execute.OnUIThread(() =>
            {
                // Convert the PackIcon to an icon by drawing it on a visual
                DrawingVisual drawingVisual   = new();
                DrawingContext drawingContext = drawingVisual.RenderOpen();

                PackIcon packIcon = new() { Kind = icon };
                Geometry geometry = Geometry.Parse(packIcon.Data);

                // Scale the icon up to fit a 256x256 image and draw it
                geometry = Geometry.Combine(geometry, Geometry.Empty, GeometryCombineMode.Union, new ScaleTransform(256 / geometry.Bounds.Right, 256 / geometry.Bounds.Bottom));
                drawingContext.DrawGeometry(new SolidColorBrush(Colors.White), null, geometry);
                drawingContext.Close();

                // Render the visual and add it to a PNG encoder (we want opacity in our icon)
                RenderTargetBitmap renderTargetBitmap = new(256, 256, 96, 96, PixelFormats.Pbgra32);
                renderTargetBitmap.Render(drawingVisual);
                PngBitmapEncoder encoder = new();
                encoder.Frames.Add(BitmapFrame.Create(renderTargetBitmap));

                // Save the PNG and get an icon handle
                using MemoryStream stream = new();
                encoder.Save(stream);
                Icon convertedIcon = Icon.FromHandle(new Bitmap(stream).GetHicon());

                // Show the 'balloon'
                _taskBarIcon.ShowBalloonTip(title, message, convertedIcon, true);
            });
        }
예제 #23
0
 public LootQueueEntry(string lootName, Rarity lootRarity, PackIconKind lootIconKind, int quantity)
 {
     LootName     = lootName;
     LootRarity   = lootRarity;
     LootIconKind = lootIconKind;
     Quantity     = quantity;
 }
예제 #24
0
 public ItemMenu(string header, List <SubItem> subItems, PackIconKind icon, UserControl screen = null)
 {
     Header   = header;
     SubItems = subItems;
     Icon     = icon;
     Screen   = screen;
 }
예제 #25
0
 public MenuItem(string xName = "", PackIconKind icon = PackIconKind.None, string data = "", UserControl usc = null)
 {
     this.xName = xName;
     this.icon  = icon;
     this.data  = data;
     this.usc   = usc;
 }
예제 #26
0
        public void GetStatus()
        {
            int good  = 0;
            int bad   = 0;
            int total = BachupDestinationStatus.Count;

            foreach (bool status in BachupDestinationStatus.Values)
            {
                good = status ? good += 1 : good;
                bad  = status ? bad : bad += 1;
            }

            if (good == total)
            {
                Icon = PackIconKind.Check;
                Type = BachupHistoryType.fullBachup;
                return;
            }

            if (bad == total)
            {
                Icon = PackIconKind.CloseOctagonOutline;
                Type = BachupHistoryType.failedBachup;
                return;
            }
            Icon = PackIconKind.WarningOutline;
            Type = BachupHistoryType.partialBachup;
        }
 //public SubItem(string name, UserControl screen = null)
 //public SubItem(string name, UserControl screen)
 public SubItem(string name, string tip, PackIconKind icon, UserControl user)
 {
     Name     = name;
     Screen   = user;
     this.tip = tip;
     Icono    = icon;
 }
예제 #28
0
 public ItemMenu(string header, List <SubItem> subItems, PackIconKind icon)
 {
     Header   = header;
     SubItems = subItems;
     Icon     = icon;
     APID     = "";
 }
        public StatisticsOverviewControl(StatisticDataTrackerBase dataTracker, PackIconKind icon)
        {
            this.dataTracker = dataTracker;
            this.icon        = icon;

            InitializeComponent();
        }
예제 #30
0
 public ItemMenu(string itemName, PackIconKind icon, List <SubItem> subItems)
 {
     /* MoveToMenuPageCommand = new CommandViewModel(Execute);*/
     this.ItemName = itemName;
     this.Icon     = icon;
     this.SubItems = subItems;
 }