Наследование: MonoBehaviour
        /// <summary>
        /// Combines the given image together with the current one by blending their pixels.
        /// </summary>
        /// <param name="source">The image this method extends.</param>
        /// <param name="color">The color to set as the background.</param>
        /// <param name="progressHandler">A delegate which is called as progress is made processing the image.</param>
        /// <returns>The <see cref="Image"/>.</returns>
        public static Image BackgroundColor(this Image source, Color color, ProgressEventHandler progressHandler = null)
        {
            BackgroundColor processor = new BackgroundColor(color);
            processor.OnProgress += progressHandler;

            try
            {
                return source.Process(source.Bounds, processor);
            }
            finally
            {
                processor.OnProgress -= progressHandler;
            }
        }
Пример #2
0
        /// <summary>
        /// compare this object with another
        /// </summary>
        /// <param name="obj">Object to be equals</param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            return(obj is TrailTheme theme &&
                   HeaderFullWidth == theme.HeaderFullWidth &&
                   HeaderFullHeight == theme.HeaderFullHeight &&
                   HeaderFocusWidth == theme.HeaderFocusWidth &&
                   HeaderFocusHeight == theme.HeaderFocusHeight &&
                   AvatarShape == theme.AvatarShape &&
#if NETSTANDARD2_0
                   BackgroundColor.Equals(theme.BackgroundColor) &&
#else
                   BackgroundColor == theme.BackgroundColor &&
#endif
                   BodyFont == theme.BodyFont &&
                   HeaderBounds == theme.HeaderBounds &&
                   HeaderImage == theme.HeaderImage &&
                   HeaderImageFocused == theme.HeaderImageFocused &&
                   HeaderImageScaled == theme.HeaderImageScaled &&
                   HeaderStretch == theme.HeaderStretch &&
#if NETSTANDARD2_0
                   LinkColor.Equals(LinkColor) &&
#else
                   LinkColor == theme.LinkColor &&
#endif
                   ShowAvatar == theme.ShowAvatar &&
                   ShowDescription == theme.ShowDescription &&
                   ShowHeaderImage == theme.ShowHeaderImage &&
                   ShowTitle == theme.ShowTitle &&
#if NETSTANDARD2_0
                   TitleColor.Equals(TitleColor) &&
#else
                   TitleColor == theme.TitleColor &&
#endif
                   TitleFont == theme.TitleFont &&
                   TitleFontWeight == theme.TitleFontWeight);
        }
Пример #3
0
        internal cef_settings_t *ToNative()
        {
            var ptr = cef_settings_t.Alloc();

            ptr->no_sandbox = NoSandbox ? 1 : 0;
            cef_string_t.Copy(BrowserSubprocessPath, &ptr->browser_subprocess_path);
            cef_string_t.Copy(FrameworkDirPath, &ptr->framework_dir_path);
            cef_string_t.Copy(MainBundlePath, &ptr->main_bundle_path);
            ptr->chrome_runtime = ChromeRuntime ? 1 : 0;
            ptr->multi_threaded_message_loop  = MultiThreadedMessageLoop ? 1 : 0;
            ptr->windowless_rendering_enabled = WindowlessRenderingEnabled ? 1 : 0;
            ptr->external_message_pump        = ExternalMessagePump ? 1 : 0;
            ptr->command_line_args_disabled   = CommandLineArgsDisabled ? 1 : 0;
            cef_string_t.Copy(CachePath, &ptr->cache_path);
            cef_string_t.Copy(RootCachePath, &ptr->root_cache_path);
            cef_string_t.Copy(UserDataPath, &ptr->user_data_path);
            ptr->persist_session_cookies  = PersistSessionCookies ? 1 : 0;
            ptr->persist_user_preferences = PersistUserPreferences ? 1 : 0;
            cef_string_t.Copy(UserAgent, &ptr->user_agent);
            cef_string_t.Copy(UserAgentProduct, &ptr->user_agent_product);
            cef_string_t.Copy(Locale, &ptr->locale);
            cef_string_t.Copy(LogFile, &ptr->log_file);
            ptr->log_severity = LogSeverity;
            cef_string_t.Copy(JavaScriptFlags, &ptr->javascript_flags);
            cef_string_t.Copy(ResourcesDirPath, &ptr->resources_dir_path);
            cef_string_t.Copy(LocalesDirPath, &ptr->locales_dir_path);
            ptr->pack_loading_disabled         = PackLoadingDisabled ? 1 : 0;
            ptr->remote_debugging_port         = RemoteDebuggingPort;
            ptr->uncaught_exception_stack_size = UncaughtExceptionStackSize;
            ptr->background_color = BackgroundColor.ToArgb();
            cef_string_t.Copy(AcceptLanguageList, &ptr->accept_language_list);
            cef_string_t.Copy(CookieableSchemesList, &ptr->cookieable_schemes_list);
            ptr->cookieable_schemes_exclude_defaults = CookieableSchemesExcludeDefaults ? 1 : 0;
            cef_string_t.Copy(ApplicationClientIdForFileScanning, &ptr->application_client_id_for_file_scanning);
            return(ptr);
        }
Пример #4
0
            public override void DrawInteriorWithFrame(CGRect cellFrame, NSView inView)
            {
                var nscontext = NSGraphicsContext.CurrentContext;

                if (DrawsBackground)
                {
                    var context = nscontext.GraphicsPort;
                    context.SetFillColor(BackgroundColor.ToCG());
                    context.FillRect(cellFrame);
                }

                var handler         = Handler;
                var graphicsHandler = new GraphicsHandler(null, nscontext, (float)cellFrame.Height, flipped: true);

                using (var graphics = new Graphics(graphicsHandler))
                {
                    var state = Highlighted ? CellStates.Selected : CellStates.None;
                    var item  = ObjectValue as EtoCellValue;
                                        #pragma warning disable 618
                    var args = new DrawableCellPaintEventArgs(graphics, cellFrame.ToEto(), state, item != null ? item.Item : null);
                    handler.Callback.OnPaint(handler.Widget, args);
                                        #pragma warning restore 618
                }
            }
        /// <summary>
        /// Returns true if PdfGetPageThumbnailParameters instances are equal
        /// </summary>
        /// <param name="input">Instance of PdfGetPageThumbnailParameters to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PdfGetPageThumbnailParameters input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     FileId == input.FileId ||
                     (FileId != null &&
                      FileId.Equals(input.FileId))
                     ) &&
                 (
                     PageRange == input.PageRange ||
                     (PageRange != null &&
                      PageRange.Equals(input.PageRange))
                 ) &&
                 (
                     ThumbnailWidth == input.ThumbnailWidth ||
                     ThumbnailWidth.Equals(input.ThumbnailWidth)
                 ) &&
                 (
                     ThumbnailHeight == input.ThumbnailHeight ||
                     ThumbnailHeight.Equals(input.ThumbnailHeight)
                 ) &&
                 (
                     BackgroundColor == input.BackgroundColor ||
                     (BackgroundColor != null &&
                      BackgroundColor.Equals(input.BackgroundColor))
                 ) &&
                 (
                     ThumbnailFitToPageSize == input.ThumbnailFitToPageSize ||
                     ThumbnailFitToPageSize.Equals(input.ThumbnailFitToPageSize)
                 ));
        }
Пример #6
0
        public Uno_Player_PutCard_Data(MessageReceiving _mess, UnoGamePlayData _unoGamePlayData)
        {
            indexCircle     = _mess.readByte();
            cardValue       = _mess.readByte();
            clientIndexCard = _mess.readByte();
            sumCardGet      = _mess.readByte();
            bool _tmpDirection = _mess.readBoolean();

            if (_tmpDirection)
            {
                turnDirection = TurnDirection.ClockWise;
            }
            else
            {
                turnDirection = TurnDirection.CounterClockWise;
            }

            bgColor = _unoGamePlayData.GetBackgroundColor(cardValue);

            countCard = _mess.readByte();
            // #if TEST
            // Debug.Log(">>> (PutCard) PlayerPlaying " + indexCircle +" còn " + countCard + " lá bài");
            // #endif
        }
Пример #7
0
        private void Render(System.Windows.Media.DrawingContext dc)
        {
            var dirtyRectangle = queueRect;

            queueRect = Rectangle.Zero;
            // disabled! queueRect allways zero!
            if (queueRect == Rectangle.Zero)
            {
                dirtyRectangle = new Rectangle(0, 0, Widget.ActualWidth, Widget.ActualHeight);
            }
            var dirtyRect = dirtyRectangle.ToWpfRect();

            if (BackgroundColorSet)
            {
                SolidColorBrush mySolidColorBrush = new SolidColorBrush();
                mySolidColorBrush.Color = BackgroundColor.ToWpfColor();
                dc.DrawRectangle(mySolidColorBrush, null, dirtyRect);
            }

            var ctx = new Xwt.WPFBackend.DrawingContext(dc, Widget.GetScaleFactor());

            ctx.Context.PushClip(new RectangleGeometry(dirtyRect));
            CanvasEventSink.OnDraw(ctx, dirtyRectangle);
        }
Пример #8
0
        /// <summary>
        /// Update CalloutStyle of Feature
        /// </summary>
        private void UpdateCalloutStyle()
        {
            CalloutStyle style = (CalloutStyle)Feature.Styles.Where((s) => s is CalloutStyle).FirstOrDefault();

            if (style == null)
            {
                style = new CalloutStyle();
                Feature.Styles.Add(style);
            }

            style.ArrowAlignment  = ArrowAlignment;
            style.ArrowHeight     = (float)ArrowHeight;
            style.ArrowPosition   = (float)ArrowPosition;
            style.BackgroundColor = BackgroundColor.ToMapsui();;
            style.Color           = Color.ToMapsui();
            style.SymbolOffset    = new Offset(Anchor.X, Anchor.Y);
            style.Padding         = new BoundingBox(Padding.Left, Padding.Top, Padding.Right, Padding.Bottom);
            style.RectRadius      = (float)RectRadius;
            style.RotateWithMap   = RotateWithMap;
            style.Rotation        = (float)Rotation;
            style.ShadowWidth     = (float)ShadowWidth;
            style.StrokeWidth     = (float)StrokeWidth;
            style.Content         = Content;
        }
Пример #9
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //STEPPER
            case nameof(Maximum):
                return(Maximum.ToString());

            case nameof(Minimum):
                return(Minimum.ToString());

            case nameof(Value):
                return(Value.ToString());

            case nameof(Increment):
                return(Increment.ToString());

            default:
                return(string.Empty);
            }
        }
Пример #10
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //PICKER
            case nameof(ItemsSource):
                return(ItemsSource.OfType <object>().Select(x => x.ToString()).Aggregate((x, y) => x + "," + y));

            case nameof(SelectedItem):
                return(SelectedItem.ToString());

            case nameof(SelectedIndex):
                return(SelectedIndex.ToString());

            case nameof(Items):
                return(Items.Aggregate((x, y) => x + "," + y));

            case nameof(Title):
                return(Title);

            default:
                return(string.Empty);
            }
        }
Пример #11
0
 /// <summary>
 /// Sends a message to a chat room.
 /// </summary>
 /// <param name="message">The message to send - can contain some HTML and must be valid XHTML.</param>
 /// <param name="notify">If true, the message triggers a "ping" sound when it hits the room.</param>
 /// <param name="color">Background color to use with the message</param>
 public void SendMessage(string message, BackgroundColor color, bool notify)
 {
     this.Color = color;
     this.Notify = notify;
     SendMessage(message);
 }
Пример #12
0
 /// <summary>
 /// Sends a message to a chat room.
 /// </summary>
 /// <param name="message">The message to send - can contain some HTML and must be valid XHTML.</param>
 /// <param name="from">The name of the sender - sets the From property.</param>
 /// <param name="notify">If true, the message triggers a "ping" sound when it hits the room.</param>
 /// <param name="color">Background color to use with the message</param>
 public void SendMessage(string message, string from, bool notify, BackgroundColor color)
 {
     this.Notify = notify;
     SendMessage(message, from, color);
 }
Пример #13
0
 /// <summary>
 /// Sends a message to a chat room.
 /// </summary>
 public static void SendMessage(string token, int room, string from, string message, bool notify, BackgroundColor color)
 {
     // create a local instance of HipChatClient, as then we get the validation
     var client = new HipChatClient(token, room);
     client.SendMessage(message, from, notify, color);
 }
