Exemplo n.º 1
0
        private DeleteConfirmationDialog(string function, IReadOnlyCollection <string> dependentFunctions)
        {
            InitializeComponent();

            string message;

            if (dependentFunctions.Count > 1)
            {
                message = string.Format(CultureInfo.CurrentUICulture, AppUtilities.GetString("DeleteMessage"), function);
            }
            else
            {
                message = AppUtilities.GetString("DeleteSingleMessage", function, dependentFunctions.First());
            }

            Span span = (Span)XamlReader.Load(string.Format(CultureInfo.CurrentUICulture, SpanXaml, message));

            MessageBlock.Inlines.Add(span);

            if (dependentFunctions.Count > 1)
            {
                MessageBlock.Inlines.Add(new LineBreak());

                Run run = new Run()
                {
                    Text = "    " + string.Join("\r\n    ", dependentFunctions)
                };

                Bold functionList = new Bold();
                functionList.Inlines.Add(run);
                MessageBlock.Inlines.Add(functionList);
            }
        }
Exemplo n.º 2
0
        private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs args)
        {
            DataPackage package = args.Request.Data;

            package.Properties.ApplicationName = AppUtilities.GetString("AppName");
            package.Properties.Title           = AppUtilities.GetString("ShareTitle");
            package.SetDataProvider(StandardDataFormats.Bitmap, ProvideData);
        }
Exemplo n.º 3
0
        public async Task InitializeUserSessionAsync()
        {
            UserActivityChannel channel = UserActivityChannel.GetDefault();

            _activity = await channel.GetOrCreateUserActivityAsync(_sessionId);

            _activity.ActivationUri = new Uri($"quadrant-app:resume?{_sessionId}");
            _activity.VisualElements.DisplayText = AppUtilities.GetString("AppName");
            await _activity.SaveAsync();

            _session = _activity.CreateSession();
        }
Exemplo n.º 4
0
        private GraphPrinter(FunctionGraph graph)
        {
            _graph = graph;

            // Resources cannot be loaded from the print thread, so do it here.
            _title               = AppUtilities.GetString("PrintTaskTitle");
            _graphSizeOption     = AppUtilities.GetString(nameof(GraphSize));
            _fullPageItem        = AppUtilities.GetString(nameof(GraphSize.FullPage));
            _windowSizeItem      = AppUtilities.GetString(nameof(GraphSize.Window));
            _labelLocationOption = AppUtilities.GetString(nameof(LabelLocation));
            _noneItem            = AppUtilities.GetString(nameof(LabelLocation.None));
            _topLeftItem         = AppUtilities.GetString(nameof(LabelLocation.TopLeft));
            _topRightItem        = AppUtilities.GetString(nameof(LabelLocation.TopRight));
            _bottomLeftItem      = AppUtilities.GetString(nameof(LabelLocation.BottomLeft));
            _bottomRightItem     = AppUtilities.GetString(nameof(LabelLocation.BottomRight));

            _printDocument          = new CanvasPrintDocument();
            _printDocument.Preview += PrintDocument_Preview;
            _printDocument.Print   += PrintDocument_Print;
            _printDocument.PrintTaskOptionsChanged += PrintDocument_PrintTaskOptionsChanged;
        }
Exemplo n.º 5
0
 protected override string GetLocalizedControlTypeCore()
 => AppUtilities.GetString("GraphControlTypeName");