public RPCData(RPCPeer peer, RPCManager rpcManager, Serializer serializer) { Serializer = serializer; Peer = peer; RPCManager = rpcManager; Header = new RPCDataHeader(Serializer); Flags = RPCFlags.None; }
public RPCData(RPCPeer peer, RPCManager rpcManager, int localId, int remoteId, RPCDataType type, RPCFlags flags = RPCFlags.None) : this(peer, rpcManager) { Flags = flags; Header.CallType = type; Header.RemoteId = remoteId; Header.LocalId = localId; Header.Write(); }
public PackageLoader(string packageFolder, RPCManager rpcManager) { packageFolder = Path.GetFullPath(packageFolder); PackageFolder = packageFolder; RpcManager = rpcManager; availablePackages = new HashSet<PackageName>(); Init(); }
public ReferenceManager(RPCManager rpcManager) { referencesChanged = new HashSet<Reference>(); localIdToReference = new Dictionary<int, Reference>(); dataObjectToReference = new Dictionary<IObservableDataObject, Reference>(); subscriptionToReference = new Dictionary<Subscription, Reference>(); RPCManager = rpcManager; }
public void OnLoad(RPCManager rpcManager) { if(PaneManager != null) throw new Exception(); PaneManager = new PaneManager(); rpcManager.ServiceManager.GetCreateImplementation<IPaneManager>(PaneManager); Editor = new EditorBase(); Editor.Run(); }
public static void Main(string[] args) { var rpcManager = new RPCManager(new SessionRPCPeer(null), new PackageContextLoader()); packageManager = new PackageManager("Packages", rpcManager); packageManager.GetLoadPackage(new PackageName("EditorPackage.0.0.0")); while (true) { packageManager.UpdatePackages(); Thread.Sleep(1); } }
private void saveBtn_Click(object sender, RoutedEventArgs e) { //await WriteToFile(hostsText.Text); StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder; RPCManager RPC = new RPCManager(); RPC.Start(); CSilentInstallerRuntime NrsCopy = new CSilentInstallerRuntime(); bool didFinish = NrsCopy.NRSCopyFile(local.Path + "\\DataFolder\\hosts.txt", "C:\\Windows\\System32\\DRIVERS\\ETC\\HOSTS"); if (didFinish == bool.Parse("true")) { MessageBox.Show("Hosts file saved!", "Saved!", MessageBoxButton.OK); NavigationService.GoBack(); } else { MessageBox.Show("Could not save Hosts File....", "Uh-Oh!", MessageBoxButton.OK); } }
public PackageManager(string packageFolder, RPCManager rpcManager) { Packages = new Dictionary<PackageName, IPackage>(); packageLoader = new PackageLoader(packageFolder, rpcManager); }
public MockRPCPeer(RPCManager mgr) { manager = mgr; }
public Host() { ServiceManager = new RPCManager(); }
private RPCData(RPCPeer peer, RPCManager rpcManager) : this(peer, rpcManager, peer.CreateSerializer()) { }
internal DelegateCall(int id, RPCPeer peer, RPCManager rpcManager, int localId, int remoteId) { Id = id; Data = new RPCData(peer, rpcManager, localId, remoteId, RPCDataType.DelegateCall); Data.Serializer.WriteI32(id); }
internal Call(int id, int methodId, RPCPeer peer, RPCManager rpcManager, int localId, int remoteId) { Id = id; MethodId = methodId; Data = new RPCData(peer, rpcManager, localId, remoteId, RPCDataType.Call); Data.Serializer.WriteI32(id); Data.Serializer.WriteI32(methodId); if (remoteId == 0) { GlobalServiceId = rpcManager.ServiceManager.GetGlobalServiceId(localId); GlobalServiceId.Write(Data); } else { GlobalServiceId = default(GlobalServiceId); } }
private async void button_Click(object sender, RoutedEventArgs e) { try { progress.Items.Clear(); progress.Items.Add("Downloading config now...."); //progress.Items.Add("Downloading first hosts file..."); //string host1 = await GetString("https://adaway.org/hosts.txt"); //if (host1.Contains("Response status code")) //{ // host1 = ""; // progress.Items.Add("Error with first file..."); //} //progress.Items.Add("Downloading second hosts file..."); //string host2 = await GetString("https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"); //if (host2.Contains("Response status code")) //{ // host2 = ""; // progress.Items.Add("Error with second file..."); //} StringBuilder UserHosts = new StringBuilder(); StorageFolder userList = Windows.Storage.ApplicationData.Current.LocalFolder; int counter = 0; string line; // Read the file and display it line by line. System.IO.StreamReader file = new System.IO.StreamReader(userList.Path + "\\DataFolder\\userList.txt"); while ((line = file.ReadLine()) != null) { progress.Items.Add("Downloading " + line); string tempLines = await GetString(line); if (tempLines.Contains("Response status code")) { tempLines = ""; progress.Items.Add("Error encountered while downloading " + line); } UserHosts.Append(tempLines).AppendLine(); counter++; } file.Close(); await WriteToFile(UserHosts.ToString()); string readFile1 = await ReadFile(); StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder; //StorageFolder hosts = "C:\\Windows\\System32\\DRIVERS\\etc"; //NRSCopyFile(local.Path.ToString + "DataFolder\hosts.txt", "\Windows\System32\DRIVERS\etc\HOSTS"); //File.Copy(local.Path + "\\DataFolder\\hosts.txt", "C:\\Windows\\System32\\DRIVERS\\ETC\\HOSTS",true); RPCManager RPC = new RPCManager(); RPC.Start(); CSilentInstallerRuntime NrsCopy = new CSilentInstallerRuntime(); bool didFinish = NrsCopy.NRSCopyFile(local.Path + "\\DataFolder\\hosts.txt", "C:\\Windows\\System32\\DRIVERS\\ETC\\HOSTS"); if(didFinish == bool.Parse("true")) { String report = "Downloaded " + counter + " URLs"; progress.Items.Add(report); progress.Items.Add("FINISHED!"); } else { progress.Items.Add("ERROR while coping to HOSTS (Are you Interop/Cap Unlocked?)"); } //MessageBox.Show("Here is your new hosts file:" + Environment.NewLine + readFile1, "Finished", MessageBoxButton.OK); } catch (Exception ex) { MessageBox.Show(ex.Message, "ERROR",MessageBoxButton.OK); progress.Items.Add("Errors during compilation:"); progress.Items.Add(ex.Message); } }
private async void button4_Click(object sender, RoutedEventArgs e) { try { await WriteToFile("# Hosts reset by AdBlockerWP"); StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder; RPCManager RPC = new RPCManager(); RPC.Start(); CSilentInstallerRuntime NrsCopy = new CSilentInstallerRuntime(); bool didFinish = NrsCopy.NRSCopyFile(local.Path + "\\DataFolder\\hosts.txt", "C:\\Windows\\System32\\DRIVERS\\ETC\\HOSTS"); if (didFinish == bool.Parse("true")) { progress.Items.Add("Finished unblocking ads..."); } else { progress.Items.Add("Error writing to hosts file... (Are you interop-unlocked?)..."); } } catch { MessageBox.Show("You must be Interop-Unlocked with all Capabilities unlocked as well to use this app!", "Not unlocked!", MessageBoxButton.OK); } }
private void Awake() { Instance = this; }