Пример #14
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;

                if (Visible != null)
                {
                    hashCode = hashCode * 59 + Visible.GetHashCode();
                }

                if (ShowSpikes != null)
                {
                    hashCode = hashCode * 59 + ShowSpikes.GetHashCode();
                }

                if (SpikeSides != null)
                {
                    hashCode = hashCode * 59 + SpikeSides.GetHashCode();
                }

                if (SpikeThickness != null)
                {
                    hashCode = hashCode * 59 + SpikeThickness.GetHashCode();
                }

                if (SpikeColor != null)
                {
                    hashCode = hashCode * 59 + SpikeColor.GetHashCode();
                }

                if (ShowBackground != null)
                {
                    hashCode = hashCode * 59 + ShowBackground.GetHashCode();
                }

                if (BackgroundColor != null)
                {
                    hashCode = hashCode * 59 + BackgroundColor.GetHashCode();
                }

                if (ShowAxesLabels != null)
                {
                    hashCode = hashCode * 59 + ShowAxesLabels.GetHashCode();
                }

                if (Color != null)
                {
                    hashCode = hashCode * 59 + Color.GetHashCode();
                }

                if (CategoryOrder != null)
                {
                    hashCode = hashCode * 59 + CategoryOrder.GetHashCode();
                }

                if (CategoryArray != null)
                {
                    hashCode = hashCode * 59 + CategoryArray.GetHashCode();
                }

                if (Title != null)
                {
                    hashCode = hashCode * 59 + Title.GetHashCode();
                }

                if (Type != null)
                {
                    hashCode = hashCode * 59 + Type.GetHashCode();
                }

                if (AutoRange != null)
                {
                    hashCode = hashCode * 59 + AutoRange.GetHashCode();
                }

                if (RangeMode != null)
                {
                    hashCode = hashCode * 59 + RangeMode.GetHashCode();
                }

                if (Range != null)
                {
                    hashCode = hashCode * 59 + Range.GetHashCode();
                }

                if (TickMode != null)
                {
                    hashCode = hashCode * 59 + TickMode.GetHashCode();
                }

                if (NTicks != null)
                {
                    hashCode = hashCode * 59 + NTicks.GetHashCode();
                }

                if (Tick0 != null)
                {
                    hashCode = hashCode * 59 + Tick0.GetHashCode();
                }

                if (DTick != null)
                {
                    hashCode = hashCode * 59 + DTick.GetHashCode();
                }

                if (TickVals != null)
                {
                    hashCode = hashCode * 59 + TickVals.GetHashCode();
                }

                if (TickText != null)
                {
                    hashCode = hashCode * 59 + TickText.GetHashCode();
                }

                if (Ticks != null)
                {
                    hashCode = hashCode * 59 + Ticks.GetHashCode();
                }

                if (Mirror != null)
                {
                    hashCode = hashCode * 59 + Mirror.GetHashCode();
                }

                if (TickleN != null)
                {
                    hashCode = hashCode * 59 + TickleN.GetHashCode();
                }

                if (TickWidth != null)
                {
                    hashCode = hashCode * 59 + TickWidth.GetHashCode();
                }

                if (TickColor != null)
                {
                    hashCode = hashCode * 59 + TickColor.GetHashCode();
                }

                if (ShowTickLabels != null)
                {
                    hashCode = hashCode * 59 + ShowTickLabels.GetHashCode();
                }

                if (TickFont != null)
                {
                    hashCode = hashCode * 59 + TickFont.GetHashCode();
                }

                if (TickAngle != null)
                {
                    hashCode = hashCode * 59 + TickAngle.GetHashCode();
                }

                if (TickPrefix != null)
                {
                    hashCode = hashCode * 59 + TickPrefix.GetHashCode();
                }

                if (ShowTickPrefix != null)
                {
                    hashCode = hashCode * 59 + ShowTickPrefix.GetHashCode();
                }

                if (TickSuffix != null)
                {
                    hashCode = hashCode * 59 + TickSuffix.GetHashCode();
                }

                if (ShowTickSuffix != null)
                {
                    hashCode = hashCode * 59 + ShowTickSuffix.GetHashCode();
                }

                if (ShowExponent != null)
                {
                    hashCode = hashCode * 59 + ShowExponent.GetHashCode();
                }

                if (ExponentFormat != null)
                {
                    hashCode = hashCode * 59 + ExponentFormat.GetHashCode();
                }

                if (SeparateThousands != null)
                {
                    hashCode = hashCode * 59 + SeparateThousands.GetHashCode();
                }

                if (TickFormat != null)
                {
                    hashCode = hashCode * 59 + TickFormat.GetHashCode();
                }

                if (TickFormatStops != null)
                {
                    hashCode = hashCode * 59 + TickFormatStops.GetHashCode();
                }

                if (HoverFormat != null)
                {
                    hashCode = hashCode * 59 + HoverFormat.GetHashCode();
                }

                if (ShowLine != null)
                {
                    hashCode = hashCode * 59 + ShowLine.GetHashCode();
                }

                if (LineColor != null)
                {
                    hashCode = hashCode * 59 + LineColor.GetHashCode();
                }

                if (LineWidth != null)
                {
                    hashCode = hashCode * 59 + LineWidth.GetHashCode();
                }

                if (ShowGrid != null)
                {
                    hashCode = hashCode * 59 + ShowGrid.GetHashCode();
                }

                if (GridColor != null)
                {
                    hashCode = hashCode * 59 + GridColor.GetHashCode();
                }

                if (GridWidth != null)
                {
                    hashCode = hashCode * 59 + GridWidth.GetHashCode();
                }

                if (ZeroLine != null)
                {
                    hashCode = hashCode * 59 + ZeroLine.GetHashCode();
                }

                if (ZeroLineColor != null)
                {
                    hashCode = hashCode * 59 + ZeroLineColor.GetHashCode();
                }

                if (ZeroLineWidth != null)
                {
                    hashCode = hashCode * 59 + ZeroLineWidth.GetHashCode();
                }

                if (Calendar != null)
                {
                    hashCode = hashCode * 59 + Calendar.GetHashCode();
                }

                if (CategoryArraySrc != null)
                {
                    hashCode = hashCode * 59 + CategoryArraySrc.GetHashCode();
                }

                if (TickValsSrc != null)
                {
                    hashCode = hashCode * 59 + TickValsSrc.GetHashCode();
                }

                if (TickTextSrc != null)
                {
                    hashCode = hashCode * 59 + TickTextSrc.GetHashCode();
                }

                return(hashCode);
            }
        }
Пример #15
0
        private UInt32Value SetCellStyle(System.Drawing.Color fillColor, bool locked)
        {
            Fill fill = new Fill();
            PatternFill patternFill = new PatternFill() { PatternType = PatternValues.Solid };
            ForegroundColor foregroundColor1 = new ForegroundColor() { Rgb = System.Drawing.Color.FromArgb(fillColor.A, fillColor.R, fillColor.G, fillColor.B).Name };
            BackgroundColor backgroundColor1 = new BackgroundColor() { Indexed = (UInt32Value)64U };

            patternFill.Append(foregroundColor1);
            patternFill.Append(backgroundColor1);
            fill.Append(patternFill);
            ExcelStyleSheet.Fills.Count++;
            ExcelStyleSheet.Fills.Append(fill);

            CellFormat myCellFormat =
              new CellFormat
              {
                  FontId = (UInt32Value)0U,
                  FillId = (UInt32Value)ExcelStyleSheet.Fills.Count - 1,
                  ApplyFill = true,
                  NumberFormatId = (UInt32Value)0U,
                  FormatId = (UInt32Value)0U,
                  BorderId = (UInt32Value)1U,
                  ApplyBorder = true,
                  ApplyProtection = true
              };

            Alignment alignment = new Alignment() { WrapText = true };
            myCellFormat.Append(alignment);

            if (!locked)
            {
                Protection protection = new Protection() { Locked = false };
                myCellFormat.Append(protection);
            }

            ExcelStyleSheet.CellFormats.Count++;
            ExcelStyleSheet.CellFormats.Append(myCellFormat);
            return (UInt32Value)ExcelStyleSheet.CellFormats.Count - 1;
        }
Пример #16
0
        StringBuilder PrepareFormattingString(StringBuilder _formattingString)
        {
            if (!ForegroundColor.IsDefault)
            {
                _formattingString.AppendFormat("color={0} ", ForegroundColor.ToHex());
            }

            if (!BackgroundColor.IsDefault)
            {
                _formattingString.AppendFormat("backing_color={0} backing=on ", BackgroundColor.ToHex());
            }

            if (!string.IsNullOrEmpty(FontFamily))
            {
                _formattingString.AppendFormat("font={0} ", FontFamily);
            }

            if (FontSize != -1)
            {
                _formattingString.AppendFormat("font_size={0} ", System.Maui.Maui.ConvertToEflFontPoint(FontSize));
            }

            if ((FontAttributes & FontAttributes.Bold) != 0)
            {
                _formattingString.Append("font_weight=Bold ");
            }
            else
            {
                // FontWeight is only available in case of FontAttributes.Bold is not used.
                if (FontWeight != Specific.FontWeight.None)
                {
                    _formattingString.AppendFormat("font_weight={0} ", FontWeight);
                }
            }

            if ((FontAttributes & FontAttributes.Italic) != 0)
            {
                _formattingString.Append("font_style=italic ");
            }

            if (Underline)
            {
                _formattingString.AppendFormat("underline=on underline_color={0} ",
                                               ForegroundColor.IsDefault ? s_defaultLineColor.ToHex() : ForegroundColor.ToHex());
            }

            if (Strikethrough)
            {
                _formattingString.AppendFormat("strikethrough=on strikethrough_color={0} ",
                                               ForegroundColor.IsDefault ? s_defaultLineColor.ToHex() : ForegroundColor.ToHex());
            }

            switch (HorizontalTextAlignment)
            {
            case TextAlignment.Auto:
                _formattingString.Append("align=auto ");
                break;

            case TextAlignment.Start:
                _formattingString.Append("align=left ");
                break;

            case TextAlignment.End:
                _formattingString.Append("align=right ");
                break;

            case TextAlignment.Center:
                _formattingString.Append("align=center ");
                break;

            case TextAlignment.None:
                break;
            }

            if (LineHeight != -1.0d)
            {
                _formattingString.Append($"linerelsize={(int)(LineHeight * 100)}%");
            }

            switch (LineBreakMode)
            {
            case LineBreakMode.HeadTruncation:
                _formattingString.Append("ellipsis=0.0");
                break;

            case LineBreakMode.MiddleTruncation:
                _formattingString.Append("ellipsis=0.5");
                break;

            case LineBreakMode.TailTruncation:
                _formattingString.Append("ellipsis=1.0");
                break;

            case LineBreakMode.None:
                break;
            }

            return(_formattingString);
        }
Пример #17
0
        public Bubble()
        {
            HorizontalOptions = LayoutOptions.Center;
            VerticalOptions   = LayoutOptions.Center;
            Clicked          += Bubble_Clicked;

            #region
            members = new Dictionary <string, Variable>
            {
                { "Width", new FVariable {
                      ongetvalue = () => new Gnumber(Width),
                      onsetvalue = (value) => { WidthRequest = Convert.ToDouble(value); return(0); }
                  } },
                { "Height", new FVariable
                  {
                      ongetvalue = () => new Gnumber(Height),
                      onsetvalue = (value) => { HeightRequest = Convert.ToDouble(value); return(0); }
                  } },
                { "Horizontal", new FVariable
                  {
                      ongetvalue = () => new Gstring(HorizontalOptions.ToString()),
                      onsetvalue = (value) => {
                          if (value.ToString() == "center")
                          {
                              HorizontalOptions = LayoutOptions.Center;
                          }
                          else if (value.ToString() == "left")
                          {
                              HorizontalOptions = LayoutOptions.Start;
                          }
                          else if (value.ToString() == "right")
                          {
                              HorizontalOptions = LayoutOptions.End;
                          }
                          else if (value.ToString() == "stretch")
                          {
                              HorizontalOptions = LayoutOptions.Fill;
                          }
                          return(0);
                      }
                  } },
                { "Vertical", new FVariable {
                      ongetvalue = () => new Gstring(VerticalOptions.ToString()),
                      onsetvalue = (value) =>
                      {
                          if (value.ToString() == "center")
                          {
                              VerticalOptions = LayoutOptions.Center;
                          }
                          else if (value.ToString() == "bottom")
                          {
                              VerticalOptions = LayoutOptions.End;
                          }
                          else if (value.ToString() == "stretch")
                          {
                              VerticalOptions = LayoutOptions.Fill;
                          }
                          else if (value.ToString() == "top")
                          {
                              VerticalOptions = LayoutOptions.Start;
                          }
                          return(0);
                      }
                  } },
                { "Margin", new FVariable {
                      ongetvalue = () => new Glist {
                          new Variable(Margin.Left), new Variable(Margin.Top), new Variable(Margin.Right), new Variable(Margin.Bottom)
                      },
                      onsetvalue = (value) =>
                      {
                          var list = value.IGetCSValue() as Glist;
                          Margin = new Thickness(
                              Convert.ToDouble(list[0].value), Convert.ToDouble(list[1].value), Convert.ToDouble(list[2].value), Convert.ToDouble(list[3].value)
                              );
                          return(0);
                      }
                  } },
                { "Visibility", new FVariable {
                      ongetvalue = () =>
                      {
                          string s = "null";
                          switch (IsVisible)
                          {
                          case true:
                              s = "visiable";
                              break;

                          case false:
                              s = "gone";
                              break;
                          }
                          return(new Gstring(s));
                      },
                      onsetvalue = (value) =>
                      {
                          if (value.ToString() == "gone")
                          {
                              IsVisible = false;
                          }
                          else if (value.ToString() == "hidden")
                          {
                              IsVisible = false;
                          }
                          else if (value.ToString() == "visible")
                          {
                              IsVisible = true;
                          }
                          return(0);
                      }
                  } },
                { "Text", new FVariable {
                      ongetvalue = () => new Gstring(Text.ToString()),
                      onsetvalue = (value) =>
                      {
                          Text = value.ToString();
                          return(0);
                      }
                  } },
                { "FontSize", new FVariable {
                      ongetvalue = () => new Gnumber(FontSize),
                      onsetvalue = (value) =>
                      {
                          FontSize = Convert.ToDouble(value);
                          return(0);
                      }
                  } },
                { "Padding", new FVariable {
                      ongetvalue = () => new Glist {
                          new Variable(Padding.Left), new Variable(Padding.Top), new Variable(Padding.Right), new Variable(Padding.Bottom)
                      },
                      onsetvalue = (value) =>
                      {
                          var list = value.IGetCSValue() as Glist;
                          Padding = new Thickness(
                              Convert.ToDouble(list[0].value), Convert.ToDouble(list[1].value), Convert.ToDouble(list[2].value), Convert.ToDouble(list[3].value)
                              );
                          return(0);
                      }
                  } },
                { "Background", new FVariable {
                      ongetvalue = () => new Gstring(BackgroundColor.ToString()),
                      onsetvalue = (value) =>
                      {
                          BackgroundColor = (Color) new ColorTypeConverter().ConvertFromInvariantString(value.ToString());
                          return(0);
                      }
                  } },
                { "Foreground", new FVariable {
                      ongetvalue = () => new Gstring(TextColor.ToString()),
                      onsetvalue = (value) =>
                      {
                          TextColor = (Color) new ColorTypeConverter().ConvertFromInvariantString(value.ToString());
                          return(0);
                      }
                  } },
                { "Clickevent", new FVariable
                  {
                      ongetvalue   = () => event_click as IOBJ
                      , onsetvalue = (value) =>
                      {
                          event_click = value;
                          return(0);
                      }
                  } }
            };
            parent = new GTXAM.Control(this);
            #endregion
        }
