本文整理汇总了C#中Display类的典型用法代码示例。如果您正苦于以下问题:C# Display类的具体用法?C# Display怎么用?C# Display使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Display类属于命名空间,在下文中一共展示了Display类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Execute
public void Execute(LiteEngine engine, StringScanner s, Display display, InputCommand input, Env env)
{
var col = this.ReadCollection(engine, s);
var doc = JsonSerializer.Deserialize(s.ToString()).AsDocument;
display.WriteResult(engine.Update(col, doc));
}
开发者ID:apkd,项目名称:LiteDB,代码行数:7,代码来源:Update.cs
示例2: ProcessRequest
/// <summary>
/// Handle a request.
/// </summary>
/// <param name="pDisplay">The display which called this function.</param>
/// <param name="pSurface">The surface which this display is hosted on.</param>
/// <param name="dArguments">A dictionary of arguments which are passed to the function as parameters.</param>
/// <returns>True if the request was processed sucessfully. False if there was an error.</returns>
public bool ProcessRequest(Display pDisplay, Surface pSurface, JSObject dArguments)
{
// Find the new surface.
var pTargetSurface = Authority.FindSurface(dArguments.GetValueOrDefault("target", ""));
if (pTargetSurface == null)
{
Log.Write("Cannot swap display to target surface. Missing valid 'target' parameter.", pDisplay.ToString(), Log.Type.DisplayWarning);
return false;
}
// Check the surface this view is on is not our target.
if (pTargetSurface == pDisplay.ActiveSurface)
{
Log.Write("Cannot swap display to target surface because it is already there.", pDisplay.ToString(), Log.Type.DisplayWarning);
return false;
}
// If the target surface has a display, get a reference and remove it.
Display pOtherView = pTargetSurface.ActiveDisplay;
if (pOtherView != null)
Authority.RemoveDisplay(pOtherView);
// Remove this display from this surface and put it on the target surface.
Authority.RemoveDisplay(pDisplay);
Authority.ShowDisplay(pDisplay, pTargetSurface);
// Now put the other display on the original surface.
if (pOtherView != null)
Authority.ShowDisplay(pOtherView, pSurface);
// Boom.
return true;
}
开发者ID:iNabarawy,项目名称:ubidisplays,代码行数:40,代码来源:SwapDisplay.cs
示例3: Auth
public static string Auth(string callbackUrl, string state, Scope scope = Scope.None, Display display = Display.Page)
{
var parameters = new List<Parameter> {
new Parameter { Name = OAuth2Parameter.ConsumerID.Value(), Value = clientId },
new Parameter { Name = OAuth2Parameter.CallbackUrl.Value(), Value = callbackUrl },
new Parameter { Name = OAuth2Parameter.State.Value(), Value = state }
};
if (display != Display.Page)
parameters.Add(new Parameter { Name = OAuth2Parameter.Display.Value(), Value = display.Value() });
if (scope != Scope.None) {
var permissionNames = new List<string>();
if ((scope & Scope.Email) == Scope.Email)
permissionNames.Add(Scope.Email.Value());
if ((scope & Scope.Birthday) == Scope.Birthday)
permissionNames.Add(Scope.Birthday.Value());
if ((scope & Scope.Publish) == Scope.Publish)
permissionNames.Add(Scope.Publish.Value());
if (permissionNames.Count > 0)
parameters.Insert(0, new Parameter { Name = OAuth2Parameter.Scope.Value(), Value = string.Join(scopeDelimiter, permissionNames) });
}
return Utils.CreateUri(AuthorizeEndpoint, parameters).AbsoluteUri;
}
开发者ID:fbdegroot,项目名称:OpenAuth,代码行数:26,代码来源:FacebookClient.cs
示例4: CreateNewSource
//[XmlIgnore]
//[Browsable(false)]
//public override bool IsSupportPreview
//{
// get { return true; }
//}
public override Source CreateNewSource(Slide slide, ModuleConfiguration moduleConfiguration, Dictionary<string, IList<DeviceResourceDescriptor>> resources, Display display)
{
//IEDocumentSourceDesign source = new IEDocumentSourceDesign() { Type = this };
//return source;
return new IEDocumentSourceDesign { Type = this };
}
开发者ID:AlexSneg,项目名称:VIRD-1.0,代码行数:15,代码来源:IEDocumentSourceConfig.cs
示例5: Main
static void Main()
{
DateTime date1 = new DateTime(2013, 5, 24, 11, 11, 30);
DateTime date2 = new DateTime(2013, 5, 24, 15, 23, 2);
DateTime date3 = new DateTime(2013, 5, 31, 9, 00, 00);
DateTime date4 = new DateTime(2013, 5, 31, 18, 12, 20);
Call call1 = new Call(date1, "0888313233", 850);
Call call2 = new Call(date2, "0888909090", 95);
Call call3 = new Call(date3, "0889556677", 213);
Call call4 = new Call(date4, "0888313233", 37);
Battery battery = new Battery ("PX8", BatteryType.LiIon, 300, 8);
Display display = new Display(4, 16000000);
GSM gsm = new GSM("I900", "Samsung", 500, "Me", battery, display);
gsm.AddCalls(call1);
gsm.AddCalls(call2);
gsm.AddCalls(call3);
gsm.AddCalls(call4);
foreach (var call in gsm.CallHistory)
{
Console.WriteLine(call);
}
Console.WriteLine("Total amount to pay: {0:C}",gsm.TotalCallsPrice);
gsm.DeleteCalls(call1);
Console.WriteLine("Total amount to pay: {0:C}", gsm.TotalCallsPrice);
gsm.ClearHistory();
Console.WriteLine("Total amount to pay: {0:C}", gsm.TotalCallsPrice);
}
开发者ID:stefan-er,项目名称:CSharp,代码行数:34,代码来源:GSMCallHistoryTest.cs
示例6: Main
static void Main(string[] args)
{
var display = new Display(Console.Out, Console.In);
var problemLoader = new ProblemLoader(display);
bool exit = false;
while (!exit)
{
display.Write("Enter Problem Number ('q' to quit): ");
var input = display.ReadLine();
if (input == "q")
{
exit = true;
continue;
}
try
{
int problemNumber = int.Parse(input);
var problem = problemLoader.LoadProblem(problemNumber);
problem.Run();
}
catch (Exception)
{
display.WriteLine("Problem Solution does not exist for {0}.", input);
}
}
}
开发者ID:r-abbott,项目名称:ProjectEuler,代码行数:26,代码来源:Program.cs
示例7: Main
private static void Main()
{
// Generate some test batteries and displays
var premiumDisplay = new Display(4.5, Display.ColorDepth._32Bit);
var mediocreDisplay = new Display(3.5, Display.ColorDepth._16Bit);
var poorDisplay = new Display(2.5, Display.ColorDepth._8bit);
var premiumBattery = new Battery("Sanyo-SN532e", 120, 20, Battery.Type.LiPol);
var mediocreBattery = new Battery("Shanzungmang-2341", 80, 15, Battery.Type.LiIon);
var poorBattery = new Battery("Mistucura-1224fe", 40, 5, Battery.Type.NiMH);
// initilize gsms in the array
var gsmArray = new GSM[4];
gsmArray[0] = new GSM("One", "HTC", "Kiro", premiumDisplay, premiumBattery, 200);
gsmArray[1] = new GSM("Blade", "Zte");
gsmArray[2] = new GSM("Galaxy S4", "Samsung", "Misho", premiumDisplay, mediocreBattery, 1000);
gsmArray[3] = new GSM("Ascend G600", "Huawei", "Mtel", premiumDisplay,
new Battery("Toshiba-tbsae", 380, 6, Battery.Type.LiPol), 600);
// print the gsms
foreach (var phone in gsmArray)
{
Console.WriteLine(phone);
}
// print the static property Iphone4S
Console.WriteLine(GSM.Iphone4S);
// test GsmCallHistory
GSMCallHistoryTest.Test();
}
开发者ID:hrist0stoichev,项目名称:Telerik-Homeworks,代码行数:30,代码来源:GSMTest+.cs
示例8: ProcessRequest
/// <summary>
/// Handle a request.
/// </summary>
/// <param name="pDisplay">The display which called this function.</param>
/// <param name="pSurface">The surface which this display is hosted on.</param>
/// <param name="dArguments">A dictionary of arguments which are passed to the function as parameters.</param>
/// <returns>True if the request was processed sucessfully. False if there was an error.</returns>
public bool ProcessRequest(Display pDisplay, Surface pSurface, JSObject dArguments)
{
// Check we have a sound file.
var sSound = dArguments.GetValueOrDefault("file", "");
if (sSound == null || sSound == "")
{
Log.Write("Cannot play sound. Are you missing a 'file' parameter.", pDisplay.ToString(), Log.Type.DisplayWarning);
return false;
}
// Attempt to play it.
try
{
SoundPlayer pSound = new SoundPlayer(sSound);
pSound.Play();
return true;
}
// Log warnings.
catch (Exception e)
{
Log.Write("Cannot play sound. " + e.Message, pDisplay.ToString(), Log.Type.DisplayWarning);
return false;
}
}
开发者ID:iNabarawy,项目名称:ubidisplays,代码行数:32,代码来源:PlaySound.cs
示例9: Execute
public override void Execute(LiteShell shell, StringScanner s, Display display, InputCommand input)
{
if(s.Scan("false|off").Length > 0 && _writer != null)
{
display.TextWriters.Remove(_writer);
input.OnWrite = null;
_writer.Flush();
_writer.Dispose();
_writer = null;
}
else if(_writer == null)
{
if (shell.Database == null) throw LiteException.NoDatabase();
var dbfilename = shell.Database.ConnectionString.Filename;
var path = Path.Combine(Path.GetDirectoryName(dbfilename),
string.Format("{0}-spool-{1:yyyy-MM-dd-HH-mm}.txt", Path.GetFileNameWithoutExtension(dbfilename), DateTime.Now));
_writer = File.CreateText(path);
display.TextWriters.Add(_writer);
input.OnWrite = (t) => _writer.Write(t);
}
}
开发者ID:azraelrabbit,项目名称:LiteDB,代码行数:25,代码来源:Spool.cs
示例10: Execute
public override bool Execute()
{
Image image = null;
if (File.Exists(_path))
{
image = Image.Load(RunMode.Noninteractive, _path, _path);
}
else
{
var choose = new FileChooserDialog("Open...",
null,
FileChooserAction.Open,
"Cancel", ResponseType.Cancel,
"Open", ResponseType.Accept);
if (choose.Run() == (int) ResponseType.Accept)
{
string fileName = choose.Filename;
image = Image.Load(RunMode.Noninteractive, fileName, fileName);
};
choose.Destroy();
}
if (image != null)
{
image.CleanAll();
ActiveDisplay = new Display(image);
ActiveImage = image;
return true;
}
return false;
}
开发者ID:unhammer,项目名称:gimp-sharp,代码行数:32,代码来源:OpenEvent.cs
示例11: Execute
public void Execute(LiteEngine engine, StringScanner s, Display display, InputCommand input, Env env)
{
var col = this.ReadCollection(engine, s);
var index = s.Scan(this.FieldPattern).Trim();
display.WriteResult(engine.Max(col, index.Length == 0 ? "_id" : index));
}
开发者ID:apkd,项目名称:LiteDB,代码行数:7,代码来源:Max.cs
示例12: SlideLayout
public SlideLayout(IEnumerable<Display> ADisplays, Slide ASlide)
{
m_slide = ASlide;
m_displays = new List<Display>();
foreach (Display d in ADisplays)
{
if (!WeContainDisplay(d))
{
AddDisplayToSlide(d);
}
else
{
m_displays.Add(FindDisplay(d));
}
}
if (m_displays.Count > 0)
{
m_windowList = new List<Window>(m_displays[0].WindowList);
firstDisplay = m_displays.First();
}
else
m_windowList = new List<Window>();
UpdateDisplayLayout();
}
开发者ID:AlexSneg,项目名称:VIRD-1.0,代码行数:26,代码来源:SlideLayout.cs
示例13: Main
static void Main()
{
GSM[] mobilePhones = new GSM[3];
GSM nokia = new GSM("3310", "Nokia");
nokia.AddHistory(DateTime.Now, 0998080907, 1.08);
nokia.AddHistory(DateTime.Now, 0998080907, 2132331.08);
nokia.DeleteHistory(1);
Battery sonyBattery5511 = new Battery("77ds7", 220, 10, BatteryType.NiMH);
Display sonyDisplay5511 = new Display(23, 128);
GSM sony = new GSM("5511", "Sony", 100.77m, "Pesho", sonyBattery5511, sonyDisplay5511);
GSM samsung = new GSM("4433", "samsung", 50.22m, "Gosho");
mobilePhones[0] = nokia;
mobilePhones[1] = sony;
mobilePhones[2] = samsung;
//Console.WriteLine(nokia.CalcPriceHistory(2.2m));
for (int i = 0; i < mobilePhones.Length; i++)
{
Console.WriteLine(mobilePhones[i]);
}
}
开发者ID:siropo,项目名称:Telerik_academy_homework,代码行数:26,代码来源:GMSTest.cs
示例14: Main
static void Main()
{
GSM gsm = new GSM("nokia", "nokiaman");
GSM gsm1 = new GSM("nokia", "nok", 9.5m);
Battery bat = new Battery("monbat", 500, 100, BatteryType.NiMH);
Display dis = new Display(null, 256);
GSM gsm2 = new GSM("erik", "erik", bat);
GSM gsm3 = new GSM("koko", "ka", dis);
Console.WriteLine(gsm.ToString());
Console.WriteLine("-----");
Console.WriteLine(gsm1.ToString());
Console.WriteLine("-----");
Console.WriteLine(gsm2.ToString());
Console.WriteLine("-----");
Console.WriteLine(gsm3.ToString());
Console.WriteLine("---------------------------");
GSM p = GSM.IPhone4S;
p.Owner = "pesho";
p.Battery = bat;
Console.WriteLine(p.ToString());
GSMCallHistoryTest.Test();
}
开发者ID:Varbanov,项目名称:TelerikAcademy,代码行数:31,代码来源:GSMTest.cs
示例15: Configure
public override void Configure(Display.ChartComponent[] components_)
{
reset(components_);
setComponent(components_[0], CTDValuePair.TY, 2d);
setComponent(components_[1], CTDValuePair.CT5, -1d);
setComponent(components_[2], CTDValuePair.CT10, -1d);
}
开发者ID:heimanhon,项目名称:researchwork,代码行数:7,代码来源:TYASWFLY.cs
示例16: Main
static void Main()
{
// Create an instance of the GSM class
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-GB");
Display display = new Display(2.5F, "256K");
Battery battery = new Battery(950, 35, BatteryType.LiIon);
GSM gsmTest = new GSM("Samsung Ace", "Samsung Group", 545.00M, "Ivan Ivanov", battery, display);
//Add few calls
DateTime date = DateTime.Now;
gsmTest.AddCallInHistory(date, "0889909988", 65);
gsmTest.AddCallInHistory(date.AddHours(1), "0889969988", 25);
gsmTest.AddCallInHistory(date.AddHours(2), "0883909988", 3600);
gsmTest.AddCallInHistory(date.AddHours(6.5), "0889969988", 1000);
//Display the information about the calls.
Console.WriteLine("Print the call hisory of phone {0}", gsmTest.ModelOfGSM);
Console.WriteLine(gsmTest.PrintCallHistory());
//Assuming that the price per minute is 0.37 calculate and print the total price of the calls in the history
//use readonly modificator about pricePerminute
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Total price of calls is: {0}", gsmTest.CalcucateTotalPrice(0.37M));
Console.ForegroundColor = ConsoleColor.Gray;
//Remove the longest call from the history and calculate the total price again.
gsmTest.RemoveCallByLongestDuration();
Console.WriteLine(gsmTest.PrintCallHistory());
//Finally clear the call history and print it.
gsmTest.ClearCallHistory();
Console.WriteLine(gsmTest.PrintCallHistory());
}
开发者ID:ralikuman,项目名称:TelerikAcademy,代码行数:33,代码来源:GSMCallHistory.cs
示例17: GetList
public static List<Display> GetList(String quotaion_no)
{
List<Display> list = new List<Display>();
var idlist = from q in db.Quotation_Version
where q.Quotation_No.Equals(quotaion_no) & q.Quotation_Status == 5
select q.Quotation_Version_Id;
//var data = from qt in db.Quotation_Target from q in list from c in db.country where idlist.Contains((int)qt.quotation_id) & qt.country_id == c.country_id select new { Text = qt.target_description + "(" + q.No + " - "+q.Version +") - [" + c.country_name + "]", Id = qt.Quotation_Target_Id, Version = q.Version };
var data = from qt in db.Quotation_Target from c in db.country where idlist.Contains((int)qt.quotation_id) & qt.country_id == c.country_id select new { Text = qt.target_description, CountryName = c.country_name, Id = qt.Quotation_Target_Id, qId = qt.quotation_id };
foreach (var item in data)
{
Display dis = new Display();
var lists = from q in db.Quotation_Version
where q.Quotation_Version_Id == item.qId
select new
{
No = q.Quotation_No,
Version = q.Vername,
Id = q.Quotation_Version_Id
};
dis.Text = item.Text + "(" + lists.First().No + " - V" + lists.First().Version + ") - [ " + item.CountryName + " ]";
dis.Id = item.Id.ToString();
list.Add(dis);
}
return list;
}
开发者ID:AdamsChao,项目名称:netdb-localdev-proj,代码行数:26,代码来源:PRUtils.cs
示例18: Execute
public void Execute(LiteEngine engine, StringScanner s, Display d, InputCommand input, Env env)
{
var sb = new StringBuilder();
var enabled = !(s.Scan(@"off\s*").Length > 0);
env.Log.Level = enabled ? Logger.FULL : Logger.NONE;
}
开发者ID:apkd,项目名称:LiteDB,代码行数:7,代码来源:Debug.cs
示例19: Main
static void Main()
{
Display testDisplay = new Display(14, 16.5f);
Battery testBattery = new Battery("test");
GSM myPhone = new GSM("test", "test", "Owner",1234, testBattery, testDisplay);
Console.WriteLine(myPhone.display.Size);
}
开发者ID:nikolaZ,项目名称:TelerikAcademy,代码行数:7,代码来源:Test.cs
示例20: Main
static void Main(string[] args)
{
try
{
//Create battery and display for the GSM
Battery battery = new Battery("BL-5C",360,7,Battery.BatteryType.LithiumLon);
Display display = new Display(3,65536);
//Create GSM
GSM gsm = new GSM("1208", "nokia", 50, "Georgi", battery, display);
//Console.WriteLine(gsm.ToString()); //Print GSM data
//Mace some calls and print the history
gsm.AddCall(new Call(new DateTime(2013, 02, 22, 19, 01, 22), "00359888888888", 200));
gsm.AddCall(new Call(new DateTime(2013,02,22,20,02,33),"0887888888",302));
gsm.AddCall(new Call(new DateTime(2013, 02, 22, 20, 30, 19), "0889-88-88-88", 178));
gsm.PrintCallHistiry();
//Calculate the price of all calls
decimal price = 0.37m;
gsm.CalculateTotalCallsPrice(price);
//Remove the longest call and calculate the price again
gsm.DeleteCall(1); //The calls in the list start from 0, so the second call(longest) is 1
gsm.CalculateTotalCallsPrice(price);
//Clear the history and print it
gsm.ClearCallHistory();
gsm.PrintCallHistiry();
}
catch (Exception ex)
{
Console.WriteLine("Error!"+ex.Message);
}
}
开发者ID:Jarolim,项目名称:TelerikAcademy-1,代码行数:35,代码来源:GSMCallHistoryTest(Main).cs
注:本文中的Display类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论