Exemplo n.º 1
0
 public void Add(Element element, ulong time)
 {
     Console.WriteLine("ElementCollection:Add {0}", TimePrec.DecodeTime(time));
     var metadata = BitConverter.GetBytes(time);
     switch (element.ScheduleStyle)
     {
         case ElementScheduleStyle.FirstWins:
             _singles.MergeFirstWins(element, metadata);
             break;
         case ElementScheduleStyle.LastWins:
             _singles.MergeLastWins(element, metadata);
             break;
         case ElementScheduleStyle.Multiple:
             var elementRef = new ElementRef { Element = element, Metadata = metadata };
             _multiples.AddFirst(elementRef);
             break;
         default:
             Console.WriteLine("Warn:UNDEFINED");
             throw new NotImplementedException();
     }
 }
Exemplo n.º 2
0
 public Task <bool> Init(ElementRef elementRef, object componentRef)
 {
     return(JSRuntime.Current.InvokeAsync <bool>($"{BLAZORISE_NAMESPACE}.init", elementRef, new DotNetObjectRef(componentRef)));
 }
Exemplo n.º 3
0
 public Task <bool> ParentHasClass(ElementRef elementRef, string classaname)
 {
     return(runtime.InvokeAsync <bool>($"{BLAZORISE_NAMESPACE}.parentHasClass", elementRef, classaname));
 }
Exemplo n.º 4
0
 public Task <bool> Init(ElementRef elementRef, object componentRef)
 {
     return(runtime.InvokeAsync <bool>($"{BLAZORISE_NAMESPACE}.init", elementRef, DotNetObjectRef.Create(componentRef)));
 }
Exemplo n.º 5
0
 public Canvas2DContext(IJSRuntime jSRuntime, ElementRef canvasRef)
 {
     this.jSRuntime = jSRuntime;
     this.canvasRef = canvasRef;
 }
Exemplo n.º 6
0
 public async Task OpenAsync(ElementRef anchorElement)
 {
     await Js.InvokeAsync <object>("matBlazor.matMenu.open", Ref, anchorElement);
 }
Exemplo n.º 7
0
 public static Task CreateAutocomplete(this ElementRef input)
 {
     return(JSRuntime.Current.InvokeAsync <object>("jsLib.createAutocomplete", input));
 }
Exemplo n.º 8
0
 public Task FocusElement(ElementRef el)
 {
     return(JSRuntime.InvokeAsync <object>("blazorStrap.focusElement", el));
 }
Exemplo n.º 9
0
 public EditDescription ChangeElementRef(ElementRef elementRef)
 {
     return(ChangeProp(ImClone(this), im => im.ElementRef = elementRef));
 }
Exemplo n.º 10
0
 public EditDescription(IColumnCaption columnCaption, string auditLogParseString, ElementRef elementRef, object value)
 {
     ColumnCaption       = columnCaption;
     AuditLogParseString = auditLogParseString;
     ElementRef          = elementRef;
     Value = value;
 }
Exemplo n.º 11
0
 private static async Task <int> OpenReadAsync(ElementRef elementReference, int fileIndex)
 {
     return((int)await JSRuntime.Current.InvokeAsync <long>($"{nameof(FileReaderComponent)}.OpenRead", elementReference, fileIndex));
 }
Exemplo n.º 12
0
 public static async Task <FileInfo> GetFileInfoFromElement(ElementRef elementReference, int index)
 {
     return(Json.Deserialize <FileInfo>(await JSRuntime.Current.InvokeAsync <string>($"{nameof(FileReaderComponent)}.GetFileInfoFromElement", elementReference, index)));
     //return await JSRuntime.Current.InvokeAsync<FileInfo>($"{nameof(FileReaderComponent)}.GetFileInfoFromElement", elementReference, index);
 }
Exemplo n.º 13
0
 public static async Task <int> GetFileCount(ElementRef elementReference)
 {
     return((int)await JSRuntime.Current.InvokeAsync <long>($"{nameof(FileReaderComponent)}.GetFileCount", elementReference));
 }
Exemplo n.º 14
0
        public static async Task <Stream> OpenFileStream(ElementRef elementReference, int index, Action <long, int, long> logCallback = null)
        {
            var fileInfo = await GetFileInfoFromElement(elementReference, index);

            return(new InteropFileStream(await OpenReadAsync(elementReference, index), fileInfo.Size, logCallback));
        }
Exemplo n.º 15
0
 public MenuItemClickEventArgs(UIMouseEventArgs mouseEvent, string contextMenuId, string contextMenuTargetId, ElementRef menuItemElement, Item menuItem)
 {
     MouseEvent          = mouseEvent;
     ContextMenuId       = contextMenuId;
     ContextMenuTargetId = contextMenuTargetId;
     MenuItemElement     = menuItemElement;
     MenuItem            = menuItem;
 }
