Skip to content

Instantly share code, notes, and snippets.

View habibg1232191's full-sized avatar
💻
Work on AniJin

Luen habibg1232191

💻
Work on AniJin
View GitHub Profile
#ifndef UNICODE
#define UNICODE
#endif
#include <windows.h>
#include <string>
#include <iostream>
#include <filesystem>
std::wstring ExePath() {
HttpWebRequest checkedRequest = (HttpWebRequest) WebRequest.Create(remoteFilename);
HttpWebResponse checkedResponse = (HttpWebResponse) checkedRequest.GetResponse();
FileStream fs = new FileStream(localFilename, FileMode.OpenOrCreate);
request = (HttpWebRequest)WebRequest.Create(remoteFilename);
if (fs.Length < checkedResponse.ContentLength && fs.Length != 0)
{
request.Headers.Add("range", $"bytes={fs.Length}-");
}
Unhandled exception. System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at Avalonia.Controls.Presenters.ItemContainerSync.AddContainers(ItemsPresenterBase owner, Int32 index, IEnumerable items) in /_/src/Avalonia.Controls/Present
ers/ItemContainerSync.cs:line 89
at Avalonia.Controls.Presenters.ItemContainerSync.ItemsChanged(ItemsPresenterBase owner, IEnumerable items, NotifyCollectionChangedEventArgs e) in /_/src/Ava
lonia.Controls/Presenters/ItemContainerSync.cs:line 73
at Avalonia.Controls.Presenters.ItemVirtualizerNone.ItemsChanged(IEnumerable items, NotifyCollectionChangedEventArgs e) in /_/src/Avalonia.Controls/Presenter
s/ItemVirtualizerNone.cs:line 59
at Avalonia.Controls.Presenters.ItemsPresenterBase.set_Items(IEnumerable value) in /_/src/Avalonia.Controls/Presenters/ItemsPresenterBase.cs:line 72
at Avalonia.Controls.ItemsControl.ItemsChanged(AvaloniaPropertyChangedEventArgs
using System;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Interactivity;
namespace Switch_Wallparer.Views.Controls
{
public class MList : ListBox
{
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Switch_Wallparer.Views.Controls">
<Design.PreviewWith>
<controls:MList />
</Design.PreviewWith>
<Style Selector="controls|MList">
<!-- Set Defaults -->
<Setter Property="Template">
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Switch_Wallparer.Views.Controls">
<Design.PreviewWith>
<controls:MList />
</Design.PreviewWith>
<Style Selector="controls|MList">
<!-- Set Defaults -->
<Setter Property="Template">