Ejemplo n.º 1
0
        public async Task ExitAnima()
        {
            AnimaStory.Stop();
            AnimaStory.Children.Clear();

            if (SplashCover.Filling)
            {
                SimpleStory.DoubleAnimation(AnimaStory, SplashCover, "Opacity", 1, 0, 350, 0, Easings.EaseInCubic);
            }

            SplashCover.SplashOut();

            SimpleStory.DoubleAnimation(AnimaStory, Indicators, "Opacity", 1, 0, 350, 400, Easings.EaseInCubic);
            SimpleStory.DoubleAnimation(AnimaStory, Indicators.RenderTransform, "Y", 0, -30, 350, 400, Easings.EaseInCubic);

            SimpleStory.DoubleAnimation(AnimaStory, HeaderPanel, "Opacity", 1, 0, 350, 300, Easings.EaseInCubic);
            SimpleStory.DoubleAnimation(AnimaStory, HeaderPanel.RenderTransform, "Y", 0, 30, 350, 300, Easings.EaseInCubic);

            SimpleStory.DoubleAnimation(AnimaStory, StatusPanel, "Opacity", 1, 0, 350, 200, Easings.EaseInCubic);
            SimpleStory.DoubleAnimation(AnimaStory, StatusPanel.RenderTransform, "Y", 0, 30, 350, 200, Easings.EaseInCubic);

            SimpleStory.DoubleAnimation(AnimaStory, IntroText, "Opacity", 1, 0, 350, 100, Easings.EaseInCubic);
            SimpleStory.DoubleAnimation(AnimaStory, IntroText.RenderTransform, "Y", 0, 30, 350, 100, Easings.EaseInCubic);

            AnimaStory.Begin();
            await Task.Delay(1000);
        }
Ejemplo n.º 2
0
        public async Task ExitAnima()
        {
            AnimaStory.Stop();
            AnimaStory.Children.Clear();

            SimpleStory.DoubleAnimation(AnimaStory, HeaderPanel, "Opacity", 1, 0, 350, 400, Easings.EaseInCubic);
            SimpleStory.DoubleAnimation(AnimaStory, HeaderPanel.RenderTransform, "Y", 0, 30, 350, 400, Easings.EaseInCubic);

            SimpleStory.DoubleAnimation(AnimaStory, ScriptDesc, "Opacity", 1, 0, 350, 300, Easings.EaseInCubic);
            SimpleStory.DoubleAnimation(AnimaStory, ScriptDesc.RenderTransform, "Y", 0, 30, 350, 300, Easings.EaseInCubic);

            SimpleStory.DoubleAnimation(AnimaStory, HistoryHeader, "Opacity", 1, 0, 350, 300, Easings.EaseInCubic);
            SimpleStory.DoubleAnimation(AnimaStory, HistoryHeader.RenderTransform, "Y", 0, 30, 350, 300, Easings.EaseInCubic);

            SimpleStory.DoubleAnimation(AnimaStory, HistoryGrid, "Opacity", 1, 0, 350, 300, Easings.EaseInCubic);
            SimpleStory.DoubleAnimation(AnimaStory, HistoryGrid.RenderTransform, "Y", 0, 30, 350, 300, Easings.EaseInCubic);

            SimpleStory.DoubleAnimation(AnimaStory, InfoPanel, "Opacity", 1, 0, 350, 200, Easings.EaseInCubic);
            SimpleStory.DoubleAnimation(AnimaStory, InfoPanel.RenderTransform, "Y", 0, 30, 350, 200, Easings.EaseInCubic);

            SimpleStory.DoubleAnimation(AnimaStory, StatPanel, "Opacity", 1, 0, 350, 100, Easings.EaseInCubic);
            SimpleStory.DoubleAnimation(AnimaStory, StatPanel.RenderTransform, "Y", 0, 30, 350, 100, Easings.EaseInCubic);

            SimpleStory.DoubleAnimation(AnimaStory, AccessControls, "Opacity", 1, 0, 350, 100, Easings.EaseInCubic);
            SimpleStory.DoubleAnimation(AnimaStory, AccessControls.RenderTransform, "Y", 0, 30, 350, 100, Easings.EaseInCubic);

            AnimaStory.Begin();
            await Task.Delay(1000);
        }
