Skip to content

Commit

Permalink
Merge pull request #172 from Asnivor/dev
Browse files Browse the repository at this point in the history
0.5.8.0 Release
  • Loading branch information
Asnivor authored Aug 11, 2017
2 parents 28a08bf + 70ac86d commit 3d843c9
Show file tree
Hide file tree
Showing 45 changed files with 1,908 additions and 394 deletions.
6 changes: 5 additions & 1 deletion MedLaunch/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@

<ResourceDictionary>


<!-- Groupbox styleing -->
<Style TargetType="GroupBox" BasedOn="{StaticResource MetroGroupBox}">

</Style>

<!-- NumericUpDown Styling -->
<Style x:Key="NoArrows" TargetType="{StaticResource MetroNumericUpDown}">
<Style.Triggers>
Expand Down
102 changes: 102 additions & 0 deletions MedLaunch/Classes/MednaNet/DiscordChannels.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Documents;

namespace MedLaunch.Classes.MednaNet
{
public class DiscordChannels
{
public List<DiscordChannel> Data { get; set; }
public int ActiveChannel { get; set; }

public DiscordChannels()
{
Data = new List<DiscordChannel>();

Data = new List<DiscordChannel>
{
new DiscordChannel()
{
ChannelId = 1,
ChannelName = "general",
Paragraph = new Paragraph()
},
new DiscordChannel()
{
ChannelId = 5,
ChannelName = "support",
Paragraph = new Paragraph()
},
new DiscordChannel()
{
ChannelId = 2,
ChannelName = "notifications",
Paragraph = new Paragraph()
},
new DiscordChannel()
{
ChannelId = 3,
ChannelName = "netplay",
Paragraph = new Paragraph()
},
new DiscordChannel()
{
ChannelId = 4,
ChannelName = "development",
Paragraph = new Paragraph()
},


};

/*
// temp data
for (int i = 1; i < 6; i++)
{
DiscordChannel d = new DiscordChannel();
d.ChannelId = i;
d.ChannelName = "Dynamic Channel " + i;
d.Paragraph = new Paragraph();
Data.Add(d);
}
*/
}

/// <summary>
/// Adds or Updates specific discord channel data
/// </summary>
/// <param name="id"></param>
/// <param name="name"></param>
/// <param name="paragraph"></param>
public void UpdateChannel(int id, string name, Paragraph paragraph)
{
var lookup = Data.Where(a => a.ChannelId == id).FirstOrDefault();

if (lookup == null)
{
// channel does not exist - add it to the collection
DiscordChannel dc = new DiscordChannel();
dc.ChannelId = id;
dc.ChannelName = name;
dc.Paragraph = new Paragraph();
Data.Add(dc);
}
else
{
// channel already exists - update the paragraph
lookup.ChannelName = name;
lookup.Paragraph = paragraph;
}
}
}

public class DiscordChannel
{
public int ChannelId { get; set; }
public string ChannelName { get; set; }
public Paragraph Paragraph { get; set; }
}
}
19 changes: 19 additions & 0 deletions MedLaunch/Classes/MednaNet/DiscordMessage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MedLaunch.Classes.MednaNet
{
public class DiscordMessage
{
public int messageId { get; set; }
public string code { get; set; }
public string message { get; set; }
public DateTime postedOn { get; set; }
public string name { get; set; }
public int channel { get; set; }
public int userId { get; set; }
}
}
137 changes: 137 additions & 0 deletions MedLaunch/Classes/MednaNet/DiscordUsers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MedLaunch.Classes.MednaNet
{
public class DiscordUsers
{
public List<DiscordUser> Users { get; set; }

public DiscordUsers()
{
Users = new List<DiscordUser>();

// temp data
Users = new List<DiscordUser>
{
new DiscordUser()
{
UserId = 1,
UserName = "D. Hicks",
clientType = ClientType.discord,
IsOnline = true
},
new DiscordUser()
{
UserId = 2,
UserName = "W. Hudson",
clientType = ClientType.medlaunch,
IsOnline = true
},
new DiscordUser()
{
UserId = 3,
UserName = "S. Gorman",
clientType = ClientType.discord,
IsOnline = true
},
new DiscordUser()
{
UserId = 4,
UserName = "J. Vasquez",
clientType = ClientType.medlaunch,
IsOnline = true
},
new DiscordUser()
{
UserId = 100,
UserName = "A. Apone",
clientType = ClientType.discord,
IsOnline = true
},
new DiscordUser()
{
UserId = 200,
UserName = "C. Ferro",
clientType = ClientType.medlaunch,
IsOnline = true
},
new DiscordUser()
{
UserId = 300,
UserName = "M. Drake",
clientType = ClientType.discord,
IsOnline = true
},
new DiscordUser()
{
UserId = 37,
UserName = "T. Crowe",
clientType = ClientType.medlaunch,
IsOnline = true
},
new DiscordUser()
{
UserId = 3004,
UserName = "T. Wierzbowski",
clientType = ClientType.discord,
IsOnline = true
},
new DiscordUser()
{
UserId = 375,
UserName = "R. Frost",
clientType = ClientType.medlaunch,
IsOnline = true
},
new DiscordUser()
{
UserId = 37543,
UserName = "D. Spunkmeyer",
clientType = ClientType.medlaunch,
IsOnline = true
},
};
}

public void UpdateUser(int userId, string userName, ClientType clientType, bool isOnline)
{
var lookup = Users.Where(a => a.UserId == userId).FirstOrDefault();

if (lookup == null)
{
// user does not exist - create
DiscordUser du = new DiscordUser();
du.UserId = userId;
du.UserName = userName;
du.clientType = clientType;
du.IsOnline = isOnline;
Users.Add(du);
}
else
{
// user already exists - update
lookup.UserName = userName;
lookup.clientType = clientType;
lookup.IsOnline = isOnline;
}
}
}

public class DiscordUser
{
public int UserId { get; set; }
public string UserName { get; set; }
public ClientType clientType { get; set; }
public bool IsOnline { get; set; }
}

public enum ClientType
{
medlaunch,
discord
}
}
Loading

0 comments on commit 3d843c9

Please sign in to comment.