Пример #18
0
        public static Stylesheet GenerateStylesheet()
        {
            Stylesheet stylesheet1 = new Stylesheet()
            {
                MCAttributes = new MarkupCompatibilityAttributes()
                {
                    Ignorable = "x14ac"
                }
            };

            stylesheet1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            stylesheet1.AddNamespaceDeclaration("x14ac", "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac");

            Fonts fonts1 = new Fonts()
            {
                Count = (UInt32Value)3U, KnownFonts = true
            };

            Font     font1     = new Font();
            FontSize fontSize1 = new FontSize()
            {
                Val = 14D
            };
            Color color1 = new Color()
            {
                Theme = (UInt32Value)1U
            };
            FontName fontName1 = new FontName()
            {
                Val = "Calibri"
            };
            FontFamilyNumbering fontFamilyNumbering1 = new FontFamilyNumbering()
            {
                Val = 2
            };
            FontScheme fontScheme1 = new FontScheme()
            {
                Val = FontSchemeValues.Minor
            };

            font1.Append(fontSize1);
            font1.Append(color1);
            font1.Append(fontName1);
            font1.Append(fontFamilyNumbering1);
            font1.Append(fontScheme1);

            Font     font2     = new Font();
            Bold     bold2     = new Bold();
            FontSize fontSize2 = new FontSize()
            {
                Val = 18D
            };
            Color color2 = new Color()
            {
                Theme = (UInt32Value)1U
            };
            FontName fontName2 = new FontName()
            {
                Val = "Calibri"
            };
            FontFamilyNumbering fontFamilyNumbering2 = new FontFamilyNumbering()
            {
                Val = 2
            };
            FontScheme fontScheme2 = new FontScheme()
            {
                Val = FontSchemeValues.Minor
            };

            font2.Append(bold2);
            font2.Append(fontSize2);
            font2.Append(color2);
            font2.Append(fontName2);
            font2.Append(fontFamilyNumbering2);
            font2.Append(fontScheme2);

            Font     font3     = new Font();
            Bold     bold1     = new Bold();
            FontSize fontSize3 = new FontSize()
            {
                Val = 30D
            };
            Color color3 = new Color()
            {
                Theme = (UInt32Value)1U
            };
            FontName fontName3 = new FontName()
            {
                Val = "Calibri"
            };
            FontFamilyNumbering fontFamilyNumbering3 = new FontFamilyNumbering()
            {
                Val = 2
            };
            FontScheme fontScheme3 = new FontScheme()
            {
                Val = FontSchemeValues.Minor
            };

            font3.Append(bold1);
            font3.Append(fontSize3);
            font3.Append(color3);
            font3.Append(fontName3);
            font3.Append(fontFamilyNumbering3);
            font3.Append(fontScheme3);

            fonts1.Append(font1);
            fonts1.Append(font2);
            fonts1.Append(font3);

            Fills fills1 = new Fills()
            {
                Count = (UInt32Value)2U
            };

            // 0 no BG color just normal Excel
            Fill        fill1        = new Fill();
            PatternFill patternFill1 = new PatternFill()
            {
                PatternType = PatternValues.None
            };

            fill1.Append(patternFill1);

            // 1 red or open CAT 1
            Fill        fill2        = new Fill();
            PatternFill patternFill2 = new PatternFill()
            {
                PatternType = PatternValues.Solid
            };
            ForegroundColor foregroundColor2 = new ForegroundColor()
            {
                Rgb = "FFFF0000"
            };
            BackgroundColor backgroundColor2 = new BackgroundColor()
            {
                Indexed = (UInt32Value)64U
            };

            patternFill2.Append(foregroundColor2);
            patternFill2.Append(backgroundColor2);
            fill2.Append(patternFill2);

            // 2 silver or N/A
            Fill        fill3        = new Fill();
            PatternFill patternFill3 = new PatternFill()
            {
                PatternType = PatternValues.Solid
            };
            ForegroundColor foregroundColor3 = new ForegroundColor()
            {
                Rgb = "FFCCCCCC"
            };
            BackgroundColor backgroundColor3 = new BackgroundColor()
            {
                Indexed = (UInt32Value)64U
            };

            patternFill3.Append(foregroundColor3);
            patternFill3.Append(backgroundColor3);
            fill3.Append(patternFill3);

            // 3 green or NaF
            Fill        fill4        = new Fill();
            PatternFill patternFill4 = new PatternFill()
            {
                PatternType = PatternValues.Solid
            };
            ForegroundColor foregroundColor4 = new ForegroundColor()
            {
                Rgb = "FF50CC83"
            };
            BackgroundColor backgroundColor4 = new BackgroundColor()
            {
                Indexed = (UInt32Value)64U
            };

            patternFill4.Append(foregroundColor4);
            patternFill4.Append(backgroundColor4);
            fill4.Append(patternFill4);

            // 4 black&white or Not Reviewed
            Fill        fill5        = new Fill();
            PatternFill patternFill5 = new PatternFill()
            {
                PatternType = PatternValues.Solid
            };
            ForegroundColor foregroundColor5 = new ForegroundColor()
            {
                Rgb = "FFFFFFFF"
            };
            BackgroundColor backgroundColor5 = new BackgroundColor()
            {
                Indexed = (UInt32Value)64U
            };

            patternFill5.Append(foregroundColor5);
            patternFill5.Append(backgroundColor5);
            fill5.Append(patternFill5);

            // 5 red or open CAT 1
            Fill        fill6        = new Fill();
            PatternFill patternFill6 = new PatternFill()
            {
                PatternType = PatternValues.Solid
            };
            ForegroundColor foregroundColor6 = new ForegroundColor()
            {
                Rgb = "FFE53935"
            };
            BackgroundColor backgroundColor6 = new BackgroundColor()
            {
                Indexed = (UInt32Value)64U
            };

            patternFill6.Append(foregroundColor6);
            patternFill6.Append(backgroundColor6);
            fill6.Append(patternFill6);

            // 6 orange open CAT 2
            Fill        fill7        = new Fill();
            PatternFill patternFill7 = new PatternFill()
            {
                PatternType = PatternValues.Solid
            };
            ForegroundColor foregroundColor7 = new ForegroundColor()
            {
                Rgb = "FFFFA500"
            };
            BackgroundColor backgroundColor7 = new BackgroundColor()
            {
                Indexed = (UInt32Value)64U
            };

            patternFill7.Append(foregroundColor7);
            patternFill7.Append(backgroundColor7);
            fill7.Append(patternFill7);

            // 7 orange open CAT 3
            Fill        fill8        = new Fill();
            PatternFill patternFill8 = new PatternFill()
            {
                PatternType = PatternValues.Solid
            };
            ForegroundColor foregroundColor8 = new ForegroundColor()
            {
                Rgb = "FFD8D80E"
            };
            BackgroundColor backgroundColor8 = new BackgroundColor()
            {
                Indexed = (UInt32Value)64U
            };

            patternFill8.Append(foregroundColor8);
            patternFill8.Append(backgroundColor8);
            fill8.Append(patternFill8);

            // 8 gray background for any general use
            Fill        fill9        = new Fill();
            PatternFill patternFill9 = new PatternFill()
            {
                PatternType = PatternValues.Solid
            };
            ForegroundColor foregroundColor9 = new ForegroundColor()
            {
                Rgb = "FFBBBBBB"
            };
            BackgroundColor backgroundColor9 = new BackgroundColor()
            {
                Indexed = (UInt32Value)64U
            };

            patternFill9.Append(foregroundColor9);
            patternFill9.Append(backgroundColor9);
            fill9.Append(patternFill9);

            fills1.Append(fill1); // these are 0 based when you include in the CellFormat statements below, so 1 off
            fills1.Append(fill2);
            fills1.Append(fill3);
            fills1.Append(fill4);
            fills1.Append(fill5);
            fills1.Append(fill6);
            fills1.Append(fill7);
            fills1.Append(fill8);
            fills1.Append(fill9);

            Borders borders1 = new Borders()
            {
                Count = (UInt32Value)1U
            };

            Border         border1         = new Border();
            LeftBorder     leftBorder1     = new LeftBorder();
            RightBorder    rightBorder1    = new RightBorder();
            TopBorder      topBorder1      = new TopBorder();
            BottomBorder   bottomBorder1   = new BottomBorder();
            DiagonalBorder diagonalBorder1 = new DiagonalBorder();

            border1.Append(leftBorder1);
            border1.Append(rightBorder1);
            border1.Append(topBorder1);
            border1.Append(bottomBorder1);
            border1.Append(diagonalBorder1);
            borders1.Append(border1);

            CellStyleFormats cellStyleFormats1 = new CellStyleFormats()
            {
                Count = (UInt32Value)1U
            };
            CellFormat cellFormat1 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U
            };

            cellStyleFormats1.Append(cellFormat1);
            CellFormats cellFormats1 = new CellFormats()
            {
                Count = (UInt32Value)4U
            };

            // style index 0:  normal font and wrapping of text for cell rows
            CellFormat cellFormat2 = new CellFormat(new Alignment()
            {
                WrapText = true
            })
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
            };
            // style index 1:  normal font with numerical format
            CellFormat cellFormat3 = new CellFormat(new Alignment()
            {
                WrapText = true
            })
            {
                NumberFormatId = (UInt32Value)2U, FontId = (UInt32Value)0U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true
            };
            // style index 2:  title font of 30 bold
            CellFormat cellFormat4 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)2U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true
            };
            // style index 3:  info row under title and header rows font bold size 18
            CellFormat cellFormat5 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true
            };

            // fill colors based on the fillx variables above to match the 4 statuses of the checklist vulnerabilities
            // style index 4: red or Open
            CellFormat cellFormat6 = new CellFormat(new Alignment()
            {
                WrapText = true
            })
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
            };
            // style index 5: silver or Not Applicable
            CellFormat cellFormat7 = new CellFormat(new Alignment()
            {
                WrapText = true
            })
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
            };
            // style index 6: green or Not a Finding
            CellFormat cellFormat8 = new CellFormat(new Alignment()
            {
                WrapText = true
            })
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
            };
            // style index 7: b/w or Not Reviewed
            CellFormat cellFormat9 = new CellFormat(new Alignment()
            {
                WrapText = true
            })
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)4U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
            };

            // CENTER The content for listings versus the excel export of a checklist above
            // style index 8: red or Open centered content
            CellFormat cellFormat10 = new CellFormat(new Alignment()
            {
                WrapText = true, Horizontal = HorizontalAlignmentValues.Center
            })
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
            };
            // style index 9: silver or Not Applicable
            CellFormat cellFormat11 = new CellFormat(new Alignment()
            {
                WrapText = true, Horizontal = HorizontalAlignmentValues.Center
            })
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
            };
            // style index 10: green or Not a Finding
            CellFormat cellFormat12 = new CellFormat(new Alignment()
            {
                WrapText = true, Horizontal = HorizontalAlignmentValues.Center
            })
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
            };
            // style index 11: b/w or Not Reviewed
            CellFormat cellFormat13 = new CellFormat(new Alignment()
            {
                WrapText = true, Horizontal = HorizontalAlignmentValues.Center
            })
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)4U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
            };

            // style index 12: orange Open CAT 2
            CellFormat cellFormat14 = new CellFormat(new Alignment()
            {
                WrapText = true
            })
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
            };
            // style index 13: yellow Open CAT 3
            CellFormat cellFormat15 = new CellFormat(new Alignment()
            {
                WrapText = true
            })
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)7U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
            };
            // style index 14: orange Open CAT 2 centered
            CellFormat cellFormat16 = new CellFormat(new Alignment()
            {
                WrapText = true, Horizontal = HorizontalAlignmentValues.Center
            })
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
            };
            // style index 15: yellow Open CAT 3 centered
            CellFormat cellFormat17 = new CellFormat(new Alignment()
            {
                WrapText = true, Horizontal = HorizontalAlignmentValues.Center
            })
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)7U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
            };
            // style index 16: yellow Open CAT 3 centered
            CellFormat cellFormat18 = new CellFormat(new Alignment()
            {
                WrapText = true
            })
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)8U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true
            };

            // add all these formats
            cellFormats1.Append(cellFormat2);
            cellFormats1.Append(cellFormat3);
            cellFormats1.Append(cellFormat4);
            cellFormats1.Append(cellFormat5);
            cellFormats1.Append(cellFormat6);
            cellFormats1.Append(cellFormat7);
            cellFormats1.Append(cellFormat8);
            cellFormats1.Append(cellFormat9);
            cellFormats1.Append(cellFormat10);
            cellFormats1.Append(cellFormat11);
            cellFormats1.Append(cellFormat12);
            cellFormats1.Append(cellFormat13);
            cellFormats1.Append(cellFormat14);
            cellFormats1.Append(cellFormat15);
            cellFormats1.Append(cellFormat16);
            cellFormats1.Append(cellFormat17);
            cellFormats1.Append(cellFormat18);

            CellStyles cellStyles1 = new CellStyles()
            {
                Count = (UInt32Value)1U
            };
            CellStyle cellStyle1 = new CellStyle()
            {
                Name = "Normal", FormatId = 0, BuiltinId = 0
            };

            cellStyles1.Append(cellStyle1);

            DifferentialFormats differentialFormats1 = new DifferentialFormats()
            {
                Count = 0
            };
            TableStyles tableStyles1 = new TableStyles()
            {
                Count = 0, DefaultTableStyle = "TableStyleMedium2", DefaultPivotStyle = "PivotStyleLight16"
            };

            StylesheetExtensionList stylesheetExtensionList1 = new StylesheetExtensionList();

            StylesheetExtension stylesheetExtension1 = new StylesheetExtension()
            {
                Uri = "{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}"
            };

            stylesheetExtension1.AddNamespaceDeclaration("x14", "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");

            StylesheetExtension stylesheetExtension2 = new StylesheetExtension()
            {
                Uri = "{9260A510-F301-46a8-8635-F512D64BE5F5}"
            };

            stylesheetExtension2.AddNamespaceDeclaration("x15", "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main");

            stylesheetExtensionList1.Append(stylesheetExtension1);
            stylesheetExtensionList1.Append(stylesheetExtension2);

            stylesheet1.Append(fonts1);
            stylesheet1.Append(fills1);
            stylesheet1.Append(borders1);
            stylesheet1.Append(cellStyleFormats1);
            stylesheet1.Append(cellFormats1);
            stylesheet1.Append(cellStyles1);
            stylesheet1.Append(differentialFormats1);
            stylesheet1.Append(tableStyles1);
            stylesheet1.Append(stylesheetExtensionList1);
            return(stylesheet1);
        }
        public override void Draw(CGRect rect)
        {
            if (BackgroundColor != null)
            {
                BackgroundColor.SetFill();
            }

            SelectionIndicatorArrowLayer.BackgroundColor = SelectionIndicatorColor.CGColor;
            SelectionIndicatorStripLayer.BackgroundColor = SelectionIndicatorColor.CGColor;

            SelectionIndicatorBoxLayer.BackgroundColor = SelectionIndicatorColor.CGColor;
            SelectionIndicatorBoxLayer.BorderColor     = SelectionIndicatorColor.CGColor;

            scrollView.Layer.Sublayers = new DisposableCALayer[0];
            ClearScrollViewSubLayers();
            var oldRect = rect;

            if (type == HMSegmentedControlType.Text)
            {
                for (int idx = 0; idx < sectionTitles.Count; idx++)
                {
                    var    size = MeasureTitle(idx);
                    var    stringWidth = size.Width;
                    var    stringHeight = size.Height;
                    CGRect rectangle, rectDiv, rectFull;

                    var locationUp           = SelectionIndicatorLocation == HMSegmentedControlIndicatorLocation.Up;
                    var selectionStyleNotBox = SelectionStyle != HMSegmentedControlSelectionStyle.Box;
                    var y = (float)Math.Round(((Frame.Height - (selectionStyleNotBox ? 1 : 0 * SelectionIndicatorHeight)) / 2) - (stringHeight / 2) + (SelectionIndicatorHeight * (locationUp ? 1 : 0)));

                    if (segmentWidthStyle == HMSegmentedControlWidthStyle.Fixed)
                    {
                        rectangle = new CGRect((segmentWidth * idx) + (segmentWidth - stringWidth) / 2, y, stringWidth, stringHeight);
                        rectDiv   = new CGRect((segmentWidth * idx) + (VerticalDividerWidth / 2), SelectionIndicatorHeight * 2, VerticalDividerWidth, Frame.Size.Height - (SelectionIndicatorHeight * 4));
                        rectFull  = new CGRect(segmentWidth * idx, 0, segmentWidth, oldRect.Size.Height);
                    }
                    else
                    {
                        var xOffset = 0.0f;
                        var i       = 0;
                        foreach (var width in segmentWidths)
                        {
                            if (idx == i)
                            {
                                break;
                            }
                            xOffset += width;
                            i++;
                        }

                        var widthForIndex = segmentWidths[idx];
                        rectangle = new CGRect(xOffset, y, widthForIndex, stringHeight);
                        rectFull  = new CGRect(segmentWidth * idx, 0, widthForIndex, oldRect.Size.Height);
                        rectDiv   = new CGRect(xOffset - (VerticalDividerWidth / 2),
                                               SelectionIndicatorHeight * 2, VerticalDividerWidth, Frame.Size.Height - (SelectionIndicatorHeight * 4));
                    }

                    rectangle = new CGRect((float)Math.Ceiling(rectangle.X), (float)Math.Ceiling(rectangle.Y), (float)Math.Ceiling(rectangle.Size.Width), (float)Math.Ceiling(rectangle.Size.Height));

                    var titleLayer = new DisposableCATextLayer
                    {
                        Frame            = rectangle,
                        AlignmentMode    = CATextLayer.AlignmentCenter,
                        TruncationMode   = CATextLayer.TruncantionEnd,
                        AttributedString = AttributedTitle(idx),
                        ContentsScale    = UIScreen.MainScreen.Scale
                    };
                    AddScrollViewSubLayer(titleLayer);

                    if (VerticalDividerEnabled)
                    {
                        var verticalDividerLayer = new DisposableCALayer {
                            Frame = rectDiv, BackgroundColor = VerticalDividerColor.CGColor
                        };
                        AddScrollViewSubLayer(verticalDividerLayer);
                    }

                    AddBackgroundAndBorderLayer(rectFull);
                }
            }
            else if (type == HMSegmentedControlType.Image)
            {
                for (int idx = 0; idx < sectionTitles.Count; idx++)
                {
                    var icon        = sectionImages[idx];
                    var imageWidth  = icon.Size.Width;
                    var imageHeight = icon.Size.Height;
                    var y           = (float)Math.Round(Frame.Height - SelectionIndicatorHeight) / 2 - imageHeight / 2 + (SelectionIndicatorLocation == HMSegmentedControlIndicatorLocation.Up ? SelectionIndicatorHeight : 0);
                    var x           = segmentWidth * idx + (segmentWidth - imageWidth) / 2.0f;
                    var rectNew     = new CGRect(x, y, imageWidth, imageHeight);

                    var imageLayer = new DisposableCALayer {
                        Frame = rectNew
                    };
                    if (SelectedIndex == idx && sectionSelectedImages != null)
                    {
                        imageLayer.Contents = sectionSelectedImages[idx].CGImage;
                    }
                    else
                    {
                        imageLayer.Contents = icon.CGImage;
                    }

                    AddScrollViewSubLayer(imageLayer);

                    if (VerticalDividerEnabled && idx > 0)
                    {
                        var verticalDividerLayer = new DisposableCALayer
                        {
                            Frame           = new CGRect((segmentWidth * idx) - (VerticalDividerWidth / 2), SelectionIndicatorHeight * 2, VerticalDividerWidth, Frame.Size.Height - (SelectionIndicatorHeight * 4)),
                            BackgroundColor = VerticalDividerColor.CGColor
                        };
                        AddScrollViewSubLayer(verticalDividerLayer);
                    }

                    AddBackgroundAndBorderLayer(rectNew);
                }
            }
            else if (type == HMSegmentedControlType.TextAndImage)
            {
                for (int idx = 0; idx < sectionTitles.Count; idx++)
                {
                    var icon        = sectionImages[idx];
                    var imageWidth  = icon.Size.Width;
                    var imageHeight = icon.Size.Height;

                    var stringHeight = MeasureTitle(idx).Height;
                    var yOffset      = (float)Math.Round(((Frame.Height - SelectionIndicatorHeight) / 2) - (stringHeight / 2));

                    var imageXOffset = SegmentEdgeInset.Left;
                    var textXOffset  = SegmentEdgeInset.Left;
                    var textWidth    = (nfloat)0.0f;

                    if (segmentWidthStyle == HMSegmentedControlWidthStyle.Fixed)
                    {
                        imageXOffset = (segmentWidth * idx) + (segmentWidth / 2.0f) - (imageWidth / 2.0f);
                        textXOffset  = segmentWidth * idx;
                        textWidth    = segmentWidth;
                    }
                    else
                    {
                        var xOffset = 0.0f;
                        var i       = 0;
                        foreach (var width in segmentWidths)
                        {
                            if (idx == i)
                            {
                                break;
                            }
                            xOffset += width;
                            i++;
                        }

                        imageXOffset = xOffset + (segmentWidths[idx] / 2.0f) - (imageWidth / 2.0f);
                        textXOffset  = xOffset;
                        textWidth    = segmentWidths[idx];
                    }

                    var imageYOffset = (float)Math.Round((Frame.Height - SelectionIndicatorHeight) / 2.0f);
                    var imageRect    = new CGRect(imageXOffset, imageYOffset, imageWidth, imageHeight);
                    var textRect     = new CGRect((float)Math.Ceiling(textXOffset), (float)Math.Ceiling(yOffset), (float)Math.Ceiling(textWidth), (float)Math.Ceiling(stringHeight));

                    var titleLayer = new DisposableCATextLayer
                    {
                        Frame            = textRect,
                        AlignmentMode    = CATextLayer.AlignmentCenter,
                        AttributedString = AttributedTitle(idx),
                        TruncationMode   = CATextLayer.TruncantionEnd,
                        ContentsScale    = UIScreen.MainScreen.Scale
                    };

                    var imageLayer = new DisposableCALayer
                    {
                        Frame    = imageRect,
                        Contents = (SelectedIndex == idx && sectionSelectedImages != null) ? sectionSelectedImages[idx].CGImage : icon.CGImage
                    };

                    AddScrollViewSubLayer(imageLayer);
                    AddScrollViewSubLayer(titleLayer);

                    AddBackgroundAndBorderLayer(imageRect);
                }
            }

            if (SelectedIndex != -1)
            {
                if (SelectionStyle == HMSegmentedControlSelectionStyle.Arrow)
                {
                    SetArrowFrame();
                    AddScrollViewSubLayer(SelectionIndicatorArrowLayer);
                }
                else
                {
                    if (SelectionIndicatorStripLayer.SuperLayer == null)
                    {
                        SelectionIndicatorStripLayer.Frame = FrameForSelectionIndicator();
                        AddScrollViewSubLayer(SelectionIndicatorStripLayer);

                        if (SelectionStyle == HMSegmentedControlSelectionStyle.Box && SelectionIndicatorBoxLayer.SuperLayer == null)
                        {
                            SelectionIndicatorBoxLayer.Frame = FrameForFillerSelectionIndicator();
                            InsertScrollViewSubLayer(SelectionIndicatorBoxLayer, 0);
                        }
                    }
                }
            }
        }