Ejemplo n.º 3
0
        private void InitAppBar()
        {
            StringResources stx = StringResources.Load("NavigationTitles");

            if (StoreServicesFeedbackLauncher.IsSupported())
            {
                FeedbackBtn        = UIAliases.CreateAppBarBtn(SegoeMDL2.FeedbackApp, stx.Text("Feedback"));
                FeedbackBtn.Click += FeedbackBtn_Click;
                MinorControls      = new ICommandBarElement[] { FeedbackBtn };
            }

            NewsBtn        = UIAliases.CreateAppBarBtn(Symbol.Important, stx.Text("News"));
            NewsBtn.Click += NewsBtn_Click;

            NewsStory = new Storyboard();
            SimpleStory.DoubleAnimation(NewsStory, NewsBtn, "Opacity", 0, 1, 350);
            NewsStory.AutoReverse    = true;
            NewsStory.RepeatBehavior = RepeatBehavior.Forever;

            MajorControls = new ICommandBarElement[] { NewsBtn };

            GetAnnouncements();

            MessageBus.SendUI(typeof(GR.GSystem.ActionCenter), AppKeys.PM_CHECK_TILES);
        }
Ejemplo n.º 4
0
        public async Task ExitAnima()
        {
            AnimaStory.Stop();
            AnimaStory.Children.Clear();

            SimpleStory.DoubleAnimation(AnimaStory, LayoutRoot, "Opacity", 1, 0, 350);
            AnimaStory.Begin();
            await Task.Delay(500);
        }
Ejemplo n.º 5
0
        private void MoveBounds(string ProcessId, string WindowId, Rect R)
        {
            ProfileId = $"{ProcessId}\n{WindowId}";

            TargetBounds = R;
            SimpleStory.DoubleAnimation(PreviewStory, this, "Top", this.Top, R.Top, 250, 250);
            SimpleStory.DoubleAnimation(PreviewStory, this, "Left", this.Left, R.Left, 250);
            SimpleStory.DoubleAnimation(PreviewStory, this, "Width", this.Width, R.Width, 250);
            SimpleStory.DoubleAnimation(PreviewStory, this, "Height", this.Height, R.Height, 250, 250);
            PreviewStory.Begin();
        }
Ejemplo n.º 6
0
        public async Task EnterAnima()
        {
            AnimaStory.Stop();
            AnimaStory.Children.Clear();

            SimpleStory.DoubleAnimation(AnimaStory, LayoutRoot, "Opacity", 0, 1);
            SimpleStory.DoubleAnimation(AnimaStory, LayoutRoot.RenderTransform, "Y", 30, 0);

            AnimaStory.Begin();
            await Task.Delay(350);
        }
Ejemplo n.º 7
0
        public async Task ExitAnima()
        {
            AnimaStory.Stop();
            AnimaStory.Children.Clear();

            SimpleStory.DoubleAnimation(AnimaStory, LayoutRoot, "Opacity", 1, 0, 350, 0, Easings.EaseInCubic);
            SimpleStory.DoubleAnimation(AnimaStory, LayoutRoot.RenderTransform, "Y", 0, 30, 350, 0, Easings.EaseInCubic);

            AnimaStory.Begin();
            await Task.Delay(350);
        }
Ejemplo n.º 8
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Storyboard BStory = new Storyboard()
            {
                AutoReverse = true, RepeatBehavior = RepeatBehavior.Forever
            };

            SimpleStory.DoubleAnimation(BStory, SelBounds, "Opacity", 1, 0.5, 1000);
            BStory.Begin();

            var j = ShowProcessList();
        }
Ejemplo n.º 9
0
        static List <MergeAction> EvaluateMergeCandidates(List <MergeAction> candidates, Dictionary <long, SimpleStory> stories)
        {
            List <MergeAction> mergeActions = new List <MergeAction>();

            foreach (var storyPair in candidates)
            {
                SimpleStory s1 = stories[storyPair.KeptStoryID];
                SimpleStory s2 = stories[storyPair.MergedStoryID];

                if (s1.IsSimilarTo(s2))
                {
                    mergeActions.Add(storyPair);
                }
            }

            return(mergeActions);
        }
Ejemplo n.º 10
0
        private void SetTemplate()
        {
            Indicators.RenderTransform  = new TranslateTransform();
            HeaderPanel.RenderTransform = new TranslateTransform();
            StatusPanel.RenderTransform = new TranslateTransform();
            IntroText.RenderTransform   = new TranslateTransform();

            InfoBgContext = new BgContext(GRConfig.BookInfoView.BgContext);
            InfoBgContext.ApplyBackgrounds();

            InitAppBar();

            CacheStateStory            = new Storyboard();
            ReloadIcon.RenderTransform = new RotateTransform()
            {
                CenterX = 7.5, CenterY = 7.5
            };
            SimpleStory.DoubleAnimation(CacheStateStory, ReloadIcon.RenderTransform, "Angle", 0, 360, 2000, 0, new SineEase());
            CacheStateStory.RepeatBehavior = RepeatBehavior.Forever;
        }
