当前位置: 首页>>代码示例>>C#>>正文


C# Serializer.Activate方法代码示例

本文整理汇总了C#中Serializer.Activate方法的典型用法代码示例。如果您正苦于以下问题:C# Serializer.Activate方法的具体用法?C# Serializer.Activate怎么用?C# Serializer.Activate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Serializer的用法示例。


在下文中一共展示了Serializer.Activate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: buttonConnectRepository_Click

 private void buttonConnectRepository_Click(object sender, EventArgs e)
 {
     try
     {
         switch(repositoryType)
         {
             case "Remote":
                 repositorySerializer=new MS_SqlServerIPSerializer(textBoxUserName.Text,textBoxPassword.Text,textBoxRepository.Text,textBoxPort.Text,textBoxDBName.Text);
                 break;
             case "Local WA":
                 repositorySerializer=new MS_SqlServerWASerializier(textBoxRepository.Text,textBoxDBName.Text);
                 break;
             case "Local SQL":
                 repositorySerializer=new MS_SqlServerSerializer(textBoxUserName.Text,textBoxPassword.Text,textBoxRepository.Text,textBoxDBName.Text);
                 break;
             default:
                 Exception f=new Exception();
                 throw  f;
         }
     }
     catch (Exception f)
     {
         MessageBox.Show("Connection not possible. Please check values");
         return;
     }
     repositorySerializer.RegisterTypes(divMobiTypes);
     repositorySerializer.Activate();
     {
         buttonConnectRepository.BackColor = System.Drawing.SystemColors.Info;
         buttonConnectRepository.Text = "Connected";
         activationCheck();
     }
 }
开发者ID:Tobias-Schneider,项目名称:DiversityMobile,代码行数:33,代码来源:SyncPanel.cs

示例2: connectRepoitoryButton_Click

 private void connectRepoitoryButton_Click(object sender, EventArgs e)
 {
     repositorySerializer = new MS_SqlServerIPSerializer("Schneider", "[email protected]#7768","141.84.65.107","5432", "DiversityCollection_Monitoring", "[DiversityCollection_Monitoring].[dbo].");
     repositorySerializer.RegisterTypes(divMobiTypes);
     repositorySerializer.Activate();
     syncDBSerializer = new MS_SqlServerIPSerializer("Schneider", "[email protected]#7768", "141.84.65.107", "5432", "Synchronisation_Test", String.Empty);
     String syncIt = "[AGRambold2].SyncItem";
     MappingDictionary.Mapping.Add(typeof(SyncItem), syncIt);
     syncDBSerializer.RegisterType(typeof(SyncItem));
     syncDBSerializer.Activate();
     this.connectRepoitoryButton.Text="Connected to repository";
 }
开发者ID:Tobias-Schneider,项目名称:DiversityMobile,代码行数:12,代码来源:DirectTransferForm.cs

示例3: connectMobileButton_Click

 private void connectMobileButton_Click(object sender, EventArgs e)
 {
     OpenFileDialog dbConnectionDialog = new OpenFileDialog();
     dbConnectionDialog.Filter = "sdf files (*.sdf)|*.sdf"; //Im Moment wird nur das DB-Format von DiversityMobile unterstützt
     if (dbConnectionDialog.ShowDialog() == DialogResult.OK)
     {
         String mobileDBPath = @dbConnectionDialog.FileName;
         mobileDBSerializer = new MS_SqlCeSerializer(mobileDBPath);
         mobileDBSerializer.RegisterTypes(divMobiTypes);
         mobileDBSerializer.Activate();
         this.connectMobileButton.Text = "Connected to SDF";
     }
     else
         return;
 }
开发者ID:Tobias-Schneider,项目名称:DiversityMobile,代码行数:15,代码来源:DirectTransferForm.cs

示例4: buttonConnectTaxDB_Click

 private void buttonConnectTaxDB_Click(object sender, EventArgs e)
 {
     string connString = "Data Source=\"" + sdfPath + "\";Max Database Size=128;Default Lock Escalation=100;";
     SerMobile = new MS_SqlCeSerializer(@sdfPath);
     SerMobile.RegisterType(typeof(TaxonNames));
     SerMobile.Activate();
     buttonConnectMobile.Text = "Connected";
     buttonConnectMobile.BackColor = Color.Yellow;
     buttonSelect.Enabled = false;
     buttonSelect.BackColor = Color.DarkGray;
     buttonSelect.Text = "Closed";
     mobileConnection = true;
     startcheck();
 }
开发者ID:Tobias-Schneider,项目名称:DiversityMobile,代码行数:14,代码来源:TaxPanel.cs

示例5: buttonConnect_Click

 private void buttonConnect_Click(object sender, RoutedEventArgs e)
 {
     /*
     OpenFileDialog ofd=new OpenFileDialog();
     ofd.Filter = "Mobile Datenbanken |*.sdf";
     if (ofd.ShowDialog() == true)
     {
         mobSer = new MS_SqlCeSerializer(ofd.FileName);
     }
     else return;
     */
     repSer = new MS_SqlServerLocalSerializer("127.0.0.1", "5432", "DiversityCollection_Base");
     repSer.RegisterTypes(divMobiTypes);
     repSer.Activate();
     mobSer.RegisterTypes(divMobiTypes);
     mobSer.Activate();
 }
开发者ID:Tobias-Schneider,项目名称:DiversityMobile,代码行数:17,代码来源:Window1.xaml.cs

示例6: startMobileConnection

        private bool startMobileConnection(bool copy)
        {
            try
            {
                // copy mobile database to work directory?
                if (copy)
                {
                    if (activesync == true)
                    {
                        if (rapi.DevicePresent && rapi.Connected)
                            this.mobileRapiDesktop();
                        else
                            return false;
                    }
                    else
                    {
                        if (System.IO.File.Exists(mobileDBPath))
                        {
                            System.IO.File.Copy(mobileDBPath, progPath, true);
                            if (Directory.Exists(mobilePicturePath))
                            {
                                String[] pictures = System.IO.Directory.GetFiles(mobilePicturePath);
                                foreach (String pic in pictures)
                                {
                                    String fileName = String.Empty;
                                    String destPath = String.Empty;
                                    try
                                    {
                                        String sourcPath = pic;
                                        fileName = pic.Replace(mobilePicturePath, "");
                                        destPath = progPicturePath + fileName;
                                        File.Copy(sourcPath, destPath, false);
                                    }
                                    catch (Exception)
                                    {
                                        if (!File.Exists(destPath))
                                            MessageBox.Show("Unable to copy the following picture:" + fileName);
                                    }
                                }
                            }
                        }
                        else
                            return false;
                    }
                }

                mobileDBSerializer = new MS_SqlCeSerializer(progPath);
                mobileDBSerializer.RegisterTypes(divMobiTypes);
                mobileDBSerializer.RegisterType(typeof(UserProfile));
                mobileDBSerializer.Activate();
            }
            catch (Exception ex)
            {
                MessageBox.Show("The Database could not be connected. Perhaps the DB is in not a DiversityMobile DB.");
                MessageBox.Show("startMobileConnection: " + ex.Message);
                if (ex.InnerException != null)
                    MessageBox.Show("startMobileConnection Inner Exception: " + ex.InnerException.Message);
                mobileDBSerializer = null;
                mobileDBPath = null;
                this.labelConnectionMobile.Text = "Not Connected to MobileDB";
                return false;
            }

            return true;
        }
开发者ID:Tobias-Schneider,项目名称:DiversityMobile,代码行数:65,代码来源:Form1.cs


注:本文中的Serializer.Activate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。