Пример #20
0
 private PSStyle()
 {
     Formatting = new FormattingData();
     Foreground = new ForegroundColor();
     Background = new BackgroundColor();
 }
Пример #21
0
    public void ChangeColor(BackgroundColor color)
    {
        int toInt = (int)color;

        GetComponent <Image>().sprite = images[toInt];
    }
Пример #22
0
 internal void FromBackgroundColor(BackgroundColor clr)
 {
     this.SetAllNull();
     if (clr.Auto != null) this.Auto = clr.Auto.Value;
     if (clr.Indexed != null) this.Indexed = clr.Indexed.Value;
     if (clr.Rgb != null) this.Rgb = clr.Rgb.Value;
     if (clr.Theme != null) this.Theme = clr.Theme.Value;
     if (clr.Tint != null) this.Tint = clr.Tint.Value;
     this.SetDisplayColor();
 }
Пример #23
0
 /// <summary>
 /// Sends a message to a chat room.
 /// </summary>
 /// <param name="message">The message to send - can contain some HTML and must be valid XHTML.</param>
 /// <param name="from">The name of the sender - sets the From property.</param>
 /// <param name="color">Background color to use with the message</param>
 public void SendMessage(string message, string from, BackgroundColor color)
 {
     this.From = from;
     this.Color = color;
     SendMessage(message);
 }