Ejemplo n.º 11
0
            public double Similarity(SimpleStory story)
            {
                double wordSim = WordVector * story.WordVector;
                
                double tagCount = Tags.Union(story.Tags).Count();
                double commonCount = Tags.Intersect(story.Tags).Count();
                double commonRatio = commonCount / Tags.Count();
                double differentRatio = (tagCount - commonCount) / tagCount;
                double topicCommonality = Math.Max(-1, Math.Min(1, (commonRatio - differentRatio) * 0.2 * Math.Min(5, tagCount)));
                
                int sameTime = StartTime > story.StartTime && StartTime < story.EndTime.AddMinutes(30)
                    || story.StartTime > StartTime && story.StartTime < EndTime.AddMinutes(30) ? 1 : 0;
                //int sameTopic = wordSim > 0.85 || wordSim > 0.5 && topicCommonality > 0.25 ? 1 : 0;
                //int similarTopic = wordSim > 0.4 || topicCommonality > 0.25 ? 1 : 0;
                //int sameLocation = 0;
                //int sharedUrl = 0;
                //int samePeople = 0;
                //int sameCount = sameTopic + samePeople + sameLocation + sameTime;

                ////Weighting scheme based on study of human-rated semantic similarity of tweets
                //double similarity = Math.Min(1, Math.Max(0, 
                //    0.3 * (sameCount==1 ? 1 : 0) 
                //    + 0.5 * (sameCount==2 ? 1 : 0)
                //    + 0.8 * (sameCount == 3 ? 1 : 0)
                //    + 1.0 * (sameCount == 4 ? 1 : 0)
                //    + 0.1 * sharedUrl 
                //    - 0.2 * (1 - similarTopic) 
                //    - 0.15 * sameLocation
                //    - 0.1 * samePeople
                //    - 0.2 * sameTime
                //    + 0.5));

                double similarity = (
                    0.85 * wordSim
                    + 0.4 * topicCommonality
                    ) * sameTime;

                return similarity;
            }
Ejemplo n.º 12
0
            public double Similarity(SimpleStory story)
            {
                double wordSim = WordVector * story.WordVector;

                double tagCount         = Tags.Union(story.Tags).Count();
                double commonCount      = Tags.Intersect(story.Tags).Count();
                double commonRatio      = commonCount / Tags.Count();
                double differentRatio   = (tagCount - commonCount) / tagCount;
                double topicCommonality = Math.Max(-1, Math.Min(1, (commonRatio - differentRatio) * 0.2 * Math.Min(5, tagCount)));

                int sameTime = StartTime > story.StartTime && StartTime <story.EndTime.AddMinutes(30) ||
                                                                         story.StartTime> StartTime && story.StartTime < EndTime.AddMinutes(30) ? 1 : 0;
                //int sameTopic = wordSim > 0.85 || wordSim > 0.5 && topicCommonality > 0.25 ? 1 : 0;
                //int similarTopic = wordSim > 0.4 || topicCommonality > 0.25 ? 1 : 0;
                //int sameLocation = 0;
                //int sharedUrl = 0;
                //int samePeople = 0;
                //int sameCount = sameTopic + samePeople + sameLocation + sameTime;

                ////Weighting scheme based on study of human-rated semantic similarity of tweets
                //double similarity = Math.Min(1, Math.Max(0,
                //    0.3 * (sameCount==1 ? 1 : 0)
                //    + 0.5 * (sameCount==2 ? 1 : 0)
                //    + 0.8 * (sameCount == 3 ? 1 : 0)
                //    + 1.0 * (sameCount == 4 ? 1 : 0)
                //    + 0.1 * sharedUrl
                //    - 0.2 * (1 - similarTopic)
                //    - 0.15 * sameLocation
                //    - 0.1 * samePeople
                //    - 0.2 * sameTime
                //    + 0.5));

                double similarity = (
                    0.85 * wordSim
                    + 0.4 * topicCommonality
                    ) * sameTime;

                return(similarity);
            }
Ejemplo n.º 13
0
        public async Task EnterAnima()
        {
            SplashCover.Opacity = 1;
            SplashCover.SplashIn();

            AnimaStory.Stop();
            AnimaStory.Children.Clear();

            SimpleStory.DoubleAnimation(AnimaStory, HeaderPanel, "Opacity", 0, 1, 350, 100);
            SimpleStory.DoubleAnimation(AnimaStory, HeaderPanel.RenderTransform, "Y", 30, 0, 350, 100);

            SimpleStory.DoubleAnimation(AnimaStory, StatusPanel, "Opacity", 0, 1, 350, 200);
            SimpleStory.DoubleAnimation(AnimaStory, StatusPanel.RenderTransform, "Y", 30, 0, 350, 200);

            SimpleStory.DoubleAnimation(AnimaStory, IntroText, "Opacity", 0, 1, 350, 300);
            SimpleStory.DoubleAnimation(AnimaStory, IntroText.RenderTransform, "Y", 30, 0, 350, 300);

            SimpleStory.DoubleAnimation(AnimaStory, Indicators, "Opacity", 0, 1, 350, 400);
            SimpleStory.DoubleAnimation(AnimaStory, Indicators.RenderTransform, "Y", -30, 0, 350, 400);

            AnimaStory.Begin();
            await Task.Delay(1000);
        }
