예제 #1
0
        public static void Main(string[] args)
        {
            Console.WriteLine("***************************");
            Console.WriteLine("*    Test Get ShareName   *");
            Console.WriteLine("***************************");
            var ShareName = new ShareTools();

            Console.WriteLine(ShareTools.GetShareName("AC FP"));
            Console.WriteLine("**************Get ShareName****************");
            Console.ReadKey(true);
        }
예제 #2
0
 public void btnOnShare(int idx)
 {
     PlatformType[] types = { PlatformType.WechatPlatform, PlatformType.WeChatMoments, PlatformType.QZone, PlatformType.SinaWeibo };
     if (SceneMgr.getInstance()._isInQuestionView)
     {
         ShareTools.getCurShareTools().shareByTypeWithHide(types[idx]);
     }
     else
     {
         ShareTools.getCurShareTools().shareByTypeWithoutCapture(types[idx]);
     }
 }
예제 #3
0
    private IEnumerator Capture(PlatformType type)
    {
        if (bNeedHideView)
        {
            shareview.GetComponent <CanvasGroup>().alpha = 0;
        }

        string pathSave = Application.persistentDataPath + "/" + "share.png";

        if (File.Exists(pathSave))
        {
            File.Delete(pathSave);
        }

        yield return(new WaitForEndOfFrame());

        var path = ShareTools.CaptureScreenshot("share.png");

        while (!File.Exists(path))
        {
            yield return(0);
        }

        if (bNeedHideView)
        {
            shareview.GetComponent <CanvasGroup>().alpha = 1;
            bNeedHideView = false;
        }

        ShareContent content = new ShareContent();

        content.SetText("this is a test string.");
        content.SetImagePath(Application.persistentDataPath + "/share.png");
        content.SetTitle("test title");
        content.SetShareType(ContentType.Image);

        if (type == PlatformType.QZone)
        {
            content.SetSite("Mob-ShareSDK");
            content.SetSiteUrl("http://www.mob.com");
            content.SetTitleUrl("http://www.mob.com");
            content.SetUrl("http://www.mob.com");
            content.SetComment("test description");
            //content.SetImageUrl("https://f1.webshare.mob.com/code/demo/img/1.jpg");
        }

        //ssdk.ShareContent(PlatformType.SinaWeibo, content);
        //ssdk.Authorize(type);
        ssdk.ShowShareContentEditor(type, content);
    }
예제 #4
0
        public MainWindowViewModel()
        {
            WindowPlotVM  = new PlotViewModel();
            userInputVM   = new UserInputViewModel();
            HedgingToolVM = new HedgingToolViewModel(UserInputVM);
            JsonHandlerVM = new JsonHandler();

            ComponentDatatypeList = new ObservableCollection <AbstractDataProviderViewModel>()
            {
                new SimulatedDataProviderViewModel(),
                new HistoricalDataProvioderViewModel()
            };
            ComponentOptionTypeList = new ObservableCollection <String>()
            {
                "VanillaCall",
                "BasketOption"
            };

            SelectedUnderlyingAndWeights = new Dictionary <string, double>();

            ComponentExistingSharesIds = new ObservableCollection <string>(ShareTools.GetAllShareIds());
            ComponentSelectedShareIds  = new ObservableCollection <string>();
            ComponentSelectedWeights   = new ObservableCollection <double>();
            ComponentSavedOptions      = new ObservableCollection <IOption>();
            JsonHandlerVM.LoadOptions();
            foreach (VanillaCall option in JsonHandlerVM.ListVanillaCalls)
            {
                ComponentSavedOptions.Add(option);
            }
            foreach (BasketOption option in JsonHandlerVM.ListBasketOptions)
            {
                ComponentSavedOptions.Add(option);
            }

            PlotCommand = new DelegateCommand(CanPlot);

            AddShareCommand = new DelegateCommand(AddShare);

            DeleteUnderlyingsCommand = new DelegateCommand(DeleteUnderlyings);
            AddOptionCommand         = new DelegateCommand(AddOption);
            RemoveOptionCommand      = new DelegateCommand(RemoveOption);
            LoadOptionCommand        = new DelegateCommand(LoadOption);
        }
예제 #5
0
 void Awake()
 {
     s_curShareTools = this;
 }
예제 #6
0
 public void btnOnShare(int idx)
 {
     PlatformType[] types = { PlatformType.WechatPlatform, PlatformType.WeChatMoments, PlatformType.QZone, PlatformType.SinaWeibo };
     ShareTools.getCurShareTools().shareByType(types[idx]);
 }