Пример #24
0
        internal BackgroundColor ToBackgroundColor()
        {
            BackgroundColor clr = new BackgroundColor();
            if (this.Auto != null) clr.Auto = this.Auto.Value;
            if (this.Indexed != null) clr.Indexed = this.Indexed.Value;
            if (this.Rgb != null) clr.Rgb = new HexBinaryValue(this.Rgb);
            if (this.Theme != null) clr.Theme = this.Theme.Value;
            if (this.Tint != null && this.Tint.Value != 0.0) clr.Tint = this.Tint.Value;

            return clr;
        }
Пример #25
0
 /// <summary>
 /// Sends a message to a chat room.
 /// </summary>
 /// <param name="message">The message to send - can contain some HTML and must be valid XHTML.</param>
 /// <param name="color">Background color to use with the message</param>
 public void SendMessage(string message, BackgroundColor color)
 {
     this.Color = color;
     SendMessage(message);
 }
Пример #26
0
        public override string ToString()
        {
            switch (PatternType)
            {
            case XLFillPatternValues.None:
                return("None");

            case XLFillPatternValues.Solid:
                return(string.Concat("Solid ", BackgroundColor.ToString()));

            default:
                return(string.Concat(PatternType.ToString(), " pattern: ", PatternColor.ToString(), " on ", BackgroundColor.ToString()));
            }
        }
Пример #27
0
 public bool IrParaLixeiraCinza()
 {
     BackgroundColor.MudarCorDeFundo("O lixo foi jogado na lixeira cinza (Indefinido).", CoresEnum.CINZA);
     return(true);
 }
Пример #28
0
 public override int GetHashCode()
 {
     return(BackgroundColor.GetHashCode()
            ^ (Int32)PatternType
            ^ PatternColor.GetHashCode());
 }
Пример #29
0
            public DarkPreviewsOptions ToPreviewsOptions(bool keepChecksum)
            {
                var light = MathF.ToVector3Deg(Lightθ, Lightφ);

                return(new DarkPreviewsOptions {
                    AmbientDown = AmbientDownColor.ToColor(),
                    AmbientUp = AmbientUpColor.ToColor(),
                    BackgroundColor = BackgroundColor.ToColor(),
                    LightColor = LightColor.ToColor(),
                    UseMsaa = MsaaMode != 0,
                    MsaaSampleCount = MsaaMode,
                    SsaaMultiplier = Math.Sqrt(SsaaMode),
                    ShadowMapSize = ShadowMapSize,
                    Showroom = ShowroomId,
                    ColorGradingData = UseColorGrading ? ColorGradingData : null,
                    UseCustomReflectionCubemap = UseCustomReflectionCubemap,
                    CustomReflectionCubemapData = UseCustomReflectionCubemap ? CustomReflectionCubemapData : null,
                    CustomReflectionBrightness = CustomReflectionBrightness,
                    CubemapAmbient = CubemapAmbient,
                    CubemapAmbientWhite = CubemapAmbientWhite,
                    EnableShadows = EnableShadows,
                    AnyGround = AnyGround,
                    FlatMirror = FlatMirror,
                    UseBloom = UseBloom,
                    FlatMirrorBlurred = FlatMirrorBlurred,
                    FlatMirrorBlurMuiltiplier = FlatMirrorBlurMuiltiplier,
                    UseDither = UseDither,
                    UseColorGrading = UseColorGrading,
                    UseFxaa = UseFxaa,
                    UseSmaa = UseSmaa,
                    UsePcss = UsePcss,
                    UseAo = UseAo,
                    AoType = AoType,
                    UseSslr = UseSslr,
                    ToneMapping = ToneMapping,
                    ReflectionCubemapAtCamera = ReflectionCubemapAtCamera,
                    ReflectionsWithShadows = ReflectionsWithShadows,
                    ReflectionsWithMultipleLights = ReflectionsWithMultipleLights,
                    AmbientBrightness = AmbientBrightness,
                    BackgroundBrightness = BackgroundBrightness,
                    FlatMirrorReflectiveness = FlatMirrorReflectiveness,
                    FlatMirrorReflectedLight = FlatMirrorReflectedLight,
                    LightBrightness = LightBrightness,
                    LightDirection = new double[] { light.X, light.Y, light.Z },
                    MaterialsReflectiveness = MaterialsReflectiveness,
                    CarShadowsOpacity = CarShadowsOpacity,
                    ToneExposure = ToneExposure,
                    ToneGamma = ToneGamma,
                    ToneWhitePoint = ToneWhitePoint,
                    PcssSceneScale = PcssSceneScale,
                    PcssLightScale = PcssLightScale,
                    BloomRadiusMultiplier = BloomRadiusMultiplier,
                    AoOpacity = AoOpacity,
                    AoRadius = AoRadius,
                    UseDof = UseDof,
                    DofFocusPlane = DofFocusPlane,
                    DofScale = DofScale,
                    UseAccumulationDof = UseAccumulationDof,
                    AccumulationDofBokeh = AccumulationDofBokeh,
                    AccumulationDofIterations = AccumulationDofIterations,
                    AccumulationDofApertureSize = AccumulationDofApertureSize,
                    PreviewWidth = Width,
                    PreviewHeight = Height,
                    SoftwareDownsize = SoftwareDownsize,
                    AlignCar = AlignCar,
                    AlignCameraHorizontally = AlignCameraHorizontally,
                    AlignCameraVertically = AlignCameraVertically,
                    AlignCameraHorizontallyOffsetRelative = AlignCameraHorizontallyOffsetRelative,
                    AlignCameraVerticallyOffsetRelative = AlignCameraVerticallyOffsetRelative,
                    HeadlightsEnabled = HeadlightsEnabled,
                    BrakeLightsEnabled = BrakeLightsEnabled,
                    LeftDoorOpen = LeftDoorOpen,
                    RightDoorOpen = RightDoorOpen,
                    ShowDriver = ShowDriver,
                    CameraPosition = CameraPosition,
                    CameraLookAt = CameraLookAt,
                    CameraTilt = CameraTilt,
                    CameraFov = CameraFov,
                    AlignCameraHorizontallyOffset = AlignCameraHorizontallyOffset,
                    AlignCameraVerticallyOffset = AlignCameraVerticallyOffset,
                    SteerDeg = SteerDeg,
                    TryToGuessCarLights = TryToGuessCarLights,
                    LoadCarLights = LoadCarLights,
                    LoadShowroomLights = LoadShowroomLights,
                    DelayedConvertation = false,
                    MeshDebugMode = false,
                    SuspensionDebugMode = false,
                    PreviewName = FileName,
                    WireframeMode = false,
                    SerializedLights = ExtraLights != null ? new JArray(ExtraLights.OfType <object>()).ToString() : null,
                    ExtraActiveAnimations = ExtraActiveAnimations,
                    // FixedChecksum = keepChecksum ? Checksum : null
                });
            }
Пример #30
0
 public void AcceptPictureDescriptorBackgroundColor(BackgroundColor backgroundColor, PrintContext parameter)
 {
     parameter.WriteLine("Background Color: {0}", backgroundColor.Color);
 }
Пример #31
0
 public override int GetHashCode() =>
 (BackgroundColor?.GetHashCode() ?? 0) ^
 PhysicalSize.GetHashCode() ^
 Dpi.GetHashCode();
Пример #32
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //ITEMSVIEW
            case nameof(ItemsSource):
                return(ItemsSource.OfType <object>().Select(x => x.ToString()).Aggregate((x, y) => x + "," + y));

            //LISTVIEW
            case nameof(HasUnevenRows):
                return(HasUnevenRows.ToString());

            case nameof(IsGroupingEnabled):
                return(IsGroupingEnabled.ToString());

            case nameof(RowHeight):
                return(RowHeight.ToString());

            case nameof(Footer):
                return(Footer.ToString());

            case nameof(Header):
                return(Header.ToString());

            case nameof(IsPullToRefreshEnabled):
                return(IsPullToRefreshEnabled.ToString());

            case nameof(IsRefreshing):
                return(IsRefreshing.ToString());

            case nameof(SelectedItem):
                return(SelectedItem.ToString());

            case nameof(SeparatorColor):
                return(SeparatorColor.ToHex());

            case nameof(this.SeparatorVisibility):
                return(SeparatorVisibility.ToString());

            default:
                return(string.Empty);
            }
        }
Пример #33
0
        public GridFlat()
        {
            HorizontalOptions = LayoutOptions.FillAndExpand;
            VerticalOptions   = LayoutOptions.FillAndExpand;

            #region
            members = new Dictionary <string, Variable>
            {
                { "Width", new FVariable {
                      ongetvalue = () => new Gnumber(Width),
                      onsetvalue = (value) => { WidthRequest = Convert.ToDouble(value); return(0); }
                  } },
                { "Height", new FVariable
                  {
                      ongetvalue = () => new Gnumber(Height),
                      onsetvalue = (value) => { HeightRequest = Convert.ToDouble(value); return(0); }
                  } },
                { "Horizontal", new FVariable
                  {
                      ongetvalue = () => new Gstring(HorizontalOptions.ToString()),
                      onsetvalue = (value) => {
                          if (value.ToString() == "center")
                          {
                              HorizontalOptions = LayoutOptions.Center;
                          }
                          else if (value.ToString() == "left")
                          {
                              HorizontalOptions = LayoutOptions.Start;
                          }
                          else if (value.ToString() == "right")
                          {
                              HorizontalOptions = LayoutOptions.End;
                          }
                          else if (value.ToString() == "stretch")
                          {
                              HorizontalOptions = LayoutOptions.Fill;
                          }
                          return(0);
                      }
                  } },
                { "Vertical", new FVariable {
                      ongetvalue = () => new Gstring(VerticalOptions.ToString()),
                      onsetvalue = (value) =>
                      {
                          if (value.ToString() == "center")
                          {
                              VerticalOptions = LayoutOptions.Center;
                          }
                          else if (value.ToString() == "bottom")
                          {
                              VerticalOptions = LayoutOptions.End;
                          }
                          else if (value.ToString() == "stretch")
                          {
                              VerticalOptions = LayoutOptions.Fill;
                          }
                          else if (value.ToString() == "top")
                          {
                              VerticalOptions = LayoutOptions.Start;
                          }
                          return(0);
                      }
                  } },
                { "Margin", new FVariable {
                      ongetvalue = () => new Glist {
                          new Variable(Margin.Left), new Variable(Margin.Top), new Variable(Margin.Right), new Variable(Margin.Bottom)
                      },
                      onsetvalue = (value) =>
                      {
                          var list = value.IGetCSValue() as Glist;
                          Margin = new Thickness(
                              Convert.ToDouble(list[0].value), Convert.ToDouble(list[1].value), Convert.ToDouble(list[2].value), Convert.ToDouble(list[3].value)
                              );
                          return(0);
                      }
                  } },
                { "Visibility", new FVariable {
                      ongetvalue = () =>
                      {
                          string s = "null";
                          switch (IsVisible)
                          {
                          case true:
                              s = "visiable";
                              break;

                          case false:
                              s = "gone";
                              break;
                          }
                          return(new Gstring(s));
                      },
                      onsetvalue = (value) =>
                      {
                          if (value.ToString() == "gone")
                          {
                              IsVisible = false;
                          }
                          else if (value.ToString() == "hidden")
                          {
                              IsVisible = false;
                          }
                          else if (value.ToString() == "visible")
                          {
                              IsVisible = true;
                          }
                          return(0);
                      }
                  } },



                { "Background", new FVariable {
                      ongetvalue = () => new Gstring(BackgroundColor.ToString()),
                      onsetvalue = (value) =>
                      {
                          BackgroundColor = (Color) new ColorTypeConverter().ConvertFromInvariantString(value.ToString());
                          return(0);
                      }
                  } },

                { "Add", new Variable(new MFunction(add, this)) },
                { "AddRow", new Variable(new MFunction(addrow, this)) },
                { "AddColumn", new Variable(new MFunction(addcolume, this)) }
            };

            parent = new GTXAM.Control(this);
            #endregion
        }
