Here are the examples of the csharp api System.Enum.Equals(object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
520 Examples
19
Source : QuotationUpdateParamsQuotationContents.cs
with MIT License
from freee
with MIT License
from freee
public bool Equals(QuotationUpdateParamsQuotationContents input)
{
if (input == null)
return false;
return
(
this.AccounreplacedemId == input.AccounreplacedemId ||
this.AccounreplacedemId.Equals(input.AccounreplacedemId)
) &&
(
this.Description == input.Description ||
(this.Description != null &&
this.Description.Equals(input.Description))
) &&
(
this.Id == input.Id ||
this.Id.Equals(input.Id)
) &&
(
this.ItemId == input.ItemId ||
this.ItemId.Equals(input.ItemId)
) &&
(
this.Order == input.Order ||
this.Order.Equals(input.Order)
) &&
(
this.Qty == input.Qty ||
this.Qty.Equals(input.Qty)
) &&
(
this.SectionId == input.SectionId ||
this.SectionId.Equals(input.SectionId)
) &&
(
this.Segment1TagId == input.Segment1TagId ||
this.Segment1TagId.Equals(input.Segment1TagId)
) &&
(
this.Segment2TagId == input.Segment2TagId ||
this.Segment2TagId.Equals(input.Segment2TagId)
) &&
(
this.Segment3TagId == input.Segment3TagId ||
this.Segment3TagId.Equals(input.Segment3TagId)
) &&
(
this.TagIds == input.TagIds ||
this.TagIds != null &&
input.TagIds != null &&
this.TagIds.SequenceEqual(input.TagIds)
) &&
(
this.TaxCode == input.TaxCode ||
this.TaxCode.Equals(input.TaxCode)
) &&
(
this.Type == input.Type ||
this.Type.Equals(input.Type)
) &&
(
this.Unit == input.Unit ||
(this.Unit != null &&
this.Unit.Equals(input.Unit))
) &&
(
this.UnitPrice == input.UnitPrice ||
this.UnitPrice.Equals(input.UnitPrice)
) &&
(
this.Vat == input.Vat ||
(this.Vat != null &&
this.Vat.Equals(input.Vat))
);
}
19
Source : Transfer.cs
with MIT License
from freee
with MIT License
from freee
public bool Equals(Transfer input)
{
if (input == null)
return false;
return
(
this.Amount == input.Amount ||
this.Amount.Equals(input.Amount)
) &&
(
this.CompanyId == input.CompanyId ||
this.CompanyId.Equals(input.CompanyId)
) &&
(
this.Date == input.Date ||
(this.Date != null &&
this.Date.Equals(input.Date))
) &&
(
this.Description == input.Description ||
(this.Description != null &&
this.Description.Equals(input.Description))
) &&
(
this.FromWalletableId == input.FromWalletableId ||
this.FromWalletableId.Equals(input.FromWalletableId)
) &&
(
this.FromWalletableType == input.FromWalletableType ||
this.FromWalletableType.Equals(input.FromWalletableType)
) &&
(
this.Id == input.Id ||
this.Id.Equals(input.Id)
) &&
(
this.ToWalletableId == input.ToWalletableId ||
this.ToWalletableId.Equals(input.ToWalletableId)
) &&
(
this.ToWalletableType == input.ToWalletableType ||
this.ToWalletableType.Equals(input.ToWalletableType)
);
}
19
Source : WalletableCreateResponseWalletable.cs
with MIT License
from freee
with MIT License
from freee
public bool Equals(WalletableCreateResponseWalletable input)
{
if (input == null)
return false;
return
(
this.BankId == input.BankId ||
this.BankId.Equals(input.BankId)
) &&
(
this.Id == input.Id ||
this.Id.Equals(input.Id)
) &&
(
this.Name == input.Name ||
(this.Name != null &&
this.Name.Equals(input.Name))
) &&
(
this.Type == input.Type ||
this.Type.Equals(input.Type)
);
}
19
Source : SelectablesIndexResponseAccountCategories.cs
with MIT License
from freee
with MIT License
from freee
public bool Equals(SelectablesIndexResponseAccountCategories input)
{
if (input == null)
return false;
return
(
this.Accounreplacedems == input.Accounreplacedems ||
this.Accounreplacedems != null &&
input.Accounreplacedems != null &&
this.Accounreplacedems.SequenceEqual(input.Accounreplacedems)
) &&
(
this.Balance == input.Balance ||
this.Balance.Equals(input.Balance)
) &&
(
this.Desc == input.Desc ||
(this.Desc != null &&
this.Desc.Equals(input.Desc))
) &&
(
this.OrgCode == input.OrgCode ||
this.OrgCode.Equals(input.OrgCode)
) &&
(
this.Role == input.Role ||
(this.Role != null &&
this.Role.Equals(input.Role))
) &&
(
this.replacedle == input.replacedle ||
(this.replacedle != null &&
this.replacedle.Equals(input.replacedle))
);
}
19
Source : WalletableCreateParams.cs
with MIT License
from freee
with MIT License
from freee
public bool Equals(WalletableCreateParams input)
{
if (input == null)
return false;
return
(
this.BankId == input.BankId ||
this.BankId.Equals(input.BankId)
) &&
(
this.CompanyId == input.CompanyId ||
this.CompanyId.Equals(input.CompanyId)
) &&
(
this.GroupName == input.GroupName ||
(this.GroupName != null &&
this.GroupName.Equals(input.GroupName))
) &&
(
this.Name == input.Name ||
(this.Name != null &&
this.Name.Equals(input.Name))
) &&
(
this.Type == input.Type ||
this.Type.Equals(input.Type)
);
}
19
Source : WalletTxn.cs
with MIT License
from freee
with MIT License
from freee
public bool Equals(WalletTxn input)
{
if (input == null)
return false;
return
(
this.Amount == input.Amount ||
this.Amount.Equals(input.Amount)
) &&
(
this.Balance == input.Balance ||
this.Balance.Equals(input.Balance)
) &&
(
this.CompanyId == input.CompanyId ||
this.CompanyId.Equals(input.CompanyId)
) &&
(
this.Date == input.Date ||
(this.Date != null &&
this.Date.Equals(input.Date))
) &&
(
this.Description == input.Description ||
(this.Description != null &&
this.Description.Equals(input.Description))
) &&
(
this.DueAmount == input.DueAmount ||
this.DueAmount.Equals(input.DueAmount)
) &&
(
this.EntrySide == input.EntrySide ||
this.EntrySide.Equals(input.EntrySide)
) &&
(
this.Id == input.Id ||
this.Id.Equals(input.Id)
) &&
(
this.Status == input.Status ||
this.Status.Equals(input.Status)
) &&
(
this.WalletableId == input.WalletableId ||
this.WalletableId.Equals(input.WalletableId)
) &&
(
this.WalletableType == input.WalletableType ||
this.WalletableType.Equals(input.WalletableType)
);
}
19
Source : WalletTxnParams.cs
with MIT License
from freee
with MIT License
from freee
public bool Equals(WalletTxnParams input)
{
if (input == null)
return false;
return
(
this.Amount == input.Amount ||
this.Amount.Equals(input.Amount)
) &&
(
this.Balance == input.Balance ||
this.Balance.Equals(input.Balance)
) &&
(
this.CompanyId == input.CompanyId ||
this.CompanyId.Equals(input.CompanyId)
) &&
(
this.Date == input.Date ||
(this.Date != null &&
this.Date.Equals(input.Date))
) &&
(
this.Description == input.Description ||
(this.Description != null &&
this.Description.Equals(input.Description))
) &&
(
this.EntrySide == input.EntrySide ||
this.EntrySide.Equals(input.EntrySide)
) &&
(
this.WalletableId == input.WalletableId ||
this.WalletableId.Equals(input.WalletableId)
) &&
(
this.WalletableType == input.WalletableType ||
this.WalletableType.Equals(input.WalletableType)
);
}
19
Source : Walletable.cs
with MIT License
from freee
with MIT License
from freee
public bool Equals(Walletable input)
{
if (input == null)
return false;
return
(
this.BankId == input.BankId ||
(this.BankId != null &&
this.BankId.Equals(input.BankId))
) &&
(
this.Id == input.Id ||
this.Id.Equals(input.Id)
) &&
(
this.LastBalance == input.LastBalance ||
this.LastBalance.Equals(input.LastBalance)
) &&
(
this.Name == input.Name ||
(this.Name != null &&
this.Name.Equals(input.Name))
) &&
(
this.Type == input.Type ||
this.Type.Equals(input.Type)
) &&
(
this.WalletableBalance == input.WalletableBalance ||
this.WalletableBalance.Equals(input.WalletableBalance)
);
}
19
Source : Extensions.cs
with MIT License
from fuse-open
with MIT License
from fuse-open
public static string ToLiteral(this Enum e)
{
return e.Equals(Enum.ToObject(e.GetType(), 0))
// Return empty string when value is 0
? ""
// Convert string to look better in disasm ('Public, Static' => 'public static')
: e.ToString().ToLower().Replace(", ", " ");
}
19
Source : FrmConfiguration.cs
with GNU Lesser General Public License v2.1
from Gannio
with GNU Lesser General Public License v2.1
from Gannio
private void BtnGenIVClick(object sender, EventArgs e)
{
switch (cbDistribution.SelectedIndex)
{
case 0: // individual
using (var ofd = new OpenFileDialog { Filter = Resources.PkmFilter, replacedle = Resources.SelectPkm })
if (ofd.ShowDialog().Equals(DialogResult.OK))
tbGenIVSend.Text = ofd.FileName;
break;
case 1: // folder
using (var fbd = new FolderBrowserDialog { Description = Resources.FolderDistribute })
if (fbd.ShowDialog(this).Equals(DialogResult.OK))
tbGenIVSend.Text = fbd.SelectedPath;
break;
}
}
19
Source : FrmConfiguration.cs
with GNU Lesser General Public License v2.1
from Gannio
with GNU Lesser General Public License v2.1
from Gannio
private void BtnGenVClick(object sender, EventArgs e)
{
switch (cbDistribution.SelectedIndex)
{
case 0: // individual
using (var ofd = new OpenFileDialog { Filter = Resources.PkmFilter, replacedle = Resources.SelectPkm })
if (ofd.ShowDialog().Equals(DialogResult.OK))
tbGenVSend.Text = ofd.FileName;
break;
case 1: // folder
using (var fbd = new FolderBrowserDialog { Description = Resources.FolderDistribute })
if (fbd.ShowDialog(this).Equals(DialogResult.OK))
tbGenVSend.Text = fbd.SelectedPath;
break;
}
}
19
Source : FrmConfiguration.cs
with GNU Lesser General Public License v2.1
from Gannio
with GNU Lesser General Public License v2.1
from Gannio
private void BtnGenIVGetClick(object sender, EventArgs e)
{
using (var fbd = new FolderBrowserDialog { Description = Resources.FolderSave })
if (fbd.ShowDialog(this).Equals(DialogResult.OK))
tbGenIVReceive.Text = fbd.SelectedPath;
}
19
Source : FrmConfiguration.cs
with GNU Lesser General Public License v2.1
from Gannio
with GNU Lesser General Public License v2.1
from Gannio
private void BtnGenVGetClick(object sender, EventArgs e)
{
using (var fbd = new FolderBrowserDialog { Description = Resources.FolderSave })
if (fbd.ShowDialog(this).Equals(DialogResult.OK))
tbGenVReceive.Text = fbd.SelectedPath;
}
19
Source : System_EnumWrap.cs
with MIT License
from GarfieldJiang
with MIT License
from GarfieldJiang
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int Equals(IntPtr L)
{
try
{
ToLua.CheckArgsCount(L, 2);
System.Enum obj = (System.Enum)ToLua.CheckObject(L, 1, typeof(System.Enum));
object arg0 = ToLua.ToVarObject(L, 2);
bool o = obj != null ? obj.Equals(arg0) : arg0 == null;
LuaDLL.lua_pushboolean(L, o);
return 1;
}
catch(Exception e)
{
return LuaDLL.toluaL_exception(L, e);
}
}
19
Source : Patcher.cs
with GNU General Public License v3.0
from geissbuehler
with GNU General Public License v3.0
from geissbuehler
public void StopTermService()
{
ServiceController sc = new ServiceController("TermService");
// Do not use sc.CanStop, it is also true when already stopping!
if (sc.Status.Equals(ServiceControllerStatus.Running))
{
sc.Stop();
try
{
sc.WaitForStatus(ServiceControllerStatus.Stopped, new TimeSpan(0, 0, ServiceTimeout));
}
catch (System.ServiceProcess.TimeoutException)
{
// Timeout when stopping TermService occured:
// This behaviour has been observed on some Windows 10 systems where the service remains in stopping state forever.
// This problem usually does not occur directly after a reboot. To handle this state, a workaround is applied:
// Kill the service process, wait for running state and try again.
int svcProcid = ServiceProcessId.GetServiceProcessId(sc);
if (svcProcid > -1)
{
Process.GetProcessById(svcProcid).Kill();
try
{
// The service is usually restarted after killing it
sc.WaitForStatus(ServiceControllerStatus.Running, new TimeSpan(0, 0, ServiceTimeout));
// Without a delay, the subsequent stop attempt might time out again (100 ms seems enough, 1000 ms adds some margin)
System.Threading.Thread.Sleep(1000);
}
catch (System.ServiceProcess.TimeoutException)
{
}
if (sc.Status.Equals(ServiceControllerStatus.Running))
{
sc.Stop();
try
{
// The second stop attempt usually succeeds
sc.WaitForStatus(ServiceControllerStatus.Stopped, new TimeSpan(0, 0, ServiceTimeout));
}
catch (System.ServiceProcess.TimeoutException)
{
}
}
}
}
}
if (!sc.Status.Equals(ServiceControllerStatus.Stopped))
{
throw new ServiceStopException();
}
}
19
Source : ActTableEditPage.xaml.cs
with Apache License 2.0
from Ginger-Automation
with Apache License 2.0
from Ginger-Automation
private void ColumnValue_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (eBaseWindow.Equals(BaseWindow.WindowExplorer))
{
UpdateRelatedActions();
SetDescriptionDetails();
}
}
19
Source : ActTableEditPage.xaml.cs
with Apache License 2.0
from Ginger-Automation
with Apache License 2.0
from Ginger-Automation
private void UpdateRelatedActions()
{
GingerCore.Actions.ActTableElement.eTableAction? previousSelectedControlAction = null;
if (mActions != null)
{
if (mActions.Currenreplacedem != null)
if (mActions.Currenreplacedem is ActTableElement)
previousSelectedControlAction = ((ActTableElement)mActions.Currenreplacedem).ControlAction;
mActions.Clear();
}
//This is just example to show the actions can change
// need to be per selected filter user did
if (cmbColSelectorValue.SelectedIndex != -1)
mAct.ColSelectorValue = (GingerCore.Actions.ActTableElement.eRunColSelectorValue)Enum.Parse(typeof(GingerCore.Actions.ActTableElement.eRunColSelectorValue), cmbColSelectorValue.SelectedValue.ToString());
string description = "";
string rowVal = "";
string colVal = "";
if (RowNum.IsChecked == true)
{
mAct.LocateRowType = "Row Number";
if (RowSelectorValue != null)
{
if (RowSelectorValue.SelectedIndex != -1)
rowVal = RowSelectorValue.SelectedItem.ToString();
else
rowVal = RowSelectorValue.Text;
description = " on Row:" + rowVal;
}
}
else if (AnyRow.IsChecked == true){
mAct.LocateRowType = "Any Row";
description = " on Random Row";
}
else if (BySelectedRow.IsChecked == true)
{
mAct.LocateRowType = "By Selected Row";
description = " on Selected Row";
}
else if (Where.IsChecked == true){
mAct.LocateRowType = "Where";
description = " on Row with condition";
}
if (cmbColumnValue != null)
{
if (cmbColumnValue.SelectedIndex != -1)
colVal = cmbColumnValue.SelectedItem.ToString();
else
colVal = cmbColumnValue.Text;
description= description + " and Column:" + colVal;
}
if (eBaseWindow.Equals(BaseWindow.WindowExplorer) &&cmbColSelectorValue.SelectedIndex != -1 && WhereColumn != null && WhereColumn.SelectedIndex != -1 && RowSelectorValue != null
&& WhereProperty != null && WhereProperty.SelectedIndex != -1 && WhereOperator != null && WhereOperator.SelectedIndex != -1)
{
// Add some sample for specific cell
mActions.Add(new ActTableElement() { Description = "Get Value of Cell:" + description,
ControlAction = ActTableElement.eTableAction.GetValue,
ColSelectorValue = mAct.ColSelectorValue,
LocateColreplacedle = colVal,
LocateRowType = mAct.LocateRowType,
LocateRowValue = rowVal,
ByRowNum = (bool)RowNum.IsChecked,
ByRandRow = (bool)AnyRow.IsChecked,
BySelectedRow = (bool)BySelectedRow.IsChecked,
ByWhere = (bool)Where.IsChecked,
WhereColSelector =(GingerCore.Actions.ActTableElement.eRunColSelectorValue)Enum.Parse(typeof(GingerCore.Actions.ActTableElement.eRunColSelectorValue), WhereColumn.SelectedValue.ToString()),
WhereColumnreplacedle = WhereColumnreplacedle.Text,
WhereColumnValue = WhereColumnValue.ValueTextBox.Text,
WhereOperator = (GingerCore.Actions.ActTableElement.eRunColOperator)Enum.Parse(typeof(GingerCore.Actions.ActTableElement.eRunColOperator), WhereOperator.SelectedValue.ToString()),
WhereProperty = (GingerCore.Actions.ActTableElement.eRunColPropertyValue)Enum.Parse(typeof(GingerCore.Actions.ActTableElement.eRunColPropertyValue), WhereProperty.SelectedValue.ToString())});
mActions.Add(new ActTableElement() { Description = "Set Value of Cell: " + description,
ControlAction = ActTableElement.eTableAction.SetValue,
ColSelectorValue = mAct.ColSelectorValue,
LocateColreplacedle = colVal,
LocateRowType = mAct.LocateRowType,
LocateRowValue = rowVal,
ByRowNum = (bool)RowNum.IsChecked,
ByRandRow = (bool)AnyRow.IsChecked,
BySelectedRow = (bool)BySelectedRow.IsChecked,
ByWhere = (bool)Where.IsChecked,
WhereColSelector =(GingerCore.Actions.ActTableElement.eRunColSelectorValue)Enum.Parse(typeof(GingerCore.Actions.ActTableElement.eRunColSelectorValue), WhereColumn.SelectedValue.ToString()),
WhereColumnreplacedle = WhereColumnreplacedle.Text,
WhereColumnValue = WhereColumnValue.ValueTextBox.Text,
WhereOperator = (GingerCore.Actions.ActTableElement.eRunColOperator)Enum.Parse(typeof(GingerCore.Actions.ActTableElement.eRunColOperator), WhereOperator.SelectedValue.ToString()),
WhereProperty = (GingerCore.Actions.ActTableElement.eRunColPropertyValue)Enum.Parse(typeof(GingerCore.Actions.ActTableElement.eRunColPropertyValue), WhereProperty.SelectedValue.ToString())});
mActions.Add(new ActTableElement() { Description = "Type Value in Cell: " + description,
ControlAction = ActTableElement.eTableAction.Type,
ColSelectorValue = mAct.ColSelectorValue,
LocateColreplacedle = colVal,
LocateRowType = mAct.LocateRowType,
LocateRowValue = rowVal,
ByRowNum = (bool)RowNum.IsChecked,
ByRandRow = (bool)AnyRow.IsChecked,
BySelectedRow = (bool)BySelectedRow.IsChecked,
ByWhere = (bool)Where.IsChecked,
WhereColSelector = (GingerCore.Actions.ActTableElement.eRunColSelectorValue)Enum.Parse(typeof(GingerCore.Actions.ActTableElement.eRunColSelectorValue), WhereColumn.SelectedValue.ToString()),
WhereColumnreplacedle = WhereColumnreplacedle.Text,
WhereColumnValue = WhereColumnValue.ValueTextBox.Text,
WhereOperator = (GingerCore.Actions.ActTableElement.eRunColOperator)Enum.Parse(typeof(GingerCore.Actions.ActTableElement.eRunColOperator), WhereOperator.SelectedValue.ToString()),
WhereProperty = (GingerCore.Actions.ActTableElement.eRunColPropertyValue)Enum.Parse(typeof(GingerCore.Actions.ActTableElement.eRunColPropertyValue), WhereProperty.SelectedValue.ToString())});
mActions.Add(new ActTableElement() { Description = "Click Cell:" + description,
ControlAction = ActTableElement.eTableAction.Click,
ColSelectorValue = mAct.ColSelectorValue,
LocateColreplacedle = colVal,
LocateRowType = mAct.LocateRowType,
LocateRowValue = rowVal,
ByRowNum = (bool)RowNum.IsChecked,
BySelectedRow = (bool)BySelectedRow.IsChecked,
ByRandRow = (bool)AnyRow.IsChecked,
ByWhere = (bool)Where.IsChecked,
WhereColSelector =(GingerCore.Actions.ActTableElement.eRunColSelectorValue)Enum.Parse(typeof(GingerCore.Actions.ActTableElement.eRunColSelectorValue), WhereColumn.SelectedValue.ToString()),
WhereColumnreplacedle = WhereColumnreplacedle.Text,
WhereColumnValue = WhereColumnValue.ValueTextBox.Text,
WhereOperator = (GingerCore.Actions.ActTableElement.eRunColOperator)Enum.Parse(typeof(GingerCore.Actions.ActTableElement.eRunColOperator), WhereOperator.SelectedValue.ToString()),
WhereProperty = (GingerCore.Actions.ActTableElement.eRunColPropertyValue)Enum.Parse(typeof(GingerCore.Actions.ActTableElement.eRunColPropertyValue), WhereProperty.SelectedValue.ToString())});
}
RestoreOriginalActions();
//try to select the action the user had selected before
if (previousSelectedControlAction != null)
{
if (mActions != null)
foreach (ActTableElement act in mActions)
if (act.ControlAction == previousSelectedControlAction)
{
mActions.Currenreplacedem = act;
break;
}
}
if (mActions != null && mActions.Currenreplacedem == null && mActions.Count > 0)
mActions.Currenreplacedem = mActions[0];
// Add unique actions for the selected filter/cell
}
19
Source : ActTableEditPage.xaml.cs
with Apache License 2.0
from Ginger-Automation
with Apache License 2.0
from Ginger-Automation
private void ColSelectorValue_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (eBaseWindow.Equals(BaseWindow.WindowExplorer))
{
cmbColumnValue.Items.Clear();
for (int i = 0; i < mColNames.Count; i++)
{
if (cmbColSelectorValue.SelectedValue.ToString() == ActTableElement.eRunColSelectorValue.Colreplacedle.ToString())
cmbColumnValue.Items.Add(mColNames[i].ToString());
else
cmbColumnValue.Items.Add(i.ToString());
}
cmbColumnValue.SelectedIndex = 0;
}
SetDescriptionDetails();
}
19
Source : ActTableEditPage.xaml.cs
with Apache License 2.0
from Ginger-Automation
with Apache License 2.0
from Ginger-Automation
private void RowSelectorValue_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
mAct.LocateRowValue = RowSelectorValue.Text;
SetDescriptionDetails();
if (eBaseWindow.Equals(BaseWindow.WindowExplorer))
{
UpdateRelatedActions();
}
}
19
Source : ActTableEditPage.xaml.cs
with Apache License 2.0
from Ginger-Automation
with Apache License 2.0
from Ginger-Automation
private void Row_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if(eBaseWindow.Equals(BaseWindow.WindowExplorer))
UpdateRelatedActions();
}
19
Source : ActTableEditPage.xaml.cs
with Apache License 2.0
from Ginger-Automation
with Apache License 2.0
from Ginger-Automation
private void ColumnValue_LostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (eBaseWindow.Equals(BaseWindow.ActEditPage))
{
UpdateRelatedActions();
SetDescriptionDetails();
}
}
19
Source : ActTableEditPage.xaml.cs
with Apache License 2.0
from Ginger-Automation
with Apache License 2.0
from Ginger-Automation
private void RowSelectorValue_LostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
mAct.LocateRowValue = RowSelectorValue.Text;
SetDescriptionDetails();
if (eBaseWindow.Equals(BaseWindow.WindowExplorer))
{
UpdateRelatedActions();
}
}
19
Source : ActTableEditPage.xaml.cs
with Apache License 2.0
from Ginger-Automation
with Apache License 2.0
from Ginger-Automation
private void WhereColumnreplacedle_LostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (eBaseWindow.Equals(BaseWindow.ActEditPage))
{
UpdateRelatedActions();
SetDescriptionDetails();
}
}
19
Source : ActTableEditPage.xaml.cs
with Apache License 2.0
from Ginger-Automation
with Apache License 2.0
from Ginger-Automation
private void WhereColumnValue_LostFocus(object sender, RoutedEventArgs e)
{
mAct.WhereColumnValue = WhereColumnValue.ValueTextBox.Text;
SetDescriptionDetails();
if (eBaseWindow.Equals(BaseWindow.WindowExplorer))
{
UpdateRelatedActions();
}
}
19
Source : ActGenElement.cs
with Apache License 2.0
from Ginger-Automation
with Apache License 2.0
from Ginger-Automation
private Act GetNewActionForJava()
{
if(GenElementAction.Equals(eGenElementAction.SwitchFrame) || GenElementAction.Equals(eGenElementAction.RunJavaScript))
{
ActBrowserElement NewActBrowserElement = GetNewBrowserElementFromAutoMapper();
if (GenElementAction.Equals(eGenElementAction.SwitchFrame))
{
NewActBrowserElement.ControlAction = ActBrowserElement.eControlAction.SwitchFrame;
}
else if (GenElementAction.Equals(eGenElementAction.RunJavaScript))
{
NewActBrowserElement.ControlAction = ActBrowserElement.eControlAction.RunJavaScript;
}
return NewActBrowserElement;
}
else
{
ActUIElement newActUIElement = GetNewUIElementFromAutoMapper();
newActUIElement.GetOrCreateInputParam(ActUIElement.Fields.IsWidgetsElement, "true");
newActUIElement.ElementLocateBy = this.LocateBy;
newActUIElement.ElementLocateValue = this.LocateValue;
newActUIElement.ElementAction = MapJavaGenericElementAction(GenElementAction);
newActUIElement.GetOrCreateInputParam(ActUIElement.Fields.ValueToSelect, this.Value);
if (this.ReturnValues.Count > 0)
{
if (this.ReturnValues[0].Param == "Actual")
{
newActUIElement.ReturnValues[0].Param = "Actual0";
}
}
return newActUIElement;
}
}
19
Source : LiteDB.cs
with Apache License 2.0
from Ginger-Automation
with Apache License 2.0
from Ginger-Automation
public override void SaveTable(DataTable dataTable)
{
if (isDeleteAllExecuted)
{
DeleteDBTableContents(dataTable.TableName);
dataTable.AcceptChanges();
}
using (LiteDatabase db = new LiteDatabase(FileFullPath))
{
dataTable.DefaultView.Sort = "GINGER_ID";
var table = db.GetCollection(dataTable.ToString());
var doc = BsonMapper.Global.ToDoreplacedent(table);
DataTable changed = dataTable.GetChanges();
DataTable dtChange = dataTable;
//if datatable is empty
if (dtChange.Rows.Count == 0 && changed == null)
{
return;
}
table.Delete(Query.All());
List<BsonDoreplacedent> batch = new List<BsonDoreplacedent>();
if ((dtChange != null))
{
foreach (DataRow dr in dtChange.Rows)
{
if (dr.RowState != DataRowState.Deleted)//Commit after row is deleted
{
if (dr.RowState.Equals(DataRowState.Added) || dr.RowState.Equals(DataRowState.Modified))
{
dr["GINGER_LAST_UPDATED_BY"] = System.Environment.UserName;
dr["GINGER_LAST_UPDATE_DATETIME"] = DateTime.Now.ToString();
}
if (dr["GINGER_ID"] != null || string.IsNullOrWhiteSpace((Convert.ToString(dr["GINGER_ID"]))))
{
dr["GINGER_ID"] = dtChange.Rows.IndexOf(dr) + 1;
}
var dictionary = dr.Table.Columns.Cast<DataColumn>().ToDictionary(col => col.ColumnName, col => dr[col.ColumnName]);
var mapper = new BsonMapper();
var sd = mapper.ToDoreplacedent(dictionary);
var nobj = mapper.ToObject<Dictionary<string, BsonValue>>(doc);
batch.Add(new BsonDoreplacedent(sd));
table.Upsert(batch);
}
}
}
dtChange.AcceptChanges();
var result = db.GetCollection(table.Name).Find(Query.All()).ToList();
if (dataTable.Rows.Count > result.Count)
{
table.Upsert(batch);
}
var rea = db.GetCollection(table.Name).Find(Query.All(), 0).ToList();
}
}
19
Source : ActValidation.cs
with Apache License 2.0
from Ginger-Automation
with Apache License 2.0
from Ginger-Automation
public override void Execute()
{
// in case of CS need to deferantionate failure reason compilation issue/ bool issue/false result and show info ontop act.exinfo
string csharpError = "";
CalculateCondition(this.RunOnBusinessFlow, RunOnEnvironment, this);
string rc = String.Empty;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && CalcEngineType.Equals(eCalcEngineType.VBS))
{
rc = VBS.ExecuteVBSEval(ConditionCalculated.Trim());
}
else
{
Boolean parsedValue;
rc = CodeProcessor.GetEvaluteResult(ConditionCalculated.Trim(), out csharpError);
if (Boolean.TryParse(rc.Trim(), out parsedValue))
{
if (parsedValue)
{
rc = "-1";
}
}
}
if (rc == "-1")
{
ConditionCalculated += " is True";
this.Status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Preplaceded;
this.ExInfo = ConditionCalculated;
}
else
{
ConditionCalculated += " is False";
this.Status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Failed;
this.Error = ConditionCalculated;
if(!string.IsNullOrEmpty(csharpError))
{
this.ExInfo = csharpError;
}
}
return;
}
19
Source : ActivityReport.cs
with Apache License 2.0
from Ginger-Automation
with Apache License 2.0
from Ginger-Automation
private int AddOnePercent(ActStatus actionsStatus)
{
double totalActPreplaceded = Math.Round((double)TotalActionsPreplaceded * 100 / ActionReports.Count, MidpointRounding.AwayFromZero);
if (actionsStatus.Equals(ActStatus.Other) && totalActPreplaceded > 0) return 0;
double totalActFailed = Math.Round((double)TotalActionsFailed * 100 / ActionReports.Count, MidpointRounding.AwayFromZero);
double totalActStopped = Math.Round((double)TotalActionsStopped * 100 / ActionReports.Count, MidpointRounding.AwayFromZero);
double totalActOther = Math.Round((double)TotalActionsOther * 100 / ActionReports.Count, MidpointRounding.AwayFromZero);
if ((totalActFailed + totalActPreplaceded + totalActStopped + totalActOther) == 99 && totalActPreplaceded != 0) return 1;
return 0;
}
19
Source : BusinessFlowReport.cs
with Apache License 2.0
from Ginger-Automation
with Apache License 2.0
from Ginger-Automation
private int AddOnePercent(ActStatus activitiesStatus)
{
double totalActPreplaceded = Math.Round((double)TotalActivitiesPreplaceded * 100 / Activities.Count, MidpointRounding.AwayFromZero);
if (activitiesStatus.Equals(ActStatus.Other) && totalActPreplaceded > 0) return 0;
double totalActFailed = Math.Round((double)TotalActivitiesFailed * 100 / Activities.Count, MidpointRounding.AwayFromZero);
double totalActStopped = Math.Round((double)TotalActivitiesStopped * 100 / Activities.Count, MidpointRounding.AwayFromZero);
double totalActOther = Math.Round((double)TotalActivitiesOther * 100 / Activities.Count, MidpointRounding.AwayFromZero);
if ((totalActFailed + totalActPreplaceded + totalActStopped + totalActOther) == 99 && totalActPreplaceded != 0) return 1;
return 0;
}
19
Source : SavePresetAsDialog.cs
with MIT License
from globalpolicy
with MIT License
from globalpolicy
private void textBoxPresetName_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode.Equals(Keys.Enter))
{
buttonOkSave.PerformClick();
}
else if (e.KeyCode.Equals(Keys.Escape))
{
buttonCancelSave.PerformClick();
}
}
19
Source : DesktopWindowManager.windows.cs
with MIT License
from glsorre
with MIT License
from glsorre
private void Windows_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.Action.Equals(NotifyCollectionChangedAction.Remove))
{
DesktopWindow desktopWindow = (DesktopWindow)e.OldItems[0];
Draw(desktopWindow.GetDesktopMonitor());
Changed.Invoke(this, "add");
}
else if (e.Action.Equals(NotifyCollectionChangedAction.Add))
{
DesktopWindow desktopWindow = (DesktopWindow)e.NewItems[0];
if (desktopWindow.GetDesktopMonitor().Item1.Equals(null) || desktopWindow.GetDesktopMonitor().Item2.Equals(null)) desktopWindow.GetInfo();
Draw(desktopWindow.GetDesktopMonitor());
Changed.Invoke(this, "remove");
}
}
19
Source : OptionPageGrid.cs
with Apache License 2.0
from googlestadia
with Apache License 2.0
from googlestadia
protected bool Equals(SdkIncompatibilityWarning other)
{
if (other == null)
{
return false;
}
if (!other.ShowOption.Equals(ShowOption) ||
other.SdkVersionPairsToHide.Count != SdkVersionPairsToHide.Count)
{
return false;
}
return other.SdkVersionPairsToHide.All(v => SdkVersionPairsToHide.Contains(v));
}
19
Source : SocketClient.cs
with Apache License 2.0
from grantcolley
with Apache License 2.0
from grantcolley
public async Task SendMessageAsync(Message message)
{
if (clientWebSocket.State.Equals(WebSocketState.Open))
{
var json = JsonConvert.SerializeObject(message);
var bytes = Encoding.UTF8.GetBytes(json);
await clientWebSocket.SendAsync(new ArraySegment<byte>(bytes), WebSocketMessageType.Text, true, CancellationToken.None).ConfigureAwait(false);
}
}
19
Source : SocketClient.cs
with Apache License 2.0
from grantcolley
with Apache License 2.0
from grantcolley
public async Task StopAsync()
{
if (clientWebSocket.State.Equals(WebSocketState.Open))
{
await clientWebSocket.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "", CancellationToken.None).ConfigureAwait(false);
}
}
19
Source : SocketMiddleware.cs
with Apache License 2.0
from grantcolley
with Apache License 2.0
from grantcolley
[System.Diagnostics.Codereplacedysis.SuppressMessage("Design", "CA1031:Do not catch general exception types")]
public async Task Invoke(HttpContext context)
{
if (context == null)
{
throw new ArgumentNullException(nameof(context));
}
try
{
if (context.WebSockets.IsWebSocketRequest)
{
var webSocket = await context.WebSockets.AcceptWebSocketAsync().ConfigureAwait(false);
var clientId = context.Request.Query["clientId"];
var data = context.Request.Query["data"];
await socketServer.OnClientConnectAsync(webSocket, clientId, data).ConfigureAwait(false);
await Receive(webSocket).ConfigureAwait(false);
}
else
{
context.Response.StatusCode = (int)HttpStatusCode.BadRequest;
}
}
catch (WebSocketException wsex) when (wsex.WebSocketErrorCode.Equals(WebSocketError.ConnectionClosedPrematurely))
{
// The remote party closed the WebSocket connection
// without completing the close handshake.
}
catch (Exception ex)
{
var response = context.Response;
response.Clear();
response.ContentType = "application/json";
response.StatusCode = (int)HttpStatusCode.InternalServerError;
await response.WriteAsync(JsonConvert.SerializeObject(ex)).ConfigureAwait(false);
}
}
19
Source : SocketMiddleware.cs
with Apache License 2.0
from grantcolley
with Apache License 2.0
from grantcolley
private async Task Receive(WebSocket webSocket)
{
try
{
var buffer = new byte[1024 * 4];
var messageBuilder = new StringBuilder();
while (webSocket.State.Equals(WebSocketState.Open))
{
WebSocketReceiveResult webSocketReceiveResult;
messageBuilder.Clear();
do
{
webSocketReceiveResult = await webSocket.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None).ConfigureAwait(false);
if (webSocketReceiveResult.MessageType.Equals(WebSocketMessageType.Close))
{
await socketServer.OnClientDisonnectAsync(webSocket).ConfigureAwait(false);
continue;
}
if (webSocketReceiveResult.MessageType.Equals(WebSocketMessageType.Text))
{
messageBuilder.Append(Encoding.UTF8.GetString(buffer, 0, webSocketReceiveResult.Count));
continue;
}
}
while (!webSocketReceiveResult.EndOfMessage);
if (messageBuilder.Length > 0)
{
var json = messageBuilder.ToString();
var message = JsonConvert.DeserializeObject<Message>(json);
await socketServer.ReceiveAsync(webSocket, message).ConfigureAwait(false);
}
}
}
finally
{
webSocket?.Dispose();
}
}
19
Source : SocketClient.cs
with Apache License 2.0
from grantcolley
with Apache License 2.0
from grantcolley
private async Task Receiving()
{
var buffer = new byte[1024 * 4];
var messageBuilder = new StringBuilder();
while (clientWebSocket.State.Equals(WebSocketState.Open))
{
WebSocketReceiveResult webSocketReceiveResult;
messageBuilder.Clear();
do
{
try
{
webSocketReceiveResult = await clientWebSocket.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None).ConfigureAwait(false);
}
catch (WebSocketException)
{
if (clientWebSocket.State.Equals(WebSocketState.Aborted))
{
break;
}
throw;
}
if (webSocketReceiveResult.MessageType == WebSocketMessageType.Close)
{
await clientWebSocket.CloseOutputAsync(WebSocketCloseStatus.NormalClosure, "", CancellationToken.None).ConfigureAwait(false);
OnClose();
break;
}
else if (webSocketReceiveResult.MessageType.Equals(WebSocketMessageType.Text))
{
messageBuilder.Append(Encoding.UTF8.GetString(buffer, 0, webSocketReceiveResult.Count));
}
}
while (!webSocketReceiveResult.EndOfMessage);
if(messageBuilder.Length > 0)
{
var json = messageBuilder.ToString();
var message = JsonConvert.DeserializeObject<Message>(json);
if (registeredMethods.TryGetValue(message.MethodName, out Action<Message> method))
{
method.Invoke(message);
}
}
}
}
19
Source : SocketServer.cs
with Apache License 2.0
from grantcolley
with Apache License 2.0
from grantcolley
public static async Task SendMessageAsync(WebSocket webSocket, string message)
{
if(webSocket == null)
{
throw new ArgumentNullException(nameof(webSocket));
}
if (message == null)
{
throw new ArgumentNullException(nameof(message));
}
if (!webSocket.State.Equals(WebSocketState.Open))
{
return;
}
await webSocket.SendAsync(
new ArraySegment<byte>(Encoding.UTF8.GetBytes(message), 0, message.Length),
WebSocketMessageType.Text, true, CancellationToken.None)
.ConfigureAwait(false);
}
19
Source : Enum.cs
with MIT License
from GrapeCity
with MIT License
from GrapeCity
public static string GetName(Type enumType, object value)
{
if (enumType == null)
throw new ArgumentNullException("enumType");
if (value == null)
throw new ArgumentNullException("value");
if (!enumType.IsEnum)
throw new ArgumentException("enumType is not an Enum type.");
Type vType = value.GetType();
if (vType != enumType && vType != enumType.UnderlyingSystemType)
throw new ArgumentException("value is not a value of given enum");
EnumInfo info = enumType.EnumInfo;
if (info == null)
throw new ArgumentException("enumInfo is null");
int n = info.values.Length;
for (int i = 0; i < n; ++i)
{
if (Equals(info.values[i], value))
return info.names[i];
}
return null;
}
19
Source : Enum.cs
with MIT License
from GrapeCity
with MIT License
from GrapeCity
public static bool IsDefined(Type enumType, object value)
{
if (enumType == null)
throw new ArgumentNullException("enumType");
if (value == null)
throw new ArgumentNullException("value");
if (!enumType.IsEnum)
throw new ArgumentException("enumType is not an Enum type.");
EnumInfo info = enumType.EnumInfo;
if (info == null)
throw new ArgumentException("enumInfo is null");
Type vType = value.GetType();
if (vType == typeof(String))
{
return ((IList)(info.names)).Contains(value);
}
if ((vType.index == enumType.utype) || (vType == enumType))
{
value = ToObject(enumType, value);
int n = info.values.Length;
for (int i = 0; i < n; ++i)
{
if (Equals(info.values[i], value))
return true;
}
return false;
}
else
{
throw new ArgumentException("The value parameter is not the correct type."
+ "It must be type String or the same type as the underlying type"
+ "of the Enum.");
}
}
19
Source : Enum.cs
with MIT License
from GrapeCity
with MIT License
from GrapeCity
public override bool Equals(object o)
{
object v = GetValue();
if (Equals(v, o)) return true;
Enum e = o as Enum;
if (e == null) return false;
if (e.GetType() != GetType()) return false;
return Equals(v, e.GetValue());
}
19
Source : Objective.cs
with Apache License 2.0
from graphhopper
with Apache License 2.0
from graphhopper
public bool Equals(Objective input)
{
if (input == null)
return false;
return
(
this.Type == input.Type ||
(this.Type != null &&
this.Type.Equals(input.Type))
) &&
(
this.Value == input.Value ||
(this.Value != null &&
this.Value.Equals(input.Value))
);
}
19
Source : ResourceMonitorTests.cs
with MIT License
from Greentube
with MIT License
from Greentube
[Fact]
public void Verify_ResourceStateUp_LoggedAsTrace()
{
_fixture.IsCritical = false;
_fixture.HealthCheckStrategy.Check(Arg.Any<CancellationToken>()).Returns(Task.FromResult(true));
using (var sut = _fixture.GetSut())
{
sut.Verify();
replacedert.Equal(1, _fixture.Logger.ReceivedCalls()
.Select(call => call.GetArguments())
.Count(callArguments => ((LogLevel)callArguments[0]).Equals(LogLevel.Trace)));
}
}
19
Source : Token.cs
with MIT License
from GridProtectionAlliance
with MIT License
from GridProtectionAlliance
public bool Equals(Value other)
{
if (other == null)
{
return false;
}
return Tag.Equals(other.Tag) && Text.Equals(other.Text);
}
19
Source : FormArcPluginManager.cs
with MIT License
from HardstuckGuild
with MIT License
from HardstuckGuild
private async void ButtonChangeGW2Location_Click(object sender, EventArgs e)
{
using (var dialog = new OpenFileDialog())
{
dialog.Filter = "Guild Wars 2|Gw2-64.exe;Gw2.exe;Guild Wars 2.exe";
var result = dialog.ShowDialog();
if (result.Equals(DialogResult.OK) && !string.IsNullOrWhiteSpace(dialog.FileName))
{
var location = Path.GetDirectoryName(dialog.FileName);
ApplicationSettings.Current.GW2Location = location;
ApplicationSettings.Current.Save();
if (ArcDpsComponent.All.Where(x => x.Type.Equals(ArcDpsComponentType.ArcDps) && x.RenderMode.Equals(ApplicationSettings.Current.ArcUpdate.RenderMode)).Any())
{
var component = ArcDpsComponent.All.Where(x => x.Type.Equals(ArcDpsComponentType.ArcDps) && x.RenderMode.Equals(ApplicationSettings.Current.ArcUpdate.RenderMode)).First();
if (!component.IsInstalled())
{
await component.DownloadComponent(httpController);
ArcDpsComponent.All.Where(x => x.RenderMode.Equals(ApplicationSettings.Current.ArcUpdate.RenderMode)).ToList().ForEach(async comp => {
if (!comp.IsInstalled())
{
await comp.DownloadComponent(httpController);
}
});
}
}
else
{
var component = new ArcDpsComponent() { Type = ArcDpsComponentType.ArcDps, RenderMode = ApplicationSettings.Current.ArcUpdate.RenderMode, RelativeLocation = ApplicationSettings.Current.ArcUpdate.RenderMode.Equals(GameRenderMode.DX11) ? @"\d3d11.dll" : @"\bin64\d3d9.dll" };
if (!component.IsInstalled())
{
await component.DownloadComponent(httpController);
}
ArcDpsComponent.All.Add(component);
ArcDpsComponent.SerialiseAll(ApplicationSettings.LocalDir);
}
await StartTimerAsync();
}
else
{
await StopTimerAsync();
}
}
}
19
Source : FormArcPluginManager.cs
with MIT License
from HardstuckGuild
with MIT License
from HardstuckGuild
private async void CheckedListBoxArcDpsPlugins_ItemCheck(object sender, ItemCheckEventArgs e)
{
checkedListBoxArcDpsPlugins.ClearSelected();
var item = (ArcDpsComponentHelperClreplaced)checkedListBoxArcDpsPlugins.Items[e.Index];
if (e.NewValue.Equals(CheckState.Unchecked))
{
var processes = GetGW2Instances();
if (processes.Count == 0)
{
var component = ArcDpsComponent.All.Where(x => x.Type.Equals(item.Type)).FirstOrDefault();
File.Delete($"{ApplicationSettings.Current.GW2Location}{component.RelativeLocation}");
ArcDpsComponent.All.RemoveAll(x => x.Type.Equals(component.Type));
}
else
{
e.NewValue = CheckState.Checked;
MessageBox.Show("You are unable to uninstall an arcdps plugin while GW2 is still running.", "GW2 is still running", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else if (e.NewValue.Equals(CheckState.Checked))
{
var component = new ArcDpsComponent() { Type = item.Type, RenderMode = ApplicationSettings.Current.ArcUpdate.RenderMode, RelativeLocation = ApplicationSettings.Current.ArcUpdate.RenderMode.Equals(GameRenderMode.DX11) ? $@"\{item.DefaultFileName}" : $@"\bin64\{item.DefaultFileName}" };
ArcDpsComponent.All.Add(component);
await component.DownloadComponent(httpController);
}
}
19
Source : FormBossData.cs
with MIT License
from HardstuckGuild
with MIT License
from HardstuckGuild
private void ButtonResetSettings_Click(object sender, EventArgs e)
{
var result = MessageBox.Show("Are you sure you want to reset all the bosses?\nThis will undo all Discord webhook icon and Twitch messages settings and reset them to their default state.", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result.Equals(DialogResult.Yes))
{
listViewBosses.Items.Clear();
allBosses.Clear();
foreach (var keyPair in Bosses.GetDefaultSettingsForBossesAsDictionary())
{
allBosses.Add(keyPair.Key, keyPair.Value);
}
bossesIdsKey = allBosses.Count;
foreach (int key in allBosses.Keys)
{
listViewBosses.Items.Add(new ListViewItem() { Name = key.ToString(), Text = allBosses[key].Name });
}
}
}
19
Source : FormBossData.cs
with MIT License
from HardstuckGuild
with MIT License
from HardstuckGuild
private void ToolStripMenuItemDeleteBoss_Click(object sender, EventArgs e)
{
if (listViewBosses.SelectedItems.Count > 0)
{
var selected = listViewBosses.SelectedItems[0];
int.TryParse(selected.Name, out int reservedId);
var result = MessageBox.Show("Are you sure you want to delete this boss?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result.Equals(DialogResult.Yes))
{
listViewBosses.Items.RemoveByKey(reservedId.ToString());
allBosses.Remove(reservedId);
}
}
}
19
Source : FormTemplateBossData.cs
with MIT License
from HardstuckGuild
with MIT License
from HardstuckGuild
private void ButtonSuccessSave_Click(object sender, EventArgs e)
{
var result = MessageBox.Show($"This will change all non-golem, non-wvw, non-event Twitch message on success to \"{textBoxSuccessMessage.Text}\".\nAre you sure?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (result.Equals(DialogResult.Yes))
{
var BossesToChange = allBosses
.Where(x => !x.Value.Type.Equals(BossType.Golem))
.Where(x => !x.Value.Type.Equals(BossType.WvW))
.Where(x => !x.Value.Event)
.ToDictionary(x => x.Key, x => x.Value);
foreach (var key in BossesToChange.Keys)
{
var boss = allBosses[key];
boss.SuccessMsg = textBoxSuccessMessage.Text;
}
MessageBox.Show("All changes are saved.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
19
Source : FormTemplateBossData.cs
with MIT License
from HardstuckGuild
with MIT License
from HardstuckGuild
private void ButtonFailSave_Click(object sender, EventArgs e)
{
var result = MessageBox.Show($"This will change all non-golem, non-wvw, non-event Twitch message on fail to \"{textBoxFailMessage.Text}\".\nAre you sure?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (result.Equals(DialogResult.Yes))
{
var BossesToChange = allBosses
.Where(x => !x.Value.Type.Equals(BossType.Golem))
.Where(x => !x.Value.Type.Equals(BossType.WvW))
.Where(x => !x.Value.Event)
.ToDictionary(x => x.Key, x => x.Value);
foreach (var key in BossesToChange.Keys)
{
var boss = allBosses[key];
boss.FailMsg = textBoxFailMessage.Text;
}
MessageBox.Show("All changes are saved.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
See More Examples