Skip to content

Commit

Permalink
misc: 一些调整
Browse files Browse the repository at this point in the history
  • Loading branch information
MATRIX-feather committed Mar 4, 2024
1 parent 5df50d9 commit 64259af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 5 additions & 9 deletions M.DBus/DBusMgrNew.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,14 @@

namespace M.DBus;

#nullable enable

public partial class DBusMgrNew : CompositeDrawable
{
private Connection? currentConnection;
public ConnectionState ConnectionState { get; private set; } = ConnectionState.Disconnected;

private string targetUrl = Address.Session;

public string TargetURL
{
get => targetUrl;
set => targetUrl = value;
}
public string TargetUrl { get; set; } = Address.Session;

public DBusMgrNew()
{
Expand All @@ -46,7 +42,7 @@ public void StartConnect()
Disconnect();

this.cancellationTokenSource = new CancellationTokenSource();
currentConnection = new Connection(new ClientConnectionOptions(TargetURL)
currentConnection = new Connection(new ClientConnectionOptions(TargetUrl)
{
AutoConnect = false
});
Expand All @@ -63,7 +59,7 @@ private async Task startConnectTask()
if (currentConnection == null)
throw new NullDependencyException("Called StartConnect but DBusConnection is not ready!");

this.currentConnection = new Connection(TargetURL);
this.currentConnection = new Connection(TargetUrl);
this.ConnectionState = ConnectionState.Connecting;

// Await for connection to finish
Expand Down
2 changes: 2 additions & 0 deletions M.DBus/IMDBusObject.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Tmds.DBus;

#nullable enable

namespace M.DBus
{
public interface IMDBusObject : IDBusObject
Expand Down

0 comments on commit 64259af

Please sign in to comment.