Пример #34
0
        /// <summary>
        /// Save theme compatible with v1.5+
        /// </summary>
        /// <param name="dir"></param>
        public void SaveAsTheme(string dir)
        {
            XmlDocument doc   = new XmlDocument();
            XmlElement  root  = doc.CreateElement("ImageGlass"); //<ImageGlass>
            XmlElement  nType = doc.CreateElement("Theme");      //<Theme>

            XmlElement n = doc.CreateElement("Info");            // <Info>

            n.SetAttribute("name", name);
            n.SetAttribute("version", version);
            n.SetAttribute("author", author);
            n.SetAttribute("email", email);
            n.SetAttribute("website", website);
            n.SetAttribute("description", description);
            n.SetAttribute("type", "ImageGlass Theme Configuration");
            n.SetAttribute("compatibility", compatibility);
            n.SetAttribute("preview", Path.GetFileName(PreviewImage.Filename));
            nType.AppendChild(n);

            n = doc.CreateElement("main");// <main>
            n.SetAttribute("topbar", Path.GetFileName(ToolbarBackgroundImage.Filename));
            n.SetAttribute("topbarcolor", ToolbarBackgroundColor.ToArgb().ToString());
            n.SetAttribute("bottombar", Path.GetFileName(ThumbnailBackgroundImage.Filename));
            n.SetAttribute("bottombarcolor", ThumbnailBackgroundColor.ToArgb().ToString());
            n.SetAttribute("backcolor", BackgroundColor.ToArgb().ToString());
            n.SetAttribute("statuscolor", TextInfoColor.ToArgb().ToString());
            nType.AppendChild(n);

            n = doc.CreateElement("toolbar_icon");// <toolbar_icon>
            n.SetAttribute("back", Path.GetFileName(ToolbarIcons.ViewPreviousImage.Filename));
            n.SetAttribute("next", Path.GetFileName(ToolbarIcons.ViewNextImage.Filename));
            n.SetAttribute("leftrotate", Path.GetFileName(ToolbarIcons.RotateLeft.Filename));
            n.SetAttribute("rightrotate", Path.GetFileName(ToolbarIcons.RotateRight.Filename));
            n.SetAttribute("zoomin", Path.GetFileName(ToolbarIcons.ZoomIn.Filename));
            n.SetAttribute("zoomout", Path.GetFileName(ToolbarIcons.ZoomOut.Filename));
            n.SetAttribute("zoomlock", Path.GetFileName(ToolbarIcons.LockRatio.Filename));
            n.SetAttribute("scaletofit", Path.GetFileName(ToolbarIcons.ActualSize.Filename));
            n.SetAttribute("scaletowidth", Path.GetFileName(ToolbarIcons.ScaleToWidth.Filename));
            n.SetAttribute("scaletoheight", Path.GetFileName(ToolbarIcons.ScaleToHeight.Filename));
            n.SetAttribute("autosizewindow", Path.GetFileName(ToolbarIcons.AdjustWindowSize.Filename));
            n.SetAttribute("open", Path.GetFileName(ToolbarIcons.OpenFile.Filename));
            n.SetAttribute("refresh", Path.GetFileName(ToolbarIcons.Refresh.Filename));
            n.SetAttribute("gotoimage", Path.GetFileName(ToolbarIcons.GoToImage.Filename));
            n.SetAttribute("thumbnail", Path.GetFileName(ToolbarIcons.ThumbnailBar.Filename));
            n.SetAttribute("caro", Path.GetFileName(ToolbarIcons.CheckedBackground.Filename));
            n.SetAttribute("fullscreen", Path.GetFileName(ToolbarIcons.FullScreen.Filename));
            n.SetAttribute("slideshow", Path.GetFileName(ToolbarIcons.Slideshow.Filename));
            n.SetAttribute("convert", Path.GetFileName(ToolbarIcons.Convert.Filename));
            n.SetAttribute("print", Path.GetFileName(ToolbarIcons.Print.Filename));
            n.SetAttribute("uploadfb", Path.GetFileName(ToolbarIcons.Sharing.Filename));
            n.SetAttribute("extension", Path.GetFileName(ToolbarIcons.Plugins.Filename));
            n.SetAttribute("settings", Path.GetFileName(ToolbarIcons.Settings.Filename));
            n.SetAttribute("about", Path.GetFileName(ToolbarIcons.About.Filename));
            n.SetAttribute("menu", Path.GetFileName(ToolbarIcons.Menu.Filename));
            nType.AppendChild(n);

            root.AppendChild(nType);
            doc.AppendChild(root);

            //create temp directory of theme
            if (Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
            }

            doc.Save(Path.Combine(dir, "config.xml")); //save file
        }
Пример #35
0
        public bool Equals([AllowNull] XAxis other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return((Visible == other.Visible && Visible != null && other.Visible != null && Visible.Equals(other.Visible)) &&
                   (ShowSpikes == other.ShowSpikes && ShowSpikes != null && other.ShowSpikes != null && ShowSpikes.Equals(other.ShowSpikes)) &&
                   (SpikeSides == other.SpikeSides && SpikeSides != null && other.SpikeSides != null && SpikeSides.Equals(other.SpikeSides)) &&
                   (SpikeThickness == other.SpikeThickness && SpikeThickness != null && other.SpikeThickness != null && SpikeThickness.Equals(other.SpikeThickness)) &&
                   (SpikeColor == other.SpikeColor && SpikeColor != null && other.SpikeColor != null && SpikeColor.Equals(other.SpikeColor)) &&
                   (ShowBackground == other.ShowBackground && ShowBackground != null && other.ShowBackground != null && ShowBackground.Equals(other.ShowBackground)) &&
                   (BackgroundColor == other.BackgroundColor && BackgroundColor != null && other.BackgroundColor != null && BackgroundColor.Equals(other.BackgroundColor)) &&
                   (ShowAxesLabels == other.ShowAxesLabels && ShowAxesLabels != null && other.ShowAxesLabels != null && ShowAxesLabels.Equals(other.ShowAxesLabels)) &&
                   (Color == other.Color && Color != null && other.Color != null && Color.Equals(other.Color)) &&
                   (CategoryOrder == other.CategoryOrder && CategoryOrder != null && other.CategoryOrder != null && CategoryOrder.Equals(other.CategoryOrder)) &&
                   (Equals(CategoryArray, other.CategoryArray) || CategoryArray != null && other.CategoryArray != null && CategoryArray.SequenceEqual(other.CategoryArray)) &&
                   (Title == other.Title && Title != null && other.Title != null && Title.Equals(other.Title)) &&
                   (Type == other.Type && Type != null && other.Type != null && Type.Equals(other.Type)) &&
                   (AutoRange == other.AutoRange && AutoRange != null && other.AutoRange != null && AutoRange.Equals(other.AutoRange)) &&
                   (RangeMode == other.RangeMode && RangeMode != null && other.RangeMode != null && RangeMode.Equals(other.RangeMode)) &&
                   (Equals(Range, other.Range) || Range != null && other.Range != null && Range.SequenceEqual(other.Range)) &&
                   (TickMode == other.TickMode && TickMode != null && other.TickMode != null && TickMode.Equals(other.TickMode)) &&
                   (NTicks == other.NTicks && NTicks != null && other.NTicks != null && NTicks.Equals(other.NTicks)) &&
                   (Tick0 == other.Tick0 && Tick0 != null && other.Tick0 != null && Tick0.Equals(other.Tick0)) &&
                   (DTick == other.DTick && DTick != null && other.DTick != null && DTick.Equals(other.DTick)) &&
                   (Equals(TickVals, other.TickVals) || TickVals != null && other.TickVals != null && TickVals.SequenceEqual(other.TickVals)) &&
                   (Equals(TickText, other.TickText) || TickText != null && other.TickText != null && TickText.SequenceEqual(other.TickText)) &&
                   (Ticks == other.Ticks && Ticks != null && other.Ticks != null && Ticks.Equals(other.Ticks)) &&
                   (Mirror == other.Mirror && Mirror != null && other.Mirror != null && Mirror.Equals(other.Mirror)) &&
                   (TickleN == other.TickleN && TickleN != null && other.TickleN != null && TickleN.Equals(other.TickleN)) &&
                   (TickWidth == other.TickWidth && TickWidth != null && other.TickWidth != null && TickWidth.Equals(other.TickWidth)) &&
                   (TickColor == other.TickColor && TickColor != null && other.TickColor != null && TickColor.Equals(other.TickColor)) &&
                   (ShowTickLabels == other.ShowTickLabels && ShowTickLabels != null && other.ShowTickLabels != null && ShowTickLabels.Equals(other.ShowTickLabels)) &&
                   (TickFont == other.TickFont && TickFont != null && other.TickFont != null && TickFont.Equals(other.TickFont)) &&
                   (TickAngle == other.TickAngle && TickAngle != null && other.TickAngle != null && TickAngle.Equals(other.TickAngle)) &&
                   (TickPrefix == other.TickPrefix && TickPrefix != null && other.TickPrefix != null && TickPrefix.Equals(other.TickPrefix)) &&
                   (ShowTickPrefix == other.ShowTickPrefix && ShowTickPrefix != null && other.ShowTickPrefix != null && ShowTickPrefix.Equals(other.ShowTickPrefix)) &&
                   (TickSuffix == other.TickSuffix && TickSuffix != null && other.TickSuffix != null && TickSuffix.Equals(other.TickSuffix)) &&
                   (ShowTickSuffix == other.ShowTickSuffix && ShowTickSuffix != null && other.ShowTickSuffix != null && ShowTickSuffix.Equals(other.ShowTickSuffix)) &&
                   (ShowExponent == other.ShowExponent && ShowExponent != null && other.ShowExponent != null && ShowExponent.Equals(other.ShowExponent)) &&
                   (ExponentFormat == other.ExponentFormat && ExponentFormat != null && other.ExponentFormat != null && ExponentFormat.Equals(other.ExponentFormat)) &&
                   (SeparateThousands == other.SeparateThousands && SeparateThousands != null && other.SeparateThousands != null && SeparateThousands.Equals(other.SeparateThousands)) &&
                   (TickFormat == other.TickFormat && TickFormat != null && other.TickFormat != null && TickFormat.Equals(other.TickFormat)) &&
                   (Equals(TickFormatStops, other.TickFormatStops) || TickFormatStops != null && other.TickFormatStops != null && TickFormatStops.SequenceEqual(other.TickFormatStops)) &&
                   (HoverFormat == other.HoverFormat && HoverFormat != null && other.HoverFormat != null && HoverFormat.Equals(other.HoverFormat)) &&
                   (ShowLine == other.ShowLine && ShowLine != null && other.ShowLine != null && ShowLine.Equals(other.ShowLine)) &&
                   (LineColor == other.LineColor && LineColor != null && other.LineColor != null && LineColor.Equals(other.LineColor)) &&
                   (LineWidth == other.LineWidth && LineWidth != null && other.LineWidth != null && LineWidth.Equals(other.LineWidth)) &&
                   (ShowGrid == other.ShowGrid && ShowGrid != null && other.ShowGrid != null && ShowGrid.Equals(other.ShowGrid)) &&
                   (GridColor == other.GridColor && GridColor != null && other.GridColor != null && GridColor.Equals(other.GridColor)) &&
                   (GridWidth == other.GridWidth && GridWidth != null && other.GridWidth != null && GridWidth.Equals(other.GridWidth)) &&
                   (ZeroLine == other.ZeroLine && ZeroLine != null && other.ZeroLine != null && ZeroLine.Equals(other.ZeroLine)) &&
                   (ZeroLineColor == other.ZeroLineColor && ZeroLineColor != null && other.ZeroLineColor != null && ZeroLineColor.Equals(other.ZeroLineColor)) &&
                   (ZeroLineWidth == other.ZeroLineWidth && ZeroLineWidth != null && other.ZeroLineWidth != null && ZeroLineWidth.Equals(other.ZeroLineWidth)) &&
                   (Calendar == other.Calendar && Calendar != null && other.Calendar != null && Calendar.Equals(other.Calendar)) &&
                   (CategoryArraySrc == other.CategoryArraySrc && CategoryArraySrc != null && other.CategoryArraySrc != null && CategoryArraySrc.Equals(other.CategoryArraySrc)) &&
                   (TickValsSrc == other.TickValsSrc && TickValsSrc != null && other.TickValsSrc != null && TickValsSrc.Equals(other.TickValsSrc)) &&
                   (TickTextSrc == other.TickTextSrc && TickTextSrc != null && other.TickTextSrc != null && TickTextSrc.Equals(other.TickTextSrc)));
        }
