123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331 |
- using Microsoft.AppCenter.Analytics;
- using PDF_Master.CustomControl;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Security.Policy;
- using System.Text;
- using System.Threading.Tasks;
- namespace PDFReader_WPF.Helper
- {
-
-
-
-
- public static class DataTrackingHelper
- {
-
-
-
- public static EventType EntryPathEventType;
-
-
-
- public static EntryPathKeyType EntryPathKey;
-
-
-
- public static string EntryPath = "";
-
-
-
- public static bool IsClearEntryPath = false;
-
-
-
-
-
- public static void SendEvent(string name, IDictionary<string, string> properties = null)
- {
- try
- {
- #if !DEBUG
- Analytics.TrackEvent(name, properties);
- #endif
- }
- catch { }
- }
- public static void SendEvent(EventType type, IDictionary<string, string> properties = null)
- {
- try
- {
- #if !DEBUG
- Analytics.TrackEvent(type.ToString(), properties);
- #endif
- }
- catch { }
- }
-
-
-
-
-
-
- public static void SendEvent(EventType type, string key, string value)
- {
- try
- {
- #if !DEBUG
- Analytics.TrackEvent(type.ToString(), new Dictionary<string, string>() { [key] = value });
- #else
-
-
-
- #endif
- }
- catch { }
- }
- public static void SetSendInformation(EventType type, EntryPathKeyType key)
- {
- IsClearEntryPath = false;
- EntryPathEventType = type;
- EntryPathKey = key;
- }
- public static void SendPurchaseEvent()
- {
- if (!string.IsNullOrEmpty(EntryPath) && !EntryPath.Contains("None"))
- {
- try
- {
- #if !DEBUG
- Analytics.TrackEvent(EntryPathEventType.ToString(), new Dictionary<string, string>() { [EntryPathKey.ToString()] = EntryPath });
- #else
-
-
-
- #endif
- if (IsClearEntryPath) { EntryPath = ""; }
-
- }
- catch { }
- }
- }
-
-
-
-
- public static void AddThirdPath(ThirdPath thirdPath = ThirdPath.Subscribe)
- {
- if (!string.IsNullOrEmpty(EntryPath) && !EntryPath.Contains("None"))
- {
- if (!EntryPath.Contains("_" + thirdPath.ToString()))
- {
- EntryPath = EntryPath + "_" + thirdPath.ToString();
- }
- }
- }
-
-
-
- public static void UpdateSecondaryPath(SecondaryPath secondaryPath)
- {
- if (!string.IsNullOrEmpty(EntryPath)) { EntryPath = EntryPath.Replace(EntryPath.Substring(EntryPath.IndexOf("_") + 1), secondaryPath.ToString()); }
- }
-
-
-
- public static void AddFirstAndSecondaryPath(FirstPath firstPath, SecondaryPath secondaryPath)
- {
- EntryPath = firstPath.ToString() + "_" + secondaryPath.ToString();
- }
- public enum EventType
- {
-
-
-
- LeftSideBar,
-
-
-
- Home,
-
-
-
- Tbr,
-
-
-
- SubTbr,
-
-
-
- TopTbr,
- App,
- ActiveDialog,
- OnBrd,
- PDFView,
-
-
-
- PUW,
-
-
-
- SubTbr_Editor,
-
-
-
- SubTbr_PageEdit,
-
-
-
- SubTbr_Tools,
-
-
-
- SubTbr_Annotation,
-
-
-
- SubTbr_EditPDF,
-
-
-
- SubTbr_Converter,
-
-
-
- Purchase_Editor,
-
-
-
- Purchase_Converter,
-
-
-
- Purchase_PageEdit,
-
-
-
- Purchase_EditPDF,
-
-
-
- Purchase_Redact,
-
-
-
- Purchase_Tools,
-
-
-
- Purchase_AI,
- Purchase_Annotation
- }
- public enum EntryPathKeyType
- {
- SubTbr_Editor,
- Onbrd_Converter,
- SubTbr_Converter,
- SubTbr_PageEdit,
- Tbr_EditPDF,
- Tbr_Redact,
- Tbr_OCR,
- SubTbr_Tools,
- Home_Tools,
- SubTbr_Annotation
- }
- public enum FirstPath
- {
-
-
-
- Reading,
-
-
-
- Home
- }
- public enum SecondaryPath
- {
- None,
- Compress,
- Merge,
- BatchEncypy,
- RemovePassword,
- AddWatermark,
- BachAddWatermark,
- RemoveWatermark,
- AddBackground,
- RemoveBackground,
- AddHeaderFooter,
- AddBates,
- toWord,
- toExcel,
- toPPT,
- toText,
- toRTF,
- toCSV,
- toHTML,
- toImage,
- ConvertPDF,
- ImagetoPDF,
- BatchToWord,
- BatchToExcel,
- BatchToPPT,
- BatchToText,
- BatchToRTF,
- BatchToCSV,
- BatchToHtml,
- BatchToImage,
- Insert,
- Rotate,
- Delete,
- Extract,
- EditPDF,
- Redact,
- OCR,
- WebsiteLink,
- EmailLink,
- DynamicStamp,
- CustomStamp,
- Signature,
- AddImage,
- AITranslate,
- AIRewrite,
- AICorrect,
- SetPassword,
- Crop,
- EditText,
- EditImage,
- Reverse,
- Replace,
- Copy,
- Split,
- Link,
- Sign,
- Stamp
- }
- public enum ThirdPath
- {
-
-
-
- Subscribe
- }
- }
- }
|