public MainPageViewModel(IEnumerable <IHostingContext> hostingContexts)
 {
     this.hostingContexts = hostingContexts;
     selectedLanguage     = hostingContexts.FirstOrDefault();
     PasteSampleCommand   = new DelegateCommand(PasteSample);
     ExecuteCommand       = new DelegateCommand(Execute);
 }
 public MainPageViewModel(IEnumerable<IHostingContext> hostingContexts)
 {
     this.hostingContexts = hostingContexts;
     selectedLanguage = hostingContexts.FirstOrDefault();
     PasteSampleCommand = new DelegateCommand(PasteSample);
     ExecuteCommand = new DelegateCommand(Execute);
 }
Exemple #3
0
 internal RaftClusterMember(IHostingContext context, Uri remoteMember, Uri resourcePath)
     : base(context.CreateHttpHandler(), true)
 {
     this.resourcePath = resourcePath;
     this.context      = context;
     status            = new AtomicEnum <ClusterMemberStatus>(ClusterMemberStatus.Unknown);
     BaseAddress       = remoteMember;
     Endpoint          = remoteMember.ToEndPoint() ?? throw new UriFormatException(ExceptionMessages.UnresolvedHostName(remoteMember.Host));
     DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(UserAgent, (GetType().Assembly.GetName().Version ?? new Version()).ToString()));
 }
Exemple #4
0
 public void Configure(IHostingContext context)
 {
     context.BeforeExecute += (s, e) => Clear();
     context.SetFunction("line", new Action <double, double, double, double>(DrawLine));
     context.SetFunction("ellipse", new Action <double, double, double, double>(DrawEllipse));
     context.SetFunction("rect", new Action <double, double, double, double>(DrawRect));
     context.SetFunction("text", new Action <double, double, string>(DrawText));
     context.SetObject("g", wrapper);
     context.SetObject("m", typeof(Wrapper));
 }
 public void Configure(IHostingContext context)
 {
     context.BeforeExecute += (s, e) => Clear();
     context.SetFunction("line", new Action<double, double, double, double>(DrawLine));
     context.SetFunction("ellipse", new Action<double, double, double, double>(DrawEllipse));
     context.SetFunction("rect", new Action<double, double, double, double>(DrawRect));
     context.SetFunction("text", new Action<double, double, string>(DrawText));
     context.SetObject("g", wrapper);
     context.SetObject("m", typeof(Wrapper));
 }