Пример #36
0
        protected override void RenderEffect(int frame, IPixelFrameBuffer frameBuffer)
        {
            double level                = LevelCurve.GetValue(GetEffectTimeIntervalPosition(frame) * 100) / 100;
            double blendLevel           = BlendCurve.GetValue(GetEffectTimeIntervalPosition(frame) * 100) / 100;
            double backgroundLevelCurve = BackgroundLevelCurve.GetValue(GetEffectTimeIntervalPosition(frame) * 100) / 100;

            int   x, y, mod, b;
            float V;
            int   cycleLen        = frame * Speed;
            int   pixelsPerBranch = (int)(0.5 + (double)BufferHt / Branches);

            if (pixelsPerBranch == 0)
            {
                pixelsPerBranch = 1;
            }

            if (frame == _xLimit)
            {
                _treeWidth = 0;
                _xLimit   += BufferWi;
            }
            _treeWidth++;

            for (y = 0; y < BufferHt; y++)
            {
                for (x = 0; x < BufferWi; x++)
                {
                    mod = y % pixelsPerBranch;
                    if (mod == 0)
                    {
                        mod = pixelsPerBranch;
                    }
                    V = ToggleBlend                     //Fade between branches
                                                ? (float)(1 - (1.0 * mod / pixelsPerBranch) * (1 - blendLevel))
                                                : (float)((1.0 * mod / pixelsPerBranch) * (blendLevel));

                    HSV hsv = HSV.FromRGB(BackgroundColor.GetColorAt((GetEffectTimeIntervalPosition(frame) * 100) / 100));
                    hsv.V = backgroundLevelCurve * V;                     // we have now set the color for the background tree

                    //   $orig_rgbval=$rgb_val;
                    Branch = (int)((y - 1) / pixelsPerBranch);
                    if (_branchColor >= Colors.Count || Branch == 0)
                    {
                        _branchColor = 0;
                    }
                    _row = pixelsPerBranch - mod;                     // now row=0 is bottom of branch, row=1 is one above bottom
                    //  mod = which pixel we are in the branch
                    //	mod=1,row=pixels_per_branch-1   top picrl in branch
                    //	mod=2, second pixel down into branch
                    //	mod=pixels_per_branch,row=0  last pixel in branch
                    //
                    //	row = 0, the $p is in the bottom row of tree
                    //	row =1, the $p is in second row from bottom
                    b = (int)((cycleLen) / BufferWi) % Branches;                     // what branch we are on based on frame #
                    //
                    //	b = 0, we are on bottomow row of tree during frames 1 to BufferWi
                    //	b = 1, we are on second row from bottom, frames = BufferWi+1 to 2*BufferWi
                    //	b = 2, we are on third row from bottome, frames - 2*BufferWi+1 to 3*BufferWi

                    M = (x % 6);
                    // m=0, 1sr strand
                    // m=1, 2nd strand
                    // m=5, last strand in 6 strand pattern

                    switch (ColorType)
                    {
                    case TreeColorType.Twinkle:
                        _colorIdx = _random.Next(0, Colors.Count);
                        break;

                    case TreeColorType.AlternatePixel:
                        _colorIdx = (x % Colors.Count);
                        break;

                    case TreeColorType.Static:
                        _colorIdx = _branchColor;
                        break;

                    case TreeColorType.Alternate:
                        break;
                    }

                    switch (BranchDirection)
                    {
                    case TreeBranchDirection.UpRight:
                    case TreeBranchDirection.DownRight:
                    case TreeBranchDirection.UpLeft:
                    case TreeBranchDirection.DownLeft:
                        if (Branch <= b && x <= _treeWidth && (((_row == 3 && (M == 0 || M == 5)) || ((_row == 2 && (M == 1 || M == 4)) || ((_row == 1 && (M == 2 || M == 3)))))))
                        {
                            hsv = HSV.FromRGB(Colors[_colorIdx].GetColorAt((GetEffectTimeIntervalPosition(frame) * 100) / 100));
                        }
                        break;

                    case TreeBranchDirection.Up:
                    case TreeBranchDirection.Down:
                        if (Branch <= b &&
                            (((_row == 3 && (M == 0 || M == 5)) || ((_row == 2 && (M == 1 || M == 4)) || ((_row == 1 && (M == 2 || M == 3)))))))
                        {
                            hsv = HSV.FromRGB(Colors[_colorIdx].GetColorAt((GetEffectTimeIntervalPosition(frame) * 100) / 100));
                        }
                        break;

                    case TreeBranchDirection.Left:
                        if ((BufferWi - x) <= _treeWidth && (((_row == 3 && (M == 0 || M == 5)) || ((_row == 2 && (M == 1 || M == 4)) || ((_row == 1 && (M == 2 || M == 3)))))))
                        {
                            hsv = HSV.FromRGB(Colors[_colorIdx].GetColorAt((GetEffectTimeIntervalPosition(frame) * 100) / 100));
                        }
                        break;

                    case TreeBranchDirection.Alternate:
                        if (Branch % 2 != 0)
                        {
                            if ((BufferWi - x) <= _treeWidth && (((_row == 3 && (M == 0 || M == 5)) || ((_row == 2 && (M == 1 || M == 4)) || ((_row == 1 && (M == 2 || M == 3)))))))
                            {
                                hsv = HSV.FromRGB(Colors[_colorIdx].GetColorAt((GetEffectTimeIntervalPosition(frame) * 100) / 100));
                            }
                        }
                        else
                        {
                            if (x <= _treeWidth && (((_row == 3 && (M == 0 || M == 5)) || ((_row == 2 && (M == 1 || M == 4)) || ((_row == 1 && (M == 2 || M == 3)))))))
                            {
                                hsv = HSV.FromRGB(Colors[_colorIdx].GetColorAt((GetEffectTimeIntervalPosition(frame) * 100) / 100));
                            }
                        }
                        break;

                    case TreeBranchDirection.Right:
                        if (x <= _treeWidth && (((_row == 3 && (M == 0 || M == 5)) || ((_row == 2 && (M == 1 || M == 4)) || ((_row == 1 && (M == 2 || M == 3)))))))
                        {
                            hsv = HSV.FromRGB(Colors[_colorIdx].GetColorAt((GetEffectTimeIntervalPosition(frame) * 100) / 100));
                        }
                        break;

                    case TreeBranchDirection.None:
                        if (((((_row == 3 && (M == 0 || M == 5)) || ((_row == 2 && (M == 1 || M == 4)) || ((_row == 1 && (M == 2 || M == 3))))))))
                        {
                            hsv = HSV.FromRGB(Colors[_colorIdx].GetColorAt((GetEffectTimeIntervalPosition(frame) * 100) / 100));
                        }
                        break;
                    }

                    hsv.V = hsv.V * level;                   //adjusts overall intensity
                    switch (BranchDirection)
                    {
                    case TreeBranchDirection.Down:
                    case TreeBranchDirection.DownRight:
                        frameBuffer.SetPixel(x, BufferHt - y, hsv);
                        break;

                    case TreeBranchDirection.UpLeft:
                        frameBuffer.SetPixel(BufferWi - x, y, hsv);
                        break;

                    case TreeBranchDirection.DownLeft:
                        frameBuffer.SetPixel(BufferWi - x, BufferHt - y, hsv);
                        break;

                    default:
                        frameBuffer.SetPixel(x, y, hsv);
                        break;
                    }
                }
                _colorIdx = (Branch % Colors.Count);
            }
        }
Пример #37
0
 async void TappedItem(object sender, ItemTappedEventArgs e)
 {
     lvOverzicht.SelectedItem = BackgroundColor.Equals(Color.LightGreen);
     Navigation.InsertPageBefore(new Bestelling(), this);
     await Navigation.PopAsync();
 }
Пример #38
0
        StringBuilder PrepareFormattingString(StringBuilder _formattingString)
        {
            if (!ForegroundColor.IsDefault)
            {
                _formattingString.AppendFormat("color={0} ", ForegroundColor.ToString());
            }

            if (!BackgroundColor.IsDefault)
            {
                _formattingString.AppendFormat("backing_color={0} backing=on ", BackgroundColor.ToString());
            }

            if (!string.IsNullOrEmpty(FontFamily))
            {
                _formattingString.AppendFormat("font={0} ", FontFamily);
            }

            if (FontSize != -1)
            {
                _formattingString.AppendFormat("font_size={0} ", FontSize);
            }

            if ((FontAttributes & FontAttributes.bold) != 0)
            {
                _formattingString.Append("font_weight=Bold ");
            }
            else
            {
                // FontWeight is only available in case of FontAttributes.Bold is not used.
                switch (FontWeight)
                {
                case FontWeight.Bold:
                    _formattingString.Append("font_weight=Bold ");
                    break;

                case FontWeight.SemiBold:
                    _formattingString.Append("font_weight=SemiBold ");
                    break;

                case FontWeight.UltraBold:
                    _formattingString.Append("font_weight=UltraBold ");
                    break;

                case FontWeight.Black:
                    _formattingString.Append("font_weight=Black ");
                    break;

                case FontWeight.ExtraBlack:
                    _formattingString.Append("font_weight=ExtraBlack ");
                    break;

                case FontWeight.Book:
                    _formattingString.Append("font_weight=Book ");
                    break;

                case FontWeight.Light:
                    _formattingString.Append("font_weight=Light ");
                    break;

                case FontWeight.Medium:
                    _formattingString.Append("font_weight=Medium ");
                    break;

                case FontWeight.Normal:
                    _formattingString.Append("font_weight=Normal ");
                    break;

                case FontWeight.Thin:
                    _formattingString.Append("font_weight=Thin ");
                    break;

                case FontWeight.UltraLight:
                    _formattingString.Append("font_weight=UltraLight ");
                    break;
                }
            }

            if ((FontAttributes & FontAttributes.italic) != 0)
            {
                _formattingString.Append("font_style=italic ");
            }

            if (Underline)
            {
                _formattingString.AppendFormat("underline=on underline_color={0} ",
                                               ForegroundColor.IsDefault ? s_defaultLineColor.ToString() : ForegroundColor.ToString());
            }

            if (Strikethrough)
            {
                _formattingString.AppendFormat("strikethrough=on strikethrough_color={0} ",
                                               ForegroundColor.IsDefault ? s_defaultLineColor.ToString() : ForegroundColor.ToString());
            }

            switch (HorizontalTextAlignment)
            {
            case TextAlignment.Auto:
                _formattingString.Append("align=auto ");
                break;

            case TextAlignment.Start:
                _formattingString.Append("align=left ");
                break;

            case TextAlignment.End:
                _formattingString.Append("align=right ");
                break;

            case TextAlignment.Center:
                _formattingString.Append("align=center ");
                break;
            }

            switch (VerticalTextAlignment)
            {
            case TextAlignment.Auto:
            case TextAlignment.Start:
                _formattingString.Append("valign=top ");
                break;

            case TextAlignment.End:
                _formattingString.Append("valign=bottom ");
                break;

            case TextAlignment.Center:
                _formattingString.Append("valign=middle ");
                break;
            }

            switch (LineBreakMode)
            {
            case LineBreakMode.NoWrap:
                _formattingString.Append("wrap=none");
                break;

            case LineBreakMode.CharacterWrap:
                _formattingString.Append("wrap=char");
                break;

            case LineBreakMode.WordWrap:
                _formattingString.Append("wrap=word");
                break;

            case LineBreakMode.MixedWrap:
                _formattingString.Append("wrap=mixed");
                break;

            case LineBreakMode.HeadTruncation:
                _formattingString.Append("ellipsis=0.0");
                break;

            case LineBreakMode.MiddleTruncation:
                _formattingString.Append("ellipsis=0.5");
                break;

            case LineBreakMode.TailTruncation:
                _formattingString.Append("ellipsis=1.0");
                break;
            }

            return(_formattingString);
        }
Пример #39
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //INPUTVIEW
            case nameof(Keyboard):
                return(this.Keyboard.ToString());

            //EDITOR
            case nameof(FontAttributes):
                return(this.FontAttributes.ToString());

            case nameof(FontFamily):
                return(this.FontFamily);

            case nameof(FontSize):
                return(this.FontSize.ToString());

            case nameof(Text):
                return(this.Text);

            case nameof(TextColor):
                return(this.TextColor.ToHex());

            default:
                return(string.Empty);
            }
        }
