コード例 #1
0
 public TimeHelper(DispatcherTimer timer)
 {
     Timer       = timer;
     Timer.Tick += UpdateTimeToDisplay;
     Shared      = new Shared.Shared();
     SetUpTimeVariables();
 }
コード例 #2
0
        public void VisitShared(IShared shared, Tensor <float> data)
        {
            var other = data as Tensor <float> .Shared;

            if (other == null)
            {
                Arent();
            }
            else
            {
                Eq(((Tensor <float> .Shared)shared).Value, other.Value);
            }
        }
コード例 #3
0
 public Application(IHolidayType holidayType,
                    IShared shared,
                    IPartyNumberPage partyNumberPage,
                    IBudgetPage budgetPage,
                    IDestinationFilter destinationFilter,
                    IResultsPage resultsPage)
 {
     _holidayType       = holidayType;
     _shared            = shared;
     _partyNumberPage   = partyNumberPage;
     _budgetPage        = budgetPage;
     _destinationFilter = destinationFilter;
     _resultsPage       = resultsPage;
 }
コード例 #4
0
        public virtual void VisitShared(IShared shared, Compiler compiler)
        {
            compiler.Scope.Declare(shared, compiler);
            var comment = GetComment(shared, compiler);

            if (shared is ITensor tensor)
            {
                var buff = compiler.GetBuffer(tensor);
                if (buff != null && (!buff.IsShared || buff.Name != shared.Name))
                {
                    compiler.EmitAssign(shared, $"Copy({Compiler.GetShared(shared)}, result: {compiler.GetBufferName(buff)})" + compiler.OfShape(@shared, this), comment);
                    return;
                }
            }
            compiler.EmitAssign(shared, Compiler.GetShared(shared) + compiler.OfShape(@shared, this), comment);
        }
コード例 #5
0
        public static string GetSharedProperty(IShared shared)
        {
            // TODO: weak..., shall we add the underlying type of the shared as one of its member ?
            // shall we distinguih between int/Array<int>/float/Array<float> ? or just float/int (enough in combination with ITensor/IScalar)
            var    type = shared.GetType().BaseType.BaseType;
            string name = type.GetName();

            switch (name)
            {
            case "Scalar<int>":
                return("Int");

            case "Scalar<float>":
                return("Float");

            case "Tensor<int>":
                return("IntArray");

            case "Tensor<float>":
                return("FloatArray");
            }
            return(name);
        }
コード例 #6
0
 /// <summary>
 /// Indicates if the instance is NOT shared with other instances.
 /// </summary>
 /// <param name="shared"></param>
 /// <returns></returns>
 public static bool IsOwned(this IShared shared)
 {
     return(object.ReferenceEquals(shared, null).Equals(false) && shared.IsShared.Equals(false));
 }
コード例 #7
0
 public static BufferInfo UseShared <T>(IShared <T> shared) => new BufferInfo(shared.Name, (shared as ITensor).Shape, typeof(T), shared: true);
コード例 #8
0
 public BudgetPage(IShared shared)
 {
     _shared = shared;
 }
コード例 #9
0
 public Parent(IChild child, IShared shared)
 {
     Child  = child;
     Shared = shared;
 }
コード例 #10
0
 public Child(IShared shared)
 {
     Shared = shared;
 }
コード例 #11
0
 public static string GetShared(IShared shared) => $"{GetSharedProperty(shared)}[\"{shared.Name}\"]";
コード例 #12
0
 public PartyNumberPage(IShared shared)
 {
     _shared = shared;
 }
コード例 #13
0
 public HolidayTypePage(IDestinationRepository destinationRepository, IShared shared)
 {
     _destinationRepository = destinationRepository;
     _shared = shared;
 }
コード例 #14
0
 public ResultsPage(IShared shared)
 {
     _shared = shared;
 }