Ejemplo n.º 14
0
        protected override void ContentBeginAway(bool Next)
        {
            if (CurrManiState == ManiState.NORMAL)
            {
                return;
            }

            ContentAway = new Storyboard();

            if (Next)
            {
                SimpleStory.DoubleAnimation(
                    ContentAway, _CGTransform, "TranslateY"
                    , _CGTransform.TranslateY
                    , -_MainSplitView.ActualHeight);

                StepNextTitle();
            }
            else
            {
                SimpleStory.DoubleAnimation(
                    ContentAway, _CGTransform, "TranslateY"
                    , _CGTransform.TranslateY
                    , _MainSplitView.ActualHeight);

                StepPrevTitle();
            }

            ContentAway.Completed += (s, e) =>
            {
                ContentAway.Stop();
                _CGTransform.TranslateX = 0;
                _CGTransform.TranslateY = -( double )_CGTransform.GetValue(CompositeTransform.TranslateYProperty);
                ReaderSlideBack();
            };
            ContentAway.Begin();
        }
Ejemplo n.º 15
0
        private static void BindMouseDragHandlers(Canvas Stage, FrameworkElement Elem, Action <System.Windows.Vector> HandleStack)
        {
            Point DragStart;

            void _OnMove(object sender, MouseEventArgs e)
            {
                if (e.LeftButton == MouseButtonState.Pressed)
                {
                    Point DragEnd = e.GetPosition(Stage);
                    var   d       = DragEnd - DragStart;
                    DragStart = DragEnd;

                    HandleStack(d);
                }
                else
                {
                    Elem.ReleaseMouseCapture();
                    Elem.MouseMove -= _OnMove;
                }
            }

            Elem.KeyDown += (s, e) =>
            {
                e.Handled = true;
                double d = 0;
                if (e.IsRepeat)
                {
                    double t = Step;
                    d     = (t *= 0.5) * t * t;
                    Step += 0.075;
                }
                else
                {
                    Step = 0.1;
                    d    = 0.1;
                }

                switch (e.Key)
                {
                case Key.Up:
                    HandleStack(new System.Windows.Vector(0, -d));
                    break;

                case Key.Down:
                    HandleStack(new System.Windows.Vector(0, d));
                    break;

                case Key.Left:
                    HandleStack(new System.Windows.Vector(-d, 0));
                    break;

                case Key.Right:
                    HandleStack(new System.Windows.Vector(d, 0));
                    break;
                }
            };

            Storyboard ElemStory = new Storyboard();

            Elem.DataContext = ElemStory;

            Elem.MouseEnter += (s, e) =>
            {
                SimpleStory.DoubleAnimation(ElemStory, Elem, "Opacity", Elem.Opacity, OPACITY_MOUSE_OVER);
                ElemStory.Begin();
            };

            Elem.MouseLeave += (s, e) =>
            {
                SimpleStory.DoubleAnimation(ElemStory, Elem, "Opacity", Elem.Opacity
                                            , Elem.Equals(FocusManager.GetFocusedElement(Stage)) ? OPACITY_MOUSE_DOWN : OPACITY_IDLE);
                ElemStory.Begin();
            };

            Elem.MouseDown += (s, e) =>
            {
                e.Handled = true;
                if (FocusManager.GetFocusedElement(Stage) is FrameworkElement OElem && !Elem.Equals(OElem) && OElem.DataContext is Storyboard BlurStory)
                {
                    SimpleStory.DoubleAnimation(BlurStory, OElem, "Opacity", OElem.Opacity, OPACITY_IDLE);
                    BlurStory.Begin();
                }

                FocusManager.SetFocusedElement(Stage, Elem);
                Elem.CaptureMouse();
                DragStart       = e.GetPosition(Stage);
                Elem.MouseMove += _OnMove;

                SimpleStory.DoubleAnimation(ElemStory, Elem, "Opacity", Elem.Opacity, OPACITY_IDLE_FOCUS);
                ElemStory.Begin();
            };

            Elem.MouseUp += (s, e) =>
            {
                Elem.ReleaseMouseCapture();
                Elem.MouseMove -= _OnMove;

                SimpleStory.DoubleAnimation(ElemStory, Elem, "Opacity", Elem.Opacity, OPACITY_MOUSE_OVER);
                ElemStory.Begin();
            };
        }
Ejemplo n.º 16
0
 public bool IsSimilarTo(SimpleStory story)
 {
     return Similarity(story) >= 0.5;
 }
Ejemplo n.º 17
0
 public bool IsSimilarTo(SimpleStory story)
 {
     return(Similarity(story) >= 0.5);
 }