Пример #40
0
        // Generates content of workbookStyles.
        private void GenerateWorkbookStylesContent(WorkbookStylesPart workbookStyles)
        {
            Stylesheet stylesheet1 = new Stylesheet(){ MCAttributes = new MarkupCompatibilityAttributes(){ Ignorable = "x14ac" }  };
            stylesheet1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            stylesheet1.AddNamespaceDeclaration("x14ac", "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac");

            NumberingFormats numberingFormats1 = new NumberingFormats(){ Count = (UInt32Value)1U };
            NumberingFormat numberingFormat1 = new NumberingFormat(){ NumberFormatId = (UInt32Value)43U, FormatCode = "_(* #,##0.00_);_(* \\(#,##0.00\\);_(* \"-\"??_);_(@_)" };

            numberingFormats1.Append(numberingFormat1);

            Fonts fonts1 = new Fonts(){ Count = (UInt32Value)4U, KnownFonts = true };

            Font font1 = new Font();
            FontSize fontSize1 = new FontSize(){ Val = 11D };
            Color color1 = new Color(){ Theme = (UInt32Value)1U };
            FontName fontName1 = new FontName(){ Val = "Calibri" };
            FontFamilyNumbering fontFamilyNumbering1 = new FontFamilyNumbering(){ Val = 2 };
            FontScheme fontScheme1 = new FontScheme(){ Val = FontSchemeValues.Minor };

            font1.Append(fontSize1);
            font1.Append(color1);
            font1.Append(fontName1);
            font1.Append(fontFamilyNumbering1);
            font1.Append(fontScheme1);

            Font font2 = new Font();
            Bold bold1 = new Bold();
            FontSize fontSize2 = new FontSize(){ Val = 11D };
            Color color2 = new Color(){ Theme = (UInt32Value)1U };
            FontName fontName2 = new FontName(){ Val = "Calibri" };
            FontFamilyNumbering fontFamilyNumbering2 = new FontFamilyNumbering(){ Val = 2 };
            FontScheme fontScheme2 = new FontScheme(){ Val = FontSchemeValues.Minor };

            font2.Append(bold1);
            font2.Append(fontSize2);
            font2.Append(color2);
            font2.Append(fontName2);
            font2.Append(fontFamilyNumbering2);
            font2.Append(fontScheme2);

            Font font3 = new Font();
            Bold bold2 = new Bold();
            Italic italic1 = new Italic();
            FontSize fontSize3 = new FontSize(){ Val = 11D };
            Color color3 = new Color(){ Rgb = "FFFF0000" };
            FontName fontName3 = new FontName(){ Val = "Calibri" };
            FontFamilyNumbering fontFamilyNumbering3 = new FontFamilyNumbering(){ Val = 2 };
            FontScheme fontScheme3 = new FontScheme(){ Val = FontSchemeValues.Minor };

            font3.Append(bold2);
            font3.Append(italic1);
            font3.Append(fontSize3);
            font3.Append(color3);
            font3.Append(fontName3);
            font3.Append(fontFamilyNumbering3);
            font3.Append(fontScheme3);

            Font font4 = new Font();
            Italic italic2 = new Italic();
            FontSize fontSize4 = new FontSize(){ Val = 11D };
            Color color4 = new Color(){ Rgb = "FFFF0000" };
            FontName fontName4 = new FontName(){ Val = "Calibri" };
            FontFamilyNumbering fontFamilyNumbering4 = new FontFamilyNumbering(){ Val = 2 };
            FontScheme fontScheme4 = new FontScheme(){ Val = FontSchemeValues.Minor };

            font4.Append(italic2);
            font4.Append(fontSize4);
            font4.Append(color4);
            font4.Append(fontName4);
            font4.Append(fontFamilyNumbering4);
            font4.Append(fontScheme4);

            fonts1.Append(font1);
            fonts1.Append(font2);
            fonts1.Append(font3);
            fonts1.Append(font4);

            Fills fills1 = new Fills(){ Count = (UInt32Value)4U };

            Fill fill1 = new Fill();
            PatternFill patternFill1 = new PatternFill(){ PatternType = PatternValues.None };

            fill1.Append(patternFill1);

            Fill fill2 = new Fill();
            PatternFill patternFill2 = new PatternFill(){ PatternType = PatternValues.Gray125 };

            fill2.Append(patternFill2);

            Fill fill3 = new Fill();

            PatternFill patternFill3 = new PatternFill(){ PatternType = PatternValues.Solid };
            ForegroundColor foregroundColor1 = new ForegroundColor(){ Theme = (UInt32Value)0U, Tint = -4.9989318521683403E-2D };
            BackgroundColor backgroundColor1 = new BackgroundColor(){ Indexed = (UInt32Value)64U };

            patternFill3.Append(foregroundColor1);
            patternFill3.Append(backgroundColor1);

            fill3.Append(patternFill3);

            Fill fill4 = new Fill();

            PatternFill patternFill4 = new PatternFill(){ PatternType = PatternValues.Solid };
            ForegroundColor foregroundColor2 = new ForegroundColor(){ Rgb = "FFFFFFCC" };
            BackgroundColor backgroundColor2 = new BackgroundColor(){ Indexed = (UInt32Value)64U };

            patternFill4.Append(foregroundColor2);
            patternFill4.Append(backgroundColor2);

            fill4.Append(patternFill4);

            fills1.Append(fill1);
            fills1.Append(fill2);
            fills1.Append(fill3);
            fills1.Append(fill4);

            Borders borders1 = new Borders(){ Count = (UInt32Value)2U };

            Border border1 = new Border();
            LeftBorder leftBorder1 = new LeftBorder();
            RightBorder rightBorder1 = new RightBorder();
            TopBorder topBorder1 = new TopBorder();
            BottomBorder bottomBorder1 = new BottomBorder();
            DiagonalBorder diagonalBorder1 = new DiagonalBorder();

            border1.Append(leftBorder1);
            border1.Append(rightBorder1);
            border1.Append(topBorder1);
            border1.Append(bottomBorder1);
            border1.Append(diagonalBorder1);

            Border border2 = new Border();
            LeftBorder leftBorder2 = new LeftBorder();
            RightBorder rightBorder2 = new RightBorder();

            TopBorder topBorder2 = new TopBorder(){ Style = BorderStyleValues.Thin };
            Color color5 = new Color(){ Indexed = (UInt32Value)64U };

            topBorder2.Append(color5);
            BottomBorder bottomBorder2 = new BottomBorder();
            DiagonalBorder diagonalBorder2 = new DiagonalBorder();

            border2.Append(leftBorder2);
            border2.Append(rightBorder2);
            border2.Append(topBorder2);
            border2.Append(bottomBorder2);
            border2.Append(diagonalBorder2);

            borders1.Append(border1);
            borders1.Append(border2);

            CellStyleFormats cellStyleFormats1 = new CellStyleFormats(){ Count = (UInt32Value)1U };
            CellFormat cellFormat1 = new CellFormat(){ NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U };

            cellStyleFormats1.Append(cellFormat1);

            CellFormats cellFormats1 = new CellFormats(){ Count = (UInt32Value)16U };
            CellFormat cellFormat2 = new CellFormat(){ NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U };

            CellFormat cellFormat3 = new CellFormat(){ NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)2U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true };
            Alignment alignment1 = new Alignment(){ Horizontal = HorizontalAlignmentValues.Center };

            cellFormat3.Append(alignment1);
            CellFormat cellFormat4 = new CellFormat(){ NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFill = true };

            CellFormat cellFormat5 = new CellFormat(){ NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true };
            Alignment alignment2 = new Alignment(){ Horizontal = HorizontalAlignmentValues.Left };

            cellFormat5.Append(alignment2);

            CellFormat cellFormat6 = new CellFormat(){ NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true };
            Alignment alignment3 = new Alignment(){ Horizontal = HorizontalAlignmentValues.Center };

            cellFormat6.Append(alignment3);

            CellFormat cellFormat7 = new CellFormat(){ NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)2U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true };
            Alignment alignment4 = new Alignment(){ Horizontal = HorizontalAlignmentValues.Center };

            cellFormat7.Append(alignment4);

            CellFormat cellFormat8 = new CellFormat(){ NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)2U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true };
            Alignment alignment5 = new Alignment(){ Horizontal = HorizontalAlignmentValues.Right };

            cellFormat8.Append(alignment5);

            CellFormat cellFormat9 = new CellFormat(){ NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyAlignment = true };
            Alignment alignment6 = new Alignment(){ Horizontal = HorizontalAlignmentValues.Left };

            cellFormat9.Append(alignment6);

            CellFormat cellFormat10 = new CellFormat(){ NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyAlignment = true };
            Alignment alignment7 = new Alignment(){ Horizontal = HorizontalAlignmentValues.Center };

            cellFormat10.Append(alignment7);

            CellFormat cellFormat11 = new CellFormat(){ NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)3U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true };
            Alignment alignment8 = new Alignment(){ Horizontal = HorizontalAlignmentValues.Center };

            cellFormat11.Append(alignment8);
            CellFormat cellFormat12 = new CellFormat(){ NumberFormatId = (UInt32Value)43U, FontId = (UInt32Value)2U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true };

            CellFormat cellFormat13 = new CellFormat(){ NumberFormatId = (UInt32Value)9U, FontId = (UInt32Value)0U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFill = true, ApplyAlignment = true };
            Alignment alignment9 = new Alignment(){ Horizontal = HorizontalAlignmentValues.Left };

            cellFormat13.Append(alignment9);

            CellFormat cellFormat14 = new CellFormat(){ NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyAlignment = true };
            Alignment alignment10 = new Alignment(){ Horizontal = HorizontalAlignmentValues.Center };

            cellFormat14.Append(alignment10);

            CellFormat cellFormat15 = new CellFormat(){ NumberFormatId = (UInt32Value)37U, FontId = (UInt32Value)2U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)1U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true };
            Alignment alignment11 = new Alignment(){ Horizontal = HorizontalAlignmentValues.Center };

            cellFormat15.Append(alignment11);
            CellFormat cellFormat16 = new CellFormat(){ NumberFormatId = (UInt32Value)43U, FontId = (UInt32Value)2U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)1U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true };
            CellFormat cellFormat17 = new CellFormat(){ NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)2U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)1U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true };

            cellFormats1.Append(cellFormat2);
            cellFormats1.Append(cellFormat3);
            cellFormats1.Append(cellFormat4);
            cellFormats1.Append(cellFormat5);
            cellFormats1.Append(cellFormat6);
            cellFormats1.Append(cellFormat7);
            cellFormats1.Append(cellFormat8);
            cellFormats1.Append(cellFormat9);
            cellFormats1.Append(cellFormat10);
            cellFormats1.Append(cellFormat11);
            cellFormats1.Append(cellFormat12);
            cellFormats1.Append(cellFormat13);
            cellFormats1.Append(cellFormat14);
            cellFormats1.Append(cellFormat15);
            cellFormats1.Append(cellFormat16);
            cellFormats1.Append(cellFormat17);

            CellStyles cellStyles1 = new CellStyles(){ Count = (UInt32Value)1U };
            CellStyle cellStyle1 = new CellStyle(){ Name = "Normal", FormatId = (UInt32Value)0U, BuiltinId = (UInt32Value)0U };

            cellStyles1.Append(cellStyle1);
            DifferentialFormats differentialFormats1 = new DifferentialFormats(){ Count = (UInt32Value)0U };
            TableStyles tableStyles1 = new TableStyles(){ Count = (UInt32Value)0U, DefaultTableStyle = "TableStyleMedium2", DefaultPivotStyle = "PivotStyleLight16" };

            StylesheetExtensionList stylesheetExtensionList1 = new StylesheetExtensionList();

            StylesheetExtension stylesheetExtension1 = new StylesheetExtension(){ Uri = "{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}" };
            stylesheetExtension1.AddNamespaceDeclaration("x14", "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");
            DocumentFormat.OpenXml.Office2010.Excel.SlicerStyles slicerStyles1 = new DocumentFormat.OpenXml.Office2010.Excel.SlicerStyles(){ DefaultSlicerStyle = "SlicerStyleLight1" };

            stylesheetExtension1.Append(slicerStyles1);

            //StylesheetExtension stylesheetExtension2 = new StylesheetExtension(){ Uri = "{9260A510-F301-46a8-8635-F512D64BE5F5}" };
            //stylesheetExtension2.AddNamespaceDeclaration("x15", "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main");
            //X15.TimelineStyles timelineStyles1 = new X15.TimelineStyles(){ DefaultTimelineStyle = "TimeSlicerStyleLight1" };

            //stylesheetExtension2.Append(timelineStyles1);

            stylesheetExtensionList1.Append(stylesheetExtension1);
            //stylesheetExtensionList1.Append(stylesheetExtension2);

            stylesheet1.Append(numberingFormats1);
            stylesheet1.Append(fonts1);
            stylesheet1.Append(fills1);
            stylesheet1.Append(borders1);
            stylesheet1.Append(cellStyleFormats1);
            stylesheet1.Append(cellFormats1);
            stylesheet1.Append(cellStyles1);
            stylesheet1.Append(differentialFormats1);
            stylesheet1.Append(tableStyles1);
            stylesheet1.Append(stylesheetExtensionList1);

            workbookStyles.Stylesheet = stylesheet1;
        }