Skip to content

Commit

Permalink
Removed auto column generation
Browse files Browse the repository at this point in the history
  • Loading branch information
MELVARDEV committed May 25, 2021
1 parent 27a1ea1 commit 93fcafa
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
29 changes: 28 additions & 1 deletion League Pass Manager/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,43 @@
mc:Ignorable="d"

Title="League Pass Manager" Height="306" Width="409" MinWidth="300" MinHeight="130" WindowStartupLocation="CenterScreen" Icon="/internet_lock_locked_padlock_password_secure_security_icon_127100.ico">
<mah:MetroWindow.Resources>

</mah:MetroWindow.Resources>

<Grid>
<Grid x:Name="mainGrid" >
<TabControl mah:HeaderedControlHelper.HeaderFontSize="16" mah:TabControlHelper.Underlined="TabPanel" Padding="0,2,0,0" Margin="-1,0,-1,0" >
<TabItem Header="Accounts" HorizontalAlignment="Center" Height="28" VerticalAlignment="Center" Width="79" Padding="6,2,6,2">
<Grid>
<Separator VerticalAlignment="Top" />
<Button Content="Fill" Margin="10,38,113,8" Click="Button_Click" RenderTransformOrigin="0.5,1" VerticalAlignment="Bottom" Height="40"/>
<DataGrid x:Name="datagrid1" Margin="0,0,0,59" AutoGenerateColumns="True" ItemsSource="{Binding Path=accounts, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" CellEditEnding="datagrid1_CellEditEnding" GridLinesVisibility="None" RowEditEnding="datagrid1_RowEditEnding" CurrentCellChanged="datagrid1_CurrentCellChanged" BorderBrush="Transparent" VerticalGridLinesBrush="#337E7E7E" HorizontalGridLinesBrush="#337E7E7E" HeadersVisibility="Column" Foreground="#E5FFFFFF" >
<DataGrid x:Name="datagrid1" Margin="0,0,0,59" AutoGenerateColumns="False" ItemsSource="{Binding Path=accounts, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" CellEditEnding="datagrid1_CellEditEnding" GridLinesVisibility="None" RowEditEnding="datagrid1_RowEditEnding" CurrentCellChanged="datagrid1_CurrentCellChanged" BorderBrush="Transparent" VerticalGridLinesBrush="#337E7E7E" HorizontalGridLinesBrush="#337E7E7E" HeadersVisibility="Column" Foreground="#E5FFFFFF" SelectionChanged="datagrid1_SelectionChanged" >

<DataGrid.Columns>

<DataGridTextColumn Header="Region"
x:Name="columnRegion"
Binding="{Binding Path=region}"
IsReadOnly="False">
</DataGridTextColumn>


<DataGridTextColumn Header="Login"
x:Name="columnUserName"
Binding="{Binding Path=userName}"
IsReadOnly="False">
</DataGridTextColumn>
<DataGridTextColumn Header="Password"
x:Name="columnPassword"
Binding="{Binding Path=password}"
IsReadOnly="False">
</DataGridTextColumn>
<DataGridTextColumn Header="Description"
x:Name="columnDescription"
Binding="{Binding Path=description}"
IsReadOnly="False">
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
<Button Content="Remove" HorizontalAlignment="Right" Margin="0,0,10,8" VerticalAlignment="Bottom" Height="40" Width="98" Click="Button_Click_1"/>
Expand Down
12 changes: 12 additions & 0 deletions League Pass Manager/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public class Settings
public class Account
{
public string region { get; set; }

public string description { get; set; }
public string userName { get; set; }
public string password { get; set; }
Expand All @@ -68,14 +69,20 @@ public class Account
public Settings settings = new Settings();

public List<Account> accounts = new List<Account>();




string password;

void saveAccounts(string password)
{
string jsonList = JsonConvert.SerializeObject(accounts);
string aeCiphertext = RijndaelEtM.Encrypt(jsonList, password, KeySize.Aes256);
try { File.WriteAllText(settings.filePath, aeCiphertext); }
#pragma warning disable CS0168 // Variable is declared but never used
catch(System.UnauthorizedAccessException ex)
#pragma warning restore CS0168 // Variable is declared but never used
{
MessageBox.Show("You dont have permission to write to " + settings.filePath + Environment.NewLine + "Change account file location in settings or launch the app as an administrator.");
}
Expand Down Expand Up @@ -296,5 +303,10 @@ private void passFileLocation_TextChanged(object sender, TextChangedEventArgs e)
{

}

private void datagrid1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{

}
}
}

0 comments on commit 93fcafa

Please sign in to comment.