Exemplo n.º 16
0
 public Task <bool> Tooltip(string target, ElementRef tooltip, ElementRef arrow, string placement)
 {
     return(JSRuntime.InvokeAsync <bool>("blazorStrap.tooltip", target, tooltip, arrow, placement));
 }
 /// <summary>
 /// On unobserving an element, pass the element
 /// reference to the action(s).
 /// </summary>
 /// <param name="elementRef">The element to unobserve</param>
 public void Unobserve(ElementRef elementRef)
 {
     OnUnobserve?.Invoke(this.Id, elementRef);
 }
Exemplo n.º 18
0
 public HttpApiClientRequestBuilder(HttpClient httpClient, string uri, IUriHelper uriHelper, ElementRef elementRef = default(ElementRef))
 {
     _uri           = uri;
     this.uriHelper = uriHelper;
     _httpClient    = httpClient;
     _elementRef    = elementRef;
 }
Exemplo n.º 19
0
 public static Task <decimal> GetElementWidth(ElementRef element)
 {
     return(JSRuntime.Current.InvokeAsync <decimal>("JSInterop.Layout.getElementWidth", element));
 }
Exemplo n.º 20
0
 public static Task Focus(this ElementRef elementRef)
 {
     return(JSRuntime.Current.InvokeAsync <object>("jsLib.focusElement", elementRef));
 }
Exemplo n.º 21
0
 public static async Task ScrollIntoView(ElementRef element)
 {
     await JSRuntime.Current.InvokeAsync <bool>("JSInterop.Layout.scrollIntoView", element).ConfigureAwait(false);
 }
Exemplo n.º 22
0
 public static async Task Focus(ElementRef element)
 {
     await JSRuntime.Current.InvokeAsync <bool>("JSInterop.Layout.focus", element).ConfigureAwait(false);
 }
Exemplo n.º 23
0
 public static async Task Initialize(ElementRef editorElement, string initialValue, bool isReadOnly)
 {
     await JSRuntime.Current.InvokeAsync <bool>("JSInterop.Monaco.initialize", editorElement, initialValue, isReadOnly).ConfigureAwait(false);
 }
Exemplo n.º 24
0
 public Task <bool> SetTextValue(ElementRef elementRef, object value)
 {
     return(runtime.InvokeAsync <bool>($"{BLAZORISE_NAMESPACE}.setTextValue", elementRef, value));
 }
Exemplo n.º 25
0
 public static bool Popper(string target, string popper, ElementRef arrow, string placement)
 {
     return(RegisteredFunction.Invoke <bool>("BlazorStrap.BlazorStrapInterop.Popper", target, popper, arrow, placement));
 }
Exemplo n.º 26
0
 public Task <bool> RemoveClass(ElementRef elementRef, string classname)
 {
     return(runtime.InvokeAsync <bool>($"{BLAZORISE_NAMESPACE}.removeClass", elementRef, classname));
 }
Exemplo n.º 27
0
 public static bool Tooltip(string target, ElementRef tooltip, ElementRef arrow, string placement)
 {
     return(RegisteredFunction.Invoke <bool>("BlazorStrap.BlazorStrapInterop.Tooltip", target, tooltip, arrow, placement));
 }
Exemplo n.º 28
0
 /// <summary>
 /// Gets the fake file paths from input field.
 /// </summary>
 /// <param name="element">Input field.</param>
 /// <returns>Returns an array of paths.</returns>
 public Task <string[]> GetFilePaths(ElementRef element)
 {
     return(runtime.InvokeAsync <string[]>($"{BLAZORISE_NAMESPACE}.getFilePaths", element));
 }
Exemplo n.º 29
0
 public Task <bool> Popper(string target, string popper, ElementRef arrow, string placement)
 {
     return(JSRuntime.InvokeAsync <bool>("blazorStrap.popper", target, popper, arrow, placement));
 }
Exemplo n.º 30
0
 public Task <bool> ToggleClass(ElementRef elementId, string classname)
 {
     return(JSRuntime.Current.InvokeAsync <bool>($"{BLAZORISE_NAMESPACE}.toggleClass", elementId, classname));
 }
Exemplo n.º 31
0
        public Task AddEventListenerAsync <TEventArg>(string eventName, ElementRef elementRef, Action <TEventArg> eventCallback)
        {
            var jsCallback = new JsCallback(arg => eventCallback?.Invoke(arg.As <TEventArg>()));

            return(_jsRuntime.InvokeAsync <object>("dotnetify_blazor.addEventListener", eventName, elementRef, DotNetObjectRef.Create(jsCallback)));
        }