mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-01-25 01:25:37 -05:00
More UI updates
This commit is contained in:
@@ -1,38 +1,37 @@
|
||||
using System;
|
||||
|
||||
namespace FeedCenter
|
||||
namespace FeedCenter;
|
||||
|
||||
public partial class MainWindow
|
||||
{
|
||||
public partial class MainWindow
|
||||
private void HandleCommandLine(string commandLine)
|
||||
{
|
||||
private void HandleCommandLine(string commandLine)
|
||||
{
|
||||
// If the command line is blank then ignore it
|
||||
if (commandLine.Length == 0)
|
||||
return;
|
||||
// If the command line is blank then ignore it
|
||||
if (commandLine.Length == 0)
|
||||
return;
|
||||
|
||||
// Pad the command line with a trailing space just to be lazy in parsing
|
||||
commandLine += " ";
|
||||
// Pad the command line with a trailing space just to be lazy in parsing
|
||||
commandLine += " ";
|
||||
|
||||
// Look for the feed URL in the command line
|
||||
var startPosition = commandLine.IndexOf("feed://", StringComparison.Ordinal);
|
||||
// Look for the feed URL in the command line
|
||||
var startPosition = commandLine.IndexOf("feed://", StringComparison.Ordinal);
|
||||
|
||||
// If nothing was found then exit
|
||||
if (startPosition <= 0) return;
|
||||
// If nothing was found then exit
|
||||
if (startPosition <= 0) return;
|
||||
|
||||
// Advance past the protocol
|
||||
startPosition += 7;
|
||||
// Advance past the protocol
|
||||
startPosition += 7;
|
||||
|
||||
// Starting at the URL position look for the next space
|
||||
var endPosition = commandLine.IndexOf(" ", startPosition, StringComparison.Ordinal);
|
||||
// Starting at the URL position look for the next space
|
||||
var endPosition = commandLine.IndexOf(" ", startPosition, StringComparison.Ordinal);
|
||||
|
||||
// Extract the feed URL
|
||||
var feedUrl = commandLine[startPosition..endPosition];
|
||||
// Extract the feed URL
|
||||
var feedUrl = commandLine[startPosition..endPosition];
|
||||
|
||||
// Add the HTTP protocol by default
|
||||
feedUrl = "http://" + feedUrl;
|
||||
// Add the HTTP protocol by default
|
||||
feedUrl = "http://" + feedUrl;
|
||||
|
||||
// Create a new feed using the URL
|
||||
HandleNewFeed(feedUrl);
|
||||
}
|
||||
// Create a new feed using the URL
|
||||
HandleNewFeed